vpClassifyScalars(3)
β¨ vpClassifyScalars(3) β¨ β it's a Library Functions Manual moment, bestie
okay so literally the whole vibe of this page is: take a big pile of scalar data and turn it into a preclassified volume without ever building the 3D voxel array. no cap. it's giving "I don't have the RAM for that, and I'm not sorry."
π NAME π
vpClassifyScalars β create a preclassified volume from scalar data
π¦ SYNOPSIS π¦
#include <volpack.h>
vpResult
vpClassifyScalars(vpc, scalar_data, length, scalar_field,
gradient_field, norm_field)
vpContext *vpc;
unsigned char *scalars;
int size;
int scalar_field, gradient_field, norm_field;
πΈ ARGUMENTS πΈ
vpcβ the VolPack context you got fromvpCreateContext. your main character. π«Άscalar_dataβ a 3D array holding exactly one 8-bit scalar value for every voxel in the volume.lengthβ how bigscalar_datais, in bytes.scalar_fieldβ the field number that says this voxel field is where the scalar value lives.gradient_fieldβ the field number for storing the gradient magnitude of the scalar value.norm_fieldβ the field number for storing the surface normal vector for the voxel.
π DESCRIPTION π
vpClassifyScalars is literally vpVolumeNormals and vpClassifyVolume fused together, bestie β it makes a preclassified volume straight from a 3D array of scalar values, no 3D voxel array required. iconic behavior.
This is the move when you've got a huge data set to prep for rendering with a fixed classification function, especially when the 3D voxel array would be way too big to fit in main memory. like, girl, it's not gonna fit. stop trying.
The primary limitation (and yes, there is one, ngl): the only fields each voxel may contain are the ones vpVolumeNormals produces β an 8-bit scalar value, and an 8-bit gradient and/or a 16-bit surface normal vector. that's it. that's the menu.
Also see vpClassifyScanline if you'd rather process one scanline of a scalar array at a time. π
To actually use it:
- Define the volume size, voxel size, and voxel fields exactly like you would before calling
vpVolumeNormals. β¨ - But β plot twist β there's no need to call
vpSetRawVoxels. skip it. - Also define the opacity transfer function (peep
vpSetClassifierTable(3)). - Then call
vpClassifyScalarswith the same arguments you'd use forvpVolumeNormalsβvpVolumeNormals(3)has the deets if you need them.
The result is a preclassified volume, just like the one described in vpClassifyVolume(3). And if a voxel array has been declared? it is not used or modified. it's just sitting there. minding its business. π
β οΈ Any existing preclassified volume data is destroyed. like, gone gone. say your goodbyes. π
π STATE VARIABLES π
You can pull info about the current preclassified volume with these state variable codes (see vpGeti(3)):
VP_VIEW_X_SIZEVP_VIEW_Y_SIZEVP_VIEW_Z_SIZEVP_VIEW_X_AXISVP_VIEW_Y_AXISVP_VIEW_Z_AXIS
π ERRORS π
The normal return value is VP_OK. slay. but these error return values are also possible:
VPERROR_BAD_VOXELβ the voxel size or the voxel fields haven't been specified, or they've been specified incorrectly. not the vibe.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. also not the vibe.
π SEE ALSO π
VolPack(3), vpCreateContext(3), vpVolumeNormals(3), vpSetClassifierTable(3), vpClassifyVolume(3), vpClassifyScanline(3)
and that's the whole page, bestie π go forth and preclassify. this one came to you straight from the VolPack era of the library β vpClassifyScalars(3), no notes, periodt. πβ¨
π¦ where this page comes from
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- Copyright (c) 1995-2008, Stanford University
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms