vpStoreRawVolume(3)

πŸ“¦ version 1.0c7, in fedora 43, fedora 44

πŸ’Ύ vpStoreRawVolume(3) β€” like, the Library Functions Manual energy but make it cute

okay bestie, gather round, because this is the manual page for vpStoreRawVolume(3) and it is lowkey iconic 🌸


✨ NAME ✨

vpStoreRawVolume, vpStoreMinMaxOctree, vpStoreClassifiedVolume, vpStoreContext β€” the four besties whose whole job is storing volume data structures to a file πŸ’…

no cap, that's the entire vibe: you have a thing, you want it in a file, these are the girlies who do it.


πŸ¦‹ 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;

like… they're quadruplets. same signature, same energy, different destinies ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • vpc β€” your VolPack context, the one that came out of vpCreateContext. she's the main character, everything lives inside her πŸ’–
  • fd β€” a file descriptor from open(2), and it has to be open for writing. read-only? not the moment, bestie. πŸ™ˆ

🌈 DESCRIPTION 🌈

so here's the tea: these functions take volume data structures out of a rendering context and write them into files, in the exact format that the VolPack file reading routines can read back (peep vpLoadRawVolume(3) for that side of the story 🫢). it's giving "save game", it's giving "so we can load this later", it's giving storage slay.

  • vpStoreRawVolume β€” creates a 3D voxel array file ✨ the file has info about the size of the volume and the layout of the voxels, plus the volume data itself. the whole package. she's thorough.
  • vpStoreMinMaxOctree β€” creates a min-max octree file 🌳 again with the size info and voxel layout info, and then the octree itself riding along too.
  • vpStoreClassifiedVolume β€” creates a preclassified volume data file πŸ’š size info, voxel layout info, and the volume data itself. yes, same energy as the raw volume one, and no, we're not merging them, they're different functions and we respect that πŸ’…
  • vpStoreContext β€” creates a rendering context file πŸ‘‘ this one holds all the rendering parameters β€” except volume data and callback functions, those two get left at home 😭 β€” and it also stores the contents of any lookup tables for shading and classification. so basically the whole personality, minus the data and the callbacks.
also!! the function that actually does the writing can be swapped out by calling vpSetCallback with the VP_WRITE_FUNC option πŸ”₯ so if you wanted to, say, implement a file-compression system, this is your doorway. not me hyping up custom I/O, but like… it's right there.

⭐ STATE VARIABLES ⭐

the current file I/O parameters? retrievable. you just need these state variable codes (and yeah, go check vpGeti(3) for the how-to):

  • VP_WRITE_FUNC

πŸ’€ ERRORS πŸ’€

the normal return value is VP_OK β€” that's the "we ate and left no crumbs" outcome πŸ’–

but the following error return values are also possible, and bestie, we have to talk about them:

  • VPERROR_IO β€” the file writing function returned an error value, and in that case the external variable errno should contain an operating-system specific error code. or the file system is full 😭 either way, rough.
  • VPERROR_BAD_VOLUME β€” the volume dimensions are invalid, or there's no voxel data in the context. like, nothing to store. empty. ghosted.
  • VPERROR_BAD_SIZE β€” there's no min-max octree in the volume. and heads up, this one is vpStoreMinMaxOctree only. the other girlies don't care. 🧚
  • VPERROR_BAD_VOXEL β€” the voxel fields in the rendering context have not been properly defined. define them. please. for me. πŸ™

🌸 SEE ALSO 🌸


okay that's the whole page, no notes, periodt πŸ’…βœ¨

VolPack β€” vpStoreRawVolume(3) β€” mwah, that's a wrap, thanks for coming to my ted talk, love u, bye πŸ«ΆπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from