SoColorMap Class Reference
[Textures]

VSG extension Class for indexed texture color map More...

#include <Inventor/nodes/SoColorMap.h>

Inheritance diagram for SoColorMap:
SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Types

enum  ColorMapFormat {
  LUMINANCE,
  ALPHA,
  LUMINANCE_ALPHA,
  RGB,
  RGB_ALPHA
}
enum  PredefinedColorMap {
  NONE,
  GRAY,
  TEMPERATURE,
  PHYSICS,
  STANDARD,
  GLOW,
  BLUE_RED,
  SEISMIC,
  BLUE_WHITE_RED,
  INTENSITY,
  LABEL_256,
  VOLREN_RED,
  VOLREN_GREEN,
  AIRWAY,
  AIRWAY_SURFACES,
  INTENSITY_REVERSED
}
enum  Interpolation {
  NEAREST,
  LINEAR
}

Public Member Functions

virtual SoType getTypeId () const
 SoColorMap ()
unsigned int getNumColor () const
SbBool hasTransparency () const

Static Public Member Functions

static SoType getClassTypeId ()

Public Attributes

SoSFFloat min
SoSFFloat max
SoSFEnum predefinedColorMap
SoSFEnum colorMapFormat
SoMFFloat colorMap
SoSFEnum interpolation

Detailed Description

VSG extension Class for indexed texture color map

This class describes the association between values of the SoIndexedTexture2 node and colors.

The data value coming from the SoIndexedTexture2 node is used as an index into the color map defined by the colorMap field or the predefinedColorMap field.

The predefinedColorMap field allows you to specify a predefined color map or using value NONE, that the color map is contained in the colorMap field.

The min and max fields define the range of the data values that will actually be used. The color map is modified such that only data values ranging from min to max will be mapped to the color map. The figure below illustrates the effects of these fields:

colormapremap.jpg

The SoColorMap node acts like an SoShaderProgram with an SoFragmentShader. Standard Open Inventor operations on textures will be disabled on all subsequent nodes, thus using an SoTexture2 node or multitexturing after this node will not give the expected result.

NOTE:

EXAMPLE

FILE FORMAT/DEFAULT

ACTION BEHAVIOR

SEE ALSO

SoIndexedTexture2

See related examples:

IndexedTexture, MultiInstancingAlgebraicShapes


Member Enumeration Documentation

Color map format.

Enumerator:
LUMINANCE 

(1 float)

ALPHA 

(1 float)

LUMINANCE_ALPHA 

(2 floats)

RGB 

(3 floats)

RGB_ALPHA 

(4 floats)

The colormap interpolation type.

These types determine the method used for color map texture filtering.

Enumerator:
NEAREST 

Nearest-neighbor interpolation.

LINEAR 

Linear interpolation.

Predefined color map.

Enumerator:
NONE 

None.

GRAY 

Gray (Default).

TEMPERATURE 

Temperature.

PHYSICS 

Physics.

STANDARD 

Standard.

GLOW 

Glow.

BLUE_RED 

Blue red.

SEISMIC 

Seismic.

BLUE_WHITE_RED 

Blue white red.

INTENSITY 

Intensity.

LABEL_256 

256 labels

VOLREN_RED 

VolRenRed.

VOLREN_GREEN 

VolRenGreen.

AIRWAY 

Airway.

AIRWAY_SURFACES 

Airway surfaces.

INTENSITY_REVERSED 

Intensity reversed.


Constructor & Destructor Documentation

SoColorMap::SoColorMap (  ) 

Constructor.


Member Function Documentation

static SoType SoColorMap::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoNode.

unsigned int SoColorMap::getNumColor (  )  const

This convenience method returns the number of colors in the color map (ie: colorMap.getNum()/Number of components or 256 if a predefined color map is used).

virtual SoType SoColorMap::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

SbBool SoColorMap::hasTransparency (  )  const

Returns TRUE if the current color map contains alpha values less than 1.

FALSE means the color map is completely opaque.


Member Data Documentation

Array of floats in range [0,1].

The number of floats depends on colorMapFormat. It is equal to the number of colors defined multiplied by the number of components per color. For example, for an RGBA color map of length n, there should be 4*n float values in the field. If a predefined color map is specified, the values of this field are not used.

Indicates the format of the color map (number of color components).

Use enum ColorMapFormat. Default is RGB_ALPHA.

LUMINANCE means one component per color for a grayscale color map.

ALPHA means one alpha component per color.

LUMINANCE_ALPHA means two components per color, luminance and alpha. In such a case the colorMap float array contains a list of two floats. Index 0 is luminance, index 1 is alpha, index 2 is luminance, index 3 is alpha and so on.

RGB means three components per color, ordered red first, then green and blue.

RGB_ALPHA means four components per color, ordered red first, then green, blue, and alpha.

An alpha value equal to zero means "fully transparent", an alpha value equal to one means "opaque".

The colormap interpolation type.

These types determine the method used for color map texture filtering. Use enum Interpolation. Default is NEAREST.

NOTE: field available since Open Inventor 9.4.2

See min.

This field allow to remap the color map such that only data values ranging from min to max will be mapped to the color map.

min and max must be between minValue and maxValue of the corresponding SoIndexedTexture2 node.

Values less than min and greater than max will be set to colorMap[0] and colorMap[colorMap.getNum()-1] respectively. If min is less than the minimum of the indexed texture minValue , it will be clamped to this minimum. If max is greater than the maximum of the indexed texture maxValue , it will be clamped to this maximum. When min and max are equal to 0 (the default), the entire range of data values is used.

Setting (min,max) to (64,192) while the predefined STANDARD color map is selected and in the case of a UNSIGNED_BYTE indexed texture will make the color map as shown:

standardReMap.jpg

Use this field to load predefined color maps.

Use enum PredefinedColorMap. Default is TEMPERATURE. All predefined color maps have 256 entries.

GRAY
grayColorMap.jpg
TEMPERATURE
temperatureColorMap.jpg
PHYSICS
physicsColorMap.jpg
STANDARD
standardColorMap.jpg
GLOW
glowColorMap.jpg
BLUE_RED
blue_redcolormap.jpg
SEISMIC
seismicColorMap.jpg
BLUE_WHITE_RED
blue_white_redcolormap.jpg
INTENSITY
intensityColorMap.jpg
LABEL_256
label_256ColorMap.jpg
VOLREN_RED
volrenRedColorMap.jpg
VOLREN_GREEN
volrenGreenColorMap.jpg
AIRWAY
airwayColorMap.jpg
AIRWAY_SURFACES
airwaySurfaceColorMap.jpg

NOTE: In the images above the checkerboard pattern shows through where the color map alpha (opacity) value is less than 1.0.

If it is set to NONE, the fields below must be set.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/