vpClassifyScalars(3)

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

✨ 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 from vpCreateContext. your main character. 🫢
  • scalar_data β€” a 3D array holding exactly one 8-bit scalar value for every voxel in the volume.
  • length β€” how big scalar_data is, 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:

  1. Define the volume size, voxel size, and voxel fields exactly like you would before calling vpVolumeNormals. ✨
  2. But β€” plot twist β€” there's no need to call vpSetRawVoxels. skip it.
  3. Also define the opacity transfer function (peep vpSetClassifierTable(3)).
  4. Then call vpClassifyScalars with the same arguments you'd use for vpVolumeNormals β€” 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_SIZE
  • VP_VIEW_Y_SIZE
  • VP_VIEW_Z_SIZE
  • VP_VIEW_X_AXIS
  • VP_VIEW_Y_AXIS
  • VP_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