vpSetRawVoxels(3)

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

✨ vpSetRawVoxels(3) ✨

okay bestie, buckle up, this is a Library Functions Manual page for vpSetRawVoxels from VolPack, and it's literally the moment your volume data enters the chat πŸ’–


πŸ’« NAME πŸ’«

vpSetRawVoxels β€” specify an array of volume data


🌸 SYNOPSIS 🌸

#include <volpack.h>

vpResult
vpSetRawVoxels(vpc, voxels, size, xstride, ystride, zstride)
    vpContext *vpc;
    void *voxels;
    int size;
    int xstride, ystride, zstride;

πŸŽ€ ARGUMENTS πŸŽ€

  • vpc β€” the VolPack context you got from vpCreateContext. your main character ✨
  • voxels β€” a 3D array of voxels. the whole point, honestly.
  • size β€” how big the voxel array is, in bytes.
  • xstride β€” number of bytes from the beginning of one voxel to the beginning of the next voxel in the first array dimension.
  • ystride β€” number of bytes from the beginning of one voxel to the beginning of the next voxel in the second array dimension.
  • zstride β€” number of bytes from the beginning of one voxel to the beginning of the next voxel in the third array dimension.

πŸ¦‹ DESCRIPTION πŸ¦‹

so vpSetRawVoxels is the function you call to specify a 3D array that holds your volume data. that's it, that's the vibe.

the array must be large enough for the volume dimensions you set with vpSetVolumeSize and the voxel size you set with vpSetVoxelSize. no cutting corners, bestie, the math has to math. πŸ“

the data in the array can be initialized before or after you call vpSetRawVoxels β€” either order works, you do you. 🫢

lowkey a fun fact: some of the VolPack routines operate faster if the volume is stored in z-major order (xstride < ystride < zstride) β€” but it's not strictly necessary, so don't stress if that's not your setup. it's giving optimization, not obligation. πŸ’…

⚠️ important, and I need you to hear me on this one: the voxel array is not automatically deallocated when the context is destroyed with vpDestroyContext. the application is responsible for managing the memory associated with the volume array. that's on you, bestie, no one's coming to clean that up. 🧹

the voxel array can be a very large data structure β€” possibly larger than available main memory. like, genuinely huge. 😭 but plot twist: it's sometimes possible to precompute the optimized data structures required for the fast rendering algorithm without explicitly allocating a voxel array. see vpClassifyScalars(3) if that's your moment. ✨

and heads up: during the call to vpSetRawVoxels, any existing precomputed volume data structures in the context are destroyed. gone. deceased. πŸ’€


🌈 STATE VARIABLES 🌈

you can retrieve the current voxel array parameters with these state variable codes (see vpGeti(3)):

  • VP_VOXEL_DATA
  • VP_VOXEL_DATA_SIZE
  • VP_VOXEL_XSTRIDE
  • VP_VOXEL_YSTRIDE
  • VP_VOXEL_ZSTRIDE

πŸ’œ ERRORS πŸ’œ

the routine always returns VP_OK. always. it's the most unproblematic function in the whole library, honestly. no cap. πŸ‘‘


⭐ SEE ALSO ⭐

VolPack(3), vpCreateContext(3)


and that's the whole page, bestie!! this was VolPack's vpSetRawVoxels(3) manual page, brought to you by VolPack itself β€” go forth and set those raw voxels, you've got this πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from