vpClassifyScanline(3)

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

✨ vpClassifyScanline β€” the library function era πŸ’…

okay bestie, welcome to vpClassifyScanline(3) from the Library Functions Manual πŸŽ€ this is the VolPack girlie whose whole job is building a preclassified volume one scanline at a time. she's methodical. she's iconic. she does NOT do shortcuts. let's get into it πŸ¦‹


🌸 NAME 🌸

vpClassifyScanline β€” incrementally create a preclassified volume from scanlines of scalar data ✨


πŸ’– SYNOPSIS πŸ’–

#include <volpack.h>

vpResult
vpClassifyScanline(vpc, voxels)
    vpContext *vpc;
    void *voxels;

🫢 ARGUMENTS 🫢

  • vpc β€” the VolPack context, aka the one you got from vpCreateContext. your girl needs her context, no cap.
  • voxels β€” a 1D array of voxel data. just one dimension, she's lowkey simple like that πŸ’œ

✨ DESCRIPTION ✨

so here's the vibe: vpClassifyScanline is how you incrementally compute a preclassified volume. you feed it one scanline of voxels, she classifies it, she stores the result in the current preclassified volume. one at a time. patiently. main character energy fr fr πŸ”₯

the voxels argument is a 1D array containing 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 must be equal to the length of the X dimension of the volume. the 1D voxel array may be initialized with vpScanlineNormals or with a user-defined function, whichever you're feeling 🧚

the voxels in the array get classified using the current opacity transfer function (go look at vpSetClassifierTable(3) for that one) and then appended to the preclassified volume (peep vpClassifyVolume(3)). πŸ’«

⚠️ okay this part is important, bestie β€” scanlines must be processed in Z-major order: all of the scanlines in the Z=0 slice get processed from Y=0 onward, then the Z=1 slice is processed, and so on. do not freestyle this. the order is the order. 😭

when the last scanline in the volume has been processed, the preclassified data structure is ready to be used for rendering. and heads up: rendering is not possible until all scanlines have been processed. like, not even a little. so finish your homework before you go out πŸ’€

also, real talk: when the first scanline of a volume is passed to vpClassifyScanline, any existing preclassified volume data is destroyed. gone. poof. she clears the table before she sets it. πŸ™ˆ


πŸŽ€ ERRORS πŸŽ€

the normal return value is VP_OK β€” that's the slay outcome, the one we're manifesting 🌈

the following error return values are possible:

  • VPERROR_BAD_VOXEL β€” the voxel size or the voxel fields have not been specified, or have been incorrectly specified. you skipped a step, babe πŸ’€
  • VPERROR_BAD_CLASSIFIER β€” the opacity transfer function tables have invalid sizes, or are associated with invalid voxel fields, or have been incorrectly specified. the classifier is not classifying, she is going through it 😭

πŸ‘‘ SEE ALSO πŸ‘‘

VolPack(3), vpCreateContext(3), vpSetClassifierTable(3), vpClassifyVolume(3), vpClassifyScalars(3)

go read them, iykyk πŸ“š


this has been your girl vpClassifyScanline(3), straight out of the VolPack era, dated and versioned and everything β€” stay classy, stay Z-major, and drink some water πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from