vpClassifyScalars(3)
π vpClassifyScalars(3) π
okay bestie, so this is a library functions manual page for vpClassifyScalars(3), and it's literally the shortcut queen of the VolPack world. let's get into it π«Ά
β¨ NAME β¨
vpClassifyScalars β create a preclassified volume from scalar data. that's it, that's the whole vibe. π
πΈ 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 one 8-bit scalar value for each voxel in the volume. every voxel gets exactly one lil byte, no more no less.lengthβ size ofscalar_datain bytes. yes, bytes. πscalar_fieldβ field number identifying a voxel field for storing the scalar value.gradient_fieldβ field number identifying a voxel field for storing the gradient magnitude of the scalar value.norm_fieldβ field number identifying a voxel field for storing the surface normal vector for the voxel.
π DESCRIPTION π
vpClassifyScalars is giving combo move energy: it smooshes together the functionality of vpVolumeNormals and vpClassifyVolume so you can produce a preclassified volume directly from a 3D array of scalar values β no 3D voxel array needed. periodt.
it's highkey made for preparing large data sets for rendering with a fixed classification function, especially when the 3D voxel array would be too big to fit in main memory. like, if it doesn't fit, this is your girl. π
the primary limitation (and bestie, we must talk about it): the only fields each voxel may contain are the fields produced by vpVolumeNormals β that's an 8-bit scalar value, and an 8-bit gradient and/or a 16-bit surface normal vector. that's the whole menu, no substitutions.
also, if you want to process one scanline of a scalar array at a time instead, go look at vpClassifyScanline. π
how to actually use it, step by step π§
- first, define the volume size, voxel size, and voxel fields exactly like you would before calling
vpVolumeNormals. - however β and this is the slay part β there is no need to call
vpSetRawVoxels. skip it. not needed. π - also define the opacity transfer function (see
vpSetClassifierTable(3)). - then call
vpClassifyScalarswith the same arguments you would use forvpVolumeNormalsβ peepvpVolumeNormals(3)for more details. - the result is a preclassified volume, as described in
vpClassifyVolume(3). iconic.
if a voxel array has been declared, it is not used or modified. it's just sitting there, unbothered, moisturized, in its lane. π
β οΈ heads up: any existing preclassified volume data is destroyed. gone. say bye. π
β STATE VARIABLES β
you can retrieve 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. but sometimes things go sideways, and these are the possible error return values:
VPERROR_BAD_VOXELβ the voxel size or the voxel fields have not been specified, or have been incorrectly specified. bestie. you forgot a step.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 said no. π
π SEE ALSO π
VolPack(3), vpCreateContext(3), vpVolumeNormals(3), vpSetClassifierTable(3), vpClassifyVolume(3), vpClassifyScanline(3)
that's the whole page, bestie, no cap π this came out of the VolPack library β volume rendering royalty β and it's the vpClassifyScalars(3) page, so if you ever forget, just remember: VolPack, vpClassifyScalars(3), and you're set. slay, go classify some scalars. β¨π¦πΈ
π¦ 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