vpClassifyScanline(3)
π vpClassifyScanline β from the VolPack library manual, section 3 π
okay bestie, gather round, because we're about to talk about vpClassifyScanline(3) from the VolPack library β yes, the Library Functions Manual one, the legend herself. she's the girl who builds your preclassified volume one scanline at a time, and honestly? she ate. π
β¨ NAME β¨
vpClassifyScanline β incrementally create a preclassified volume from scanlines of scalar data. like, little by little, scanline by scanline, no cap. π
πΈ SYNOPSIS πΈ
#include <volpack.h>
vpResult
vpClassifyScanline(vpc, voxels)
vpContext *vpc;
void *voxels;
π ARGUMENTS π
vpcβ the VolPack context you got fromvpCreateContext. your main character struct, basically. πvoxelsβ a 1D array of voxel data. just a lil lineup of voxels, living their truth.
π¦ DESCRIPTION π¦
so the way that vpClassifyScanline works is: you use her to incrementally compute a preclassified volume. she classifies one scanline of voxels at a time and drops the result straight into the current preclassified volume. one at a time, bestie. she's not doing all of it at once, that's not her vibe.
the voxels argument is a 1D array holding voxels in the format you already specified earlier with vpSetVoxelSize and vpSetVoxelField. and listen β you must call vpVolumeSize to declare the size of the volume before the very first call to vpClassifyScanline. non-negotiable. also, the length of that 1D voxel array has to be exactly equal to the length of the X dimension of the volume. not more, not less, exactly. β¨
and guess what, you can initialize that 1D voxel array with vpScanlineNormals or with your own user-defined function β your call, your era. π
the voxels in the array get classified using the current opacity transfer function (go peek at vpSetClassifierTable(3)) and then they're appended to the preclassified volume (hi vpClassifyVolume(3), ily). π
now here's the part you can't skip: scanlines must be processed in Z-major order. so all the scanlines in the Z=0 slice get processed starting from Y=0 onward, then the Z=1 slice gets processed, and so on forever until you're done. no jumping around, that's giving chaos energy and the volume does not want that. π
once the last scanline in the volume has been processed, the preclassified data structure is ready to be used for rendering. slay! but β and this is important β rendering is not possible until all scanlines have been processed. not a single one. don't even try it. π
β οΈ and when the first scanline of a volume gets passed to vpClassifyScanline, any existing preclassified volume data is destroyed. gone. deleted. she does not do leftovers. π
π ERRORS π
the normal return value is VP_OK. iconic. but the following error return values are possible, and yes, you will meet them:
VPERROR_BAD_VOXELβ the voxel size or the voxel fields have not been specified, or they've been incorrectly specified. like girl, we needed those. πVPERROR_BAD_CLASSIFIERβ the opacity transfer function tables have invalid sizes, or they're associated with invalid voxel fields, or they've been incorrectly specified. messy. π
π SEE ALSO π
VolPack(3), vpCreateContext(3), vpSetClassifierTable(3), vpClassifyVolume(3), vpClassifyScalars(3) β the whole friend group, go read them, iykyk. π«Ά
okay that's the whole page bestie, and as a lil sign-off: this one comes to you from VolPack β that's the source/version vibe β under the vpClassifyScanline(3) name, exactly like the header says at the top. periodt. πβ¨
π¦ 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