.\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford .\" Junior University. All rights reserved. .\" .\" Permission to use, copy, modify and distribute this software and its .\" documentation for any purpose is hereby granted without fee, provided .\" that the above copyright notice and this permission notice appear in .\" all copies of this software and that you do not sell the software. .\" Commercial licensing is available by contacting the author. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, .\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY .\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. .\" .\" Author: .\" Phil Lacroute .\" Computer Systems Laboratory .\" Electrical Engineering Dept. .\" Stanford University .\" .\" $Date: 1994/12/31 19:49:53 $ .\" $Revision: 1.1 $ .\" .\" Macros .\" .FS -- function start .\" is return type of function .\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. .\" .FA -- function arguments .\" one argument declaration follows on next line .de FA .IP " " 4 .. .\" .FE -- function end .\" end of function declaration .de FE .PD .. .\" .DS -- display start .de DS .IP " " 4 .. .\" .DE -- display done .de DE .LP .. .TH vpStoreRawVolume 3 "" VolPack .SH NAME vpStoreRawVolume, vpStoreMinMaxOctree, vpStoreClassifiedVolume, vpStoreContext \- store volume data structures to a file .SH SYNOPSIS #include .sp .FS vpResult \fBvpStoreRawVolume(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .sp .FS vpResult \fBvpStoreMinMaxOctree(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .sp .FS vpResult \fBvpStoreClassifiedVolume(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .sp .FS vpResult \fBvpStoreContext(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIfd\fR File descriptor from \fBopen\fR(2), open for writing. .SH DESCRIPTION These functions are used to store volume data structures from a rendering context into files in the format read by the VolPack file reading routines (see vpLoadRawVolume(3)). .PP \fBvpStoreRawVolume\fR creates a 3D voxel array file. The file includes information about the size of the volume and the layout of the voxels as well as the volume data itself. .PP \fBvpStoreMinMaxOctree\fR creates a min-max octree file. The file includes information about the size of the volume and the layout of the voxels as well as the octree itself. .PP \fBvpStoreClassifiedVolume\fR creates a preclassified volume data file. The file includes information about the size of the volume and the layout of the voxels as well as the volume data itself. .PP \fBvpStoreContext\fR creates a rendering context file. The file includes all rendering parameters except volume data and callback functions. The contents of any lookup tables for shading and classification are also stored. .PP The function used to write data to the files can be set by calling \fBvpSetCallback\fR with the VP_WRITE_FUNC option. This could be used to implement a file-compression system, for example. .SH "STATE VARIABLES" The current file I/O parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_WRITE_FUNC. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_IO The file writing function returned an error value (in which case the external variable \fBerrno\fR should contain an operating-system specific error code), or the file system is full. .IP VPERROR_BAD_VOLUME The volume dimensions are invalid, or there is no voxel data in the context. .IP VPERROR_BAD_SIZE There is no min-max octree in the volume (\fBvpStoreMinMaxOctree\fR only). .IP VPERROR_BAD_VOXEL The voxel fields in the rendering context have not been properly defined. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpLoadRawVolume(3)