vpSetRawVoxels(3)
π vpSetRawVoxels(3) β Library Functions Manual π
okay bestie, gather round, because this is the one where you hand VolPack your actual voxel data. yes, the data. the whole 3D volume. no big deal or anything π
β¨ 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 fromvpCreateContext. your main character struct, fr.voxelsβ a 3D array of voxels. the actual goods. πsizeβ how big that voxel array is, in bytes. the vibe check on its size, if you will.xstrideβ number of bytes from the beginning of one voxel to the beginning of the next voxel in the first array dimension. (so: how far you gotta scoot to get to your neighbor along x)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. slay, three whole strides.
π DESCRIPTION π
vpSetRawVoxels is how you tell VolPack "hey, here's the 3D array holding my volume data." that's it, that's the job. π
the array must be large enough for the volume dimensions you set with vpSetVolumeSize and the voxel size you set with vpSetVoxelSize. no cap. if it's too small, that's on you, not on me. the data inside the array can be initialized either before or after you call vpSetRawVoxels β whenever, we're flexible like that β¨
lowkey a glow-up tip: some of the VolPack routines operate faster if the volume is stored in z-major order (xstride < ystride < zstride) β but it is not strictly necessary, so don't stress if that's not your arrangement. do it if you can, it's giving optimized.
π«Ά important, bestie: 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 memory is yours. you freed it, you own it. periodt.
the voxel array can be a very large data structure, possibly larger than available main memory π like, genuinely huge. and here's the iconic part: it is sometimes possible to precompute the optimized data structures required for the fast rendering algorithm without explicitly allocating a voxel array. see vpClassifyScalars(3) for that move. iykyk.
β οΈ also, heads up: during the call to vpSetRawVoxels, any existing precomputed volume data structures in the context are destroyed. gone. deleted. not me casually wiping your precomputed data π. plan accordingly.
π STATE VARIABLES π
you can pull the current voxel array parameters back out with these state variable codes (peep vpGeti(3)):
VP_VOXEL_DATAVP_VOXEL_DATA_SIZEVP_VOXEL_XSTRIDEVP_VOXEL_YSTRIDEVP_VOXEL_ZSTRIDE
β ERRORS β
the routine always returns VP_OK. always. it's never not okay. the most unproblematic function in the whole library, honestly. π
π¦ SEE ALSO π¦
and that's the whole page, bestie!! this lil manual page came to you straight from the VolPack library, and yes, it is literally titled vpSetRawVoxels(3) β go forth and set those raw voxels, you absolute icon ππ
β¨
π¦ 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