vpGeti(3)

โœจ vpGeti(3) โ€” get the value of an option โœจ

okay bestie, so this is from the Library Functions Manual and it's literally your getter squad for VolPack rendering contexts. We're talking vpGeti, vpGetd, and vpGetp โ€” three functions that let you peek at integer, double, and pointer state variables. It's giving "tell me what my context is thinking" energy. ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

vpGeti, vpGetd, vpGetp โ€” get the value of an option. That's it. That's the whole vibe. ๐ŸŽ€


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <volpack.h>

vpResult
vpGeti(vpc, option, iptr)
    vpContext *vpc;
    int option;
    int *iptr;

vpResult
vpGetd(vpc, option, dptr)
    vpContext *vpc;
    int option;
    double *dptr;

vpResult
vpGetp(vpc, option, pptr)
    vpContext *vpc;
    int option;
    void *pptr;

๐ŸŽ€ ARGUMENTS ๐ŸŽ€

  • vpc โ€” VolPack context from vpCreateContext. It's your main character, the whole rendering setup. ๐Ÿ‘‘
  • option โ€” Constant that specifies the option to be retrieved. Like, which setting are we snooping on? ๐Ÿ™ˆ
  • iptr โ€” Location to store an integer result. Bestie, the int goes here. ๐Ÿ’–
  • dptr โ€” Location to store a double result. The double goes here. โœจ
  • pptr โ€” Location to store a pointer result. The pointer goes here. ๐Ÿซถ

๐Ÿ’– DESCRIPTION ๐Ÿ’–

These functions are used to get the values of integer-, double- or pointer-valued state variables in a rendering context. So like, they're the read-only besties to your vpSet* functions. No cap. ๐Ÿงš

The following list summarizes the integer-valued options that can be retrieved with vpGeti. The value of the option is stored in the location given by iptr; the return value of vpGeti is not the value of the option โ€” it's a vpResult, okay? Unless otherwise noted, the result is a single integer and iptr should point to a single integer location.

๐Ÿงฎ Integer-valued options (for vpGeti) ๐Ÿงฎ

  • VP_XLEN โ€” Get the length of the X dimension of the volume in voxels.
  • VP_YLEN โ€” Get the length of the Y dimension of the volume in voxels.
  • VP_ZLEN โ€” Get the length of the Y dimension of the volume in voxels.
  • VP_BYTES_PER_VOXEL โ€” Get the size of a voxel in bytes.
  • VP_VOXEL_FIELD_COUNT โ€” Get the number of fields in a voxel.
  • VP_SHADE_FIELD_COUNT โ€” Get the number of fields in a voxel used as parameters for shading the voxel.
  • VP_FIELD_SIZES โ€” Get the size of each voxel field in bytes. iptr must point to an array of integers containing one entry for each voxel field (use VP_VOXEL_FIELD_COUNT to determine the number of fields).
  • VP_FIELD_OFFSETS โ€” Get the byte offset from the beginning of a voxel for each voxel field. iptr must point to an array of integers containing one entry for each voxel field (use VP_VOXEL_FIELD_COUNT to determine the number of fields).
  • VP_FIELD_MAXES โ€” Get the maximum value of the quantity stored in each voxel field. iptr must point to an array of integers containing one entry for each voxel field (use VP_VOXEL_FIELD_COUNT to determine the number of fields).
  • VP_VOXEL_DATA_SIZE โ€” Get the size (in bytes) of the 3D voxel array.
  • VP_VOXEL_XSTRIDE โ€” Get the stride (in bytes) for the X dimension of the 3D voxel array.
  • VP_VOXEL_YSTRIDE โ€” Get the stride (in bytes) for the Y dimension of the 3D voxel array.
  • VP_VOXEL_ZSTRIDE โ€” Get the stride (in bytes) for the Z dimension of the 3D voxel array.
  • VP_CLASSIFY_FIELD_COUNT โ€” Get the number of fields in a voxel used as parameters for classifying the voxel (the number of arguments to the opacity transfer function).
  • VP_CLASSIFY_FIELDS โ€” Get the field numbers for the arguments to the opacity transfer function. iptr must point to an array of integers containing one entry for each argument (use VP_CLASSIFY_FIELD_COUNT to determine the number of arguments).
  • VP_CLASSIFY_TABLE_SIZES โ€” Get the size (in bytes) of each lookup table used for the opacity transfer function. iptr must point to an array of integers containing one entry for each lookup table (use VP_CLASSIFY_FIELD_COUNT to determine the number of lookup tables, which equals the number of arguments to the opacity transfer function).
  • VP_COLOR_CHANNELS โ€” Get the number of color channels that the current shading lookup tables or shading callback function will produce.
  • VP_SHADE_COLOR_SIZE โ€” Get the size of the shading lookup table for color values (see vpSetLookupShader(3)).
  • VP_SHADE_WEIGHT_SIZE โ€” Get the size of the shading lookup table for weight values (see vpSetLookupShader(3)).
  • VP_MATERIAL_COUNT โ€” Get the number of material types used by the current lookup shader (see vpSetLookupShader(3)).
  • VP_SHADE_COLOR_FIELD โ€” Get the field number used for indexing the shading lookup table for color values (see vpSetLookupShader(3)).
  • VP_SHADE_WEIGHT_FIELD โ€” Get the field number used for indexing the shading lookup table for weight values (see vpSetLookupShader(3)).
  • VP_LIGHT0 โ€” The retrieved value is nonzero if the corresponding light is enabled, or 0 if it is disabled.
  • VP_LIGHT1 โ€” The retrieved value is nonzero if the corresponding light is enabled, or 0 if it is disabled.
  • VP_LIGHT2 โ€” The retrieved value is nonzero if the corresponding light is enabled, or 0 if it is disabled.
  • VP_LIGHT3 โ€” The retrieved value is nonzero if the corresponding light is enabled, or 0 if it is disabled.
  • VP_LIGHT4 โ€” The retrieved value is nonzero if the corresponding light is enabled, or 0 if it is disabled.
  • VP_LIGHT5 โ€” The retrieved value is nonzero if the corresponding light is enabled, or 0 if it is disabled.
  • VP_LIGHT_BOTH_SIDES โ€” The retrieved value is nonzero if two-sided lighting is enabled (see vpSetLight(3)), or 0 if it is disabled.
  • VP_REVERSE_SURFACE_SIDES โ€” The retrieved value is nonzero if the definitions of interior and exterior surfaces have been reversed (see vpSetMaterial(3)), or 0 if they have not.
  • VP_DEPTH_CUE โ€” The retrieved value is nonzero if depth cueing is enabled, or 0 if it is disabled.
  • VP_DEPTH_CUE_TABLE_SIZE โ€” Get the current number of entries in the depth cueing table (see vpSetDepthCueing(3)).
  • VP_DEPTH_CUE_SIZE_HINT โ€” Get the current hint for the number of entries in the depth cueing table (see vpSetDepthCueing(3)).
  • VP_CURRENT_MATRIX โ€” Get the identifier for the current transformation matrix (VP_MODEL, VP_VIEW or VP_PROJECT).
  • VP_CONCAT_MODE โ€” Get the identifier for the current matrix concatenation mode (VP_CONCAT_LEFT or VP_CONCAT_RIGHT).
  • VP_IMAGE_WIDTH โ€” Get the width (in pixels) of the output image array.
  • VP_IMAGE_HEIGHT โ€” Get the height (in pixels) of the output image array.
  • VP_IMAGE_SCAN_SIZE โ€” Get the number bytes per scanline in the output image array.
  • VP_VIEW_AXIS โ€” Get the identifier for the current major viewing axis in the object coordinate system (VP_X_AXIS, VP_Y_AXIS or VP_Z_AXIS). The axis depends on the viewing transformation.
  • VP_INTERMEDIATE_WIDTH โ€” Get the width (in pixels) of the intermediate image required to render the current volume with the current viewing transformation (see vpRenderRawVolume(3)).
  • VP_INTERMEDIATE_HEIGHT โ€” Get the height (in pixels) of the intermediate image required to render the current volume with the current viewing transformation (see vpRenderRawVolume(3)).
  • VP_INTERMEDIATE_COLOR โ€” Get the number of color channels in the intermediate image (see vpRenderRawVolume(3)).
  • VP_INT_WIDTH_HINT โ€” Get the current hint for the width (in pixels) of the intermediate image (see vpRenderRawVolume(3)).
  • VP_INT_HEIGHT_HINT โ€” Get the current hint for the height (in pixels) of the intermediate image (see vpRenderRawVolume(3)).
  • VP_VIEW_X_AXIS โ€” The retrieved value is non-zero if computing a preclassified volume for the corresponding major viewing axis is enabled (see vpClassifyVolume(3)).
  • VP_VIEW_Y_AXIS โ€” The retrieved value is non-zero if computing a preclassified volume for the corresponding major viewing axis is enabled (see vpClassifyVolume(3)).
  • VP_VIEW_Z_AXIS โ€” The retrieved value is non-zero if computing a preclassified volume for the corresponding major viewing axis is enabled (see vpClassifyVolume(3)).
  • VP_VIEW_X_SIZE โ€” Get the size (in bytes) of the preclassified volume for the corresponding major viewing axis.
  • VP_VIEW_Y_SIZE โ€” Get the size (in bytes) of the preclassified volume for the corresponding major viewing axis.
  • VP_VIEW_Z_SIZE โ€” Get the size (in bytes) of the preclassified volume for the corresponding major viewing axis.
  • VP_MMOCTREE_THRESHOLDS โ€” Get the current min-max octree range thresholds. iptr must point to an array of integers containing one entry for each threshold (use VP_CLASSIFY_FIELD_COUNT to determine the number of thresholds, which equals the number of arguments to the opacity transfer function).
  • VP_MMOCTREE_SIZE โ€” Get the size (in bytes) of the min-max octree.
  • VP_SHADOW โ€” The retrieved value is nonzero if shadows are enabled (see vpSetShadowLookupShader(3)).
  • VP_SHADOW_LIGHT โ€” Get the constant (e.g. VP_LIGHT0) associated with the current shadow light (see vpSetShadowLookupShader(3)).
  • VP_SHADOW_WIDTH_HINT โ€” Get the current hint for the width (in pixels) of the shadow buffer (see vpSetShadowLookupShader(3)).
  • VP_SHADOW_HEIGHT_HINT โ€” Get the current hint for the height (in pixels) of the shadow buffer (see vpSetShadowLookupShader(3)).
  • VP_SHADOW_COLOR_SIZE โ€” Get the size of the shading lookup table for shadowed color values (see vpSetShadowLookupShader(3)).
  • VP_SHADOW_BIAS โ€” Get the current shadow bias value (see vpSetShadowLookupShader(3)).
  • VP_PIXEL_TYPE โ€” Get the current image pixel type (see vpSetImage(3)).
  • VP_CLAMP_SHADE_TABLE โ€” The retrieved value is nonzero if clamping is enabled for shade table entries, or 0 if it is disabled (see vpShadeTable(3)).
  • VP_COMPOSITE_ORDER โ€” This value is used for debugging only. It returns 1 if the current major viewing axis (VP_VIEW_AXIS) points in the same direction as the viewing direction, or -1 if they point in opposite directions.

๐Ÿ’ง Double-valued options (for vpGetd) ๐Ÿ’ง

The result is always a single double and dptr should point to a single double location.

  • VP_MIN_VOXEL_OPACITY โ€” Get the minimum opacity threshold (see vpSeti(3)).
  • VP_DEPTH_CUE_FRONT โ€” Get the front depth cueing factor (see vpSetDepthCueing(3)).
  • VP_DEPTH_CUE_DENSITY โ€” Get the depth cueing density (see vpSetDepthCueing(3)).
  • VP_DEPTH_CUE_QUANTIZATION โ€” Get the depth cueing quantization (see vpSetDepthCueing(3)).
  • VP_MAX_RAY_OPACITY โ€” Get the maximum opacity threshold (see vpSeti(3)).

๐ŸŽ€ Pointer-valued options (for vpGetp) ๐ŸŽ€

Unless otherwise noted, the result is a single pointer and pptr should point to a single pointer location.

  • VP_VOXEL_DATA โ€” Get a pointer to the 3D voxel array.
  • VP_CLASSIFY_TABLES โ€” Get pointers to each of the lookup tables for the opacity transfer function. pptr must point to an array of pointers containing one entry for each table (use VP_CLASSIFY_FIELD_COUNT to determine the number of tables, which is equal to the number of arguments to the opacity transfer function).
  • VP_SHADE_FUNC โ€” Get the shading callback function (see vpSetLookupShader(3)).
  • VP_SHADE_COLOR_TABLE โ€” Get a pointer to the shading lookup table for colors (see vpSetLookupShader(3)).
  • VP_SHADE_WEIGHT_TABLE โ€” Get a pointer to the shading lookup table for weights (see vpSetLookupShader(3)).

โœจ OPTIONS โœจ

okay bestie, so these are the option arguments you can pass to vpGeti to get all sorts of pointers and stuff. each one is a whole vibe, let's go:

  • VP_IMAGE โ€” grabs you a pointer to the output image array, no cap (peep vpSetImage(3) for the tea).
  • VP_LOG_ALLOC_FUNC โ€” gets a pointer to the memory allocator logging function, periodt (see vpSetCallback(3)).
  • VP_LOG_FREE_FUNC โ€” gets a pointer to the memory deallocator logging function, fr fr (see vpSetCallback(3)).
  • VP_STATUS_FUNC โ€” gets a pointer to the status reporting function, lowkey useful (see vpSetCallback(3)).
  • VP_READ_FUNC โ€” gets a pointer to the file I/O read function, iykyk (see vpSetCallback(3)).
  • VP_WRITE_FUNC โ€” gets a pointer to the file I/O write function, slay (see vpSetCallback(3)).
  • VP_MMAP_FUNC โ€” gets a pointer to the file I/O memory mapping function, highkey important (see vpSetCallback(3)).
  • VP_CLIENT_DATA โ€” gets a pointer to the client data, bestie (see vpSetClientData(3)).
  • VP_SHADOW_COLOR_TABLE โ€” gets a pointer to the shading lookup table for shadowed color values, iconic (see vpSetShadowLookupShader(3)).

๐Ÿ˜ญ ERRORS ๐Ÿ˜ญ

so like, the normal return value is VP_OK, that's the good ending. but sometimes things go sideways and you get these error return values:

  • VPERROR_BAD_OPTION โ€” the option argument is invalid, oop ๐Ÿ’€
  • VPERROR_SINGULAR โ€” one of the current view transformation matrices is singular. (Only possible for options that depend on the current view transformation). that's giving math meltdown, not the vibe.

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€


that's the whole page, bestie! brought to you by VolPack, manual page vpGeti(3). now go slay some graphics ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from