SoTransferFunction(3)
β¨ SoTransferFunction β¨
okay bestie, welcome to the glow-up zone π this one lives in the SIMVoleon library, it's a Library Functions Manual page, and it's literally all about the transfer function definition. she's giving main character energy in the volume rendering world, no cap π
π NAME π
SoTransferFunction β contains the transfer function definition. that's it, that's the whole name section, periodt π
π SYNOPSIS π
#include <VolumeViz/nodes/SoTransferFunction.h>
Inherits SoVolumeRendering.
πΈ Public Types πΈ
enum PredefColorMap { NONE = 0, GREY, GRAY = GREY, TEMPERATURE, PHYSICS,
STANDARD, GLOW, BLUE_RED, SEISMIC }
enum ColorMapType { ALPHA, LUM_ALPHA, RGBA }
π¦ Public Types inherited from SoVolumeRendering π¦
enum HW_Feature { HW_VOLUMEPRO, HW_3DTEXMAP, HW_TEXCOLORMAP,
HW_TEXCOMPRESSION }
enum HW_SupportStatus { NO, YES, UNKNOWN }
π Public Member Functions π
void reMap (int low, int high)
SbBool hasTransparency (void) const
β¨ Public Member Functions inherited from SoVolumeRendering β¨
HW_SupportStatus isSupported (HW_Feature feature)
π«Ά Static Public Member Functions π«Ά
static void initClass (void)
π Static Public Member Functions inherited from SoVolumeRendering π
static void init (void)
static void initClass (void)
static void setReadAlternateRep (SbBool flag)
static void setWriteAlternateRep (SbBool flag)
static SbBool getReadAlternateRep (void)
static SbBool getWriteAlternateRep (void)
static void setDelayedRendering (SbBool flag)
static SbBool getDelayedRendering (void)
π Public Attributes π
SoSFInt32 shift
SoSFInt32 offset
SoSFEnum predefColorMap
SoSFEnum colorMapType
SoMFFloat colorMap
π§ Protected Member Functions π§
virtual void doAction (SoAction *action)
virtual void GLRender (SoGLRenderAction *action)
virtual void callback (SoCallbackAction *action)
virtual void pick (SoPickAction *action)
π Friends π
class SoTransferFunctionP
π Detailed Description π
Contains the transfer function definition.
so like. this node sets up the mapping from voxel data values to actual on-screen color values and transparency / opaqueness. it's the whole vibe-translator between "here's a number" and "here's a color, bestie" π
she comes with a set of pre-defined color maps β the kind you see all the time in e.g. seismic visualization β and the option to set up one's own free-form color map lookup table. how? by setting SoTransferFunction::predefColorMap to NONE, and then doing it yourself π
iykyk.
πΈ Member Enumeration Documentation πΈ
π enum SoTransferFunction::PredefColorMap π
Predefined color transfer functions, each containing exactly 256 colors. (yes, exactly 256, don't try to be different β)
Enumerator
NONEβ if this is set, theSoTransferFunction::colorMapfield must be used. no pre-made map for you, you're on your own (respectfully) π«‘GREYβ default transfer function color map. The checker board indicates that this gradient is partly transparent. lowkey iconic.GRAYβ same asGREY. literally the same thing, just spelled differently, we love options πTEMPERATUREβ this gradient is fully opaque.PHYSICSβ this gradient is fully opaque.STANDARDβ this gradient is fully opaque.GLOWβ this gradient is fully opaque. β¨BLUE_REDβ this gradient is fully opaque.SEISMICβ this gradient is partly transparent.
π enum SoTransferFunction::ColorMapType π
Type of colormap array. Defines the possible values for the SoTransferFunction::colorMapType field. so basically, this tells the node how to read your array π
Enumerator
ALPHAβ each color entry in the transfer function has only one component, so theSoTransferFunction::colorMapfield should consist of exactly256float values, each value representing a transparency value. The RGB colors will all be set to[1,1,1], i.e. all white. π€LUM_ALPHAβ each transfer function color map entry inSoTransferFunction::colorMaphas two components, ie. two floats, so the field should contain exactly256*2 = 512values. The first float value of each pair is taken to be an intensity / grey color value, and the second float of each pair is a transparency value (as for theALPHAenum).RGBAβ four floats are used to specify each color of the transfer function.SoTransferFunction::colorMapshould consist of exactly256*4 = 1024float values. Each quadruple consist of intensity values for red, green, and blue, and then the fourth value is an alpha value, as forLUM_ALPHAandALPHA. π
math check bestie:256,512,1024. get those numbers wrong and the vibe check fails, fr fr π
π Member Function Documentation π
π― void SoTransferFunction::reMap (int low, int high)
Set two thresholds, where all transfer function mappings that ends up below the low value or above the high value are set to be completely transparent. so anything outside your little window? poof. invisible. gone. π»
Initial default values are [0, 65535].
π― SbBool SoTransferFunction::hasTransparency (void) const
(she's here, listed right in the member functions β that's all the doc gives us, bestie π«Ά)
π Member Data Documentation π
β SoSFInt32 SoTransferFunction::shift
Used to shift the voxel attribute value before assigning a color value from the transfer function color map. In pseudo-code:
colorvalue = transferfunction[(voxelvalue << shift) + offset]
(offset is the value of the SoTransferFunction::offset field.)
β SoSFInt32 SoTransferFunction::offset
See the SoTransferFunction::shift field. π (they're a package deal, your honor)
β SoSFEnum SoTransferFunction::predefColorMap
Sets up the transfer function to use. See SoTransferFunction::PredefColorMap for a list of the pre-defined color maps.
Note that most of the pre-defined color maps are all opaque, even for data value 0. This will often cause the unwanted behavior that the full data set will be completely opaque for visualization, so only the outer "walls" of the volume are shown. To avoid this, use the SoTransferFunction::reMap() method to "narrow" the data values that are to be rendered according to the transfer function (all values outside of the given range will then be fully transparent).
The value SoTransferFunction::NONE has special meaning: it signifies that none of the pre-defined values should be used, but that the transfer function color map should be fetched from the SoTransferFunction::colorMap field instead.
π¨ bestie listen: this is the classic oopsie. opaque everything = you only see the outer shell of your volume and you're like "where's my data π". hit reMap() and narrow that range. that's the fix. periodt.
β SoMFFloat SoTransferFunction::colorMap
An array of floats describing the transfer function. Each value must be normalized to be within [0.0, 1.0] for the intensity value of a color, or the alpha value for transparency.
The array must contain 256 colors. The number of floats needed in the array for each color depends on the SoTransferFunction::ColorMapType setting.
[0.0, 1.0]means normalized, bestie. don't be out here passing255.0and wondering why it's giving chaos π
βοΈ Author βοΈ
Generated automatically by Doxygen for SIMVoleon from the source code. (not a human, just a robot doing its lil thing π€π)
okay that's the whole page, you ate it π stay hydrated, normalize your floats, and remember: NONE means you are the color map now. slay π
β¨
SIMVoleon β Version 2.1.0 β SoTransferFunction(3) π¦ bye bestie, go render something gorgeous ππ
π¦ where this page comes from
- fedora 43: SIMVoleon-devel 2.1.0-9.fc43 Β· BSD-3-Clause
- fedora 43: SIMVoleon-devel 2.1.0-9.fc43 Β· BSD-3-Clause
- fedora 44: SIMVoleon-devel 2.1.0-11.fc44 Β· BSD-3-Clause
- fedora 44: SIMVoleon-devel 2.1.0-11.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms