vpStoreRawVolume(3)
β¨ vpStoreRawVolume β¨ (the 3 library-functions era, bestie)
okay so real talk, this whole page lives in section 3 of the manual β the Library Functions Manual β and it's the moment your volume data finally gets to leave the context and go live in a file. π four functions, one mission: save it, don't lose it.
πΈ NAME πΈ
vpStoreRawVolume, vpStoreMinMaxOctree, vpStoreClassifiedVolume, vpStoreContext β store volume data structures to a file πΎβ¨
π¦ SYNOPSIS π¦
#include <volpack.h>
vpResult
vpStoreRawVolume(vpc, fd)
vpContext *vpc;
int fd;
vpResult
vpStoreMinMaxOctree(vpc, fd)
vpContext *vpc;
int fd;
vpResult
vpStoreClassifiedVolume(vpc, fd)
vpContext *vpc;
int fd;
vpResult
vpStoreContext(vpc, fd)
vpContext *vpc;
int fd;
π ARGUMENTS π
vpcβ the VolPack context you got fromvpCreateContext. your main character. πfdβ a file descriptor fromopen(2), and it has to be opened for writing. no writing to read-only fds, that's not the vibe. π«
π DESCRIPTION π
these four besties are how you take volume data structures out of a rendering context and drop them into files β specifically into the format that the VolPack file reading routines understand (peep vpLoadRawVolume(3) for the other side of that story π«Ά). it's giving save-game energy, it's giving persistence.
vpStoreRawVolumeβ makes a 3D voxel array file. the file carries info about the size of the volume and the layout of the voxels, plus the volume data itself. β¨vpStoreMinMaxOctreeβ makes a min-max octree file. the file carries info about the size of the volume and the layout of the voxels, plus the octree itself. π³vpStoreClassifiedVolumeβ makes a preclassified volume data file. the file carries info about the size of the volume and the layout of the voxels, plus the volume data itself. π§vpStoreContextβ makes a rendering context file. this one holds all rendering parameters β except volume data and callback functions, those are staying home π β and the contents of any lookup tables for shading and classification get stored too. π
lowkey the best part: the function that actually writes the data to the files can be swapped out by callingvpSetCallbackwith theVP_WRITE_FUNCoption. want to build a whole file-compression system on top of this? the manpage literally says "for example". go off. π₯
β STATE VARIABLES β
the current file I/O parameters are retrievable with the following state variable codes (check vpGeti(3) for how): VP_WRITE_FUNC.
π ERRORS π
the normal return value is VP_OK β that's the slay outcome. πβ¨ these are the other possibilities, and yes you should know them:
VPERROR_IOβ the file writing function returned an error value (in which case the external variableerrnoshould contain an operating-system specific error code), or the file system is full. π that second one hurts.VPERROR_BAD_VOLUMEβ the volume dimensions are invalid, or there is no voxel data in the context. nothing to save, bestie. πVPERROR_BAD_SIZEβ there is no min-max octree in the volume (vpStoreMinMaxOctreeonly). just this one, don't @ the others. πVPERROR_BAD_VOXELβ the voxel fields in the rendering context have not been properly defined. fix that first, fr fr. π§
π SEE ALSO π
VolPack(3), vpCreateContext(3), vpLoadRawVolume(3)
and that's the page!! this one's brought to you by VolPack β the source and version behind vpStoreRawVolume(3), aka the name that shows up in the footer of this very manual page. no date on this one, so we're just vibing with the source. mwah, go store some volumes ππ
π
π¦ where this page comes from
- debian bookworm: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- debian trixie: libvolpack1-dev 1.0b3-10 Β· BSD-3-Clause
- ubuntu jammy: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- ubuntu noble: libvolpack1-dev 1.0b3-9.1 Β· BSD-3-Clause
- ubuntu questing: libvolpack1-dev 1.0b3-11
- ubuntu resolute: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- ubuntu stonking: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- Copyright (c) 1994 The Board of Trustees of The Leland Stanford
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms