VTK  9.4.20241221
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkLookupTable Class Reference

map scalar values into colors via a lookup table More...

#include <vtkLookupTable.h>

Inheritance diagram for vtkLookupTable:
[legend]
Collaboration diagram for vtkLookupTable:
[legend]

Public Types

typedef vtkScalarsToColors Superclass
 
- Public Types inherited from vtkScalarsToColors
enum  VectorModes { MAGNITUDE = 0 , COMPONENT = 1 , RGBCOLORS = 2 }
 
typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
vtkLookupTableNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
int Allocate (int sz=256, int ext=256)
 Allocate a color table of specified size.
 
void Build () override
 Generate lookup table from hue, saturation, value, alpha min/max values.
 
virtual void ForceBuild ()
 Force the lookup table to regenerate from hue, saturation, value, and alpha min/max values.
 
void BuildSpecialColors ()
 Copies the "special" colors into the given table.
 
unsigned char * GetNanColorAsUnsignedChars ()
 Return the NanColor as a pointer to 4 unsigned chars.
 
const unsigned char * MapValue (double v) override
 Map one value through the lookup table, returning an RBGA[4] color.
 
void GetColor (double v, double rgb[3]) override
 Map one value through the lookup table and return the color as an RGB[3] array of doubles between 0 and 1.
 
double GetOpacity (double v) override
 Map one value through the lookup table and return the alpha value (the opacity) as a double between 0 and 1.
 
virtual vtkIdType GetIndex (double v)
 Return the table index associated with a particular value.
 
virtual void SetTableValue (vtkIdType indx, const double rgba[4])
 Directly load color into lookup table.
 
virtual void SetTableValue (vtkIdType indx, double r, double g, double b, double a=1.0)
 Directly load color into lookup table.
 
double * GetTableValue (vtkIdType indx)
 Return an RGBA color value for the given index into the lookup table.
 
void GetTableValue (vtkIdType indx, double rgba[4])
 Return an RGBA color value for the given index into the lookup table.
 
unsigned char * GetPointer (vtkIdType id)
 Get pointer to color table data.
 
unsigned char * WritePointer (vtkIdType id, int number)
 Get pointer to data.
 
void MapScalarsThroughTable2 (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat) override
 Map a set of scalars through the lookup table.
 
void DeepCopy (vtkScalarsToColors *obj) override
 Copy the contents from another LookupTable.
 
vtkTypeBool UsingLogScale () override
 This should return 1 if the subclass is using log scale for mapping scalars to colors.
 
vtkIdType GetNumberOfAvailableColors () override
 Get the number of available colors for mapping to.
 
void GetIndexedColor (vtkIdType idx, double rgba[4]) override
 Return a color given an integer index.
 
vtkTypeBool IsOpaque () override
 Return true if all of the values defining the mapping have an opacity equal to 1.
 
vtkTypeBool IsOpaque (vtkAbstractArray *scalars, int colorMode, int component) override
 Return true if all of the values defining the mapping have an opacity equal to 1.
 
vtkTypeBool IsOpaque (vtkAbstractArray *scalars, int colorMode, int component, vtkUnsignedCharArray *ghosts, unsigned char ghostsToSkip=0xff) override
 Return true if all of the values defining the mapping have an opacity equal to 1.
 
virtual void SetRamp (int)
 Set the shape of the table ramp to either S-curve, linear, or sqrt.
 
void SetRampToLinear ()
 Set the shape of the table ramp to either S-curve, linear, or sqrt.
 
void SetRampToSCurve ()
 Set the shape of the table ramp to either S-curve, linear, or sqrt.
 
void SetRampToSQRT ()
 Set the shape of the table ramp to either S-curve, linear, or sqrt.
 
virtual int GetRamp ()
 Set the shape of the table ramp to either S-curve, linear, or sqrt.
 
void SetScale (int scale)
 Set the type of scale to use, linear or logarithmic.
 
void SetScaleToLinear ()
 Set the type of scale to use, linear or logarithmic.
 
void SetScaleToLog10 ()
 Set the type of scale to use, linear or logarithmic.
 
virtual int GetScale ()
 Set the type of scale to use, linear or logarithmic.
 
virtual void SetTableRange (const double r[2])
 Set/Get the minimum/maximum scalar values for scalar mapping.
 
virtual void SetTableRange (double min, double max)
 Set/Get the minimum/maximum scalar values for scalar mapping.
 
virtual double * GetTableRange ()
 Set/Get the minimum/maximum scalar values for scalar mapping.
 
virtual void GetTableRange (double data[2])
 Set/Get the minimum/maximum scalar values for scalar mapping.
 
virtual void SetHueRange (double, double)
 Set the range in hue (using automatic generation).
 
void SetHueRange (double[2])
 Set the range in hue (using automatic generation).
 
virtual double * GetHueRange ()
 Set the range in hue (using automatic generation).
 
virtual void GetHueRange (double &, double &)
 Set the range in hue (using automatic generation).
 
virtual void GetHueRange (double[2])
 Set the range in hue (using automatic generation).
 
virtual void SetSaturationRange (double, double)
 Set the range in saturation (using automatic generation).
 
void SetSaturationRange (double[2])
 Set the range in saturation (using automatic generation).
 
virtual double * GetSaturationRange ()
 Set the range in saturation (using automatic generation).
 
virtual void GetSaturationRange (double &, double &)
 Set the range in saturation (using automatic generation).
 
virtual void GetSaturationRange (double[2])
 Set the range in saturation (using automatic generation).
 
virtual void SetValueRange (double, double)
 Set the range in value (using automatic generation).
 
void SetValueRange (double[2])
 Set the range in value (using automatic generation).
 
virtual double * GetValueRange ()
 Set the range in value (using automatic generation).
 
virtual void GetValueRange (double &, double &)
 Set the range in value (using automatic generation).
 
virtual void GetValueRange (double[2])
 Set the range in value (using automatic generation).
 
virtual void SetAlphaRange (double, double)
 Set the range in alpha (using automatic generation).
 
void SetAlphaRange (double[2])
 Set the range in alpha (using automatic generation).
 
virtual double * GetAlphaRange ()
 Set the range in alpha (using automatic generation).
 
virtual void GetAlphaRange (double &, double &)
 Set the range in alpha (using automatic generation).
 
virtual void GetAlphaRange (double[2])
 Set the range in alpha (using automatic generation).
 
virtual void SetNanColor (double, double, double, double)
 Set the color to use when a NaN (not a number) is encountered.
 
virtual void SetNanColor (double[4])
 Set the color to use when a NaN (not a number) is encountered.
 
virtual double * GetNanColor ()
 Set the color to use when a NaN (not a number) is encountered.
 
virtual void GetNanColor (double &, double &, double &, double &)
 Set the color to use when a NaN (not a number) is encountered.
 
virtual void GetNanColor (double[4])
 Set the color to use when a NaN (not a number) is encountered.
 
virtual void SetBelowRangeColor (double, double, double, double)
 Set the color to use when a value below the range is encountered.
 
virtual void SetBelowRangeColor (double[4])
 Set the color to use when a value below the range is encountered.
 
virtual double * GetBelowRangeColor ()
 Set the color to use when a value below the range is encountered.
 
virtual void GetBelowRangeColor (double &, double &, double &, double &)
 Set the color to use when a value below the range is encountered.
 
virtual void GetBelowRangeColor (double[4])
 Set the color to use when a value below the range is encountered.
 
virtual void SetUseBelowRangeColor (vtkTypeBool)
 Set whether the below range color should be used.
 
virtual vtkTypeBool GetUseBelowRangeColor ()
 Set whether the below range color should be used.
 
virtual void UseBelowRangeColorOn ()
 Set whether the below range color should be used.
 
virtual void UseBelowRangeColorOff ()
 Set whether the below range color should be used.
 
virtual void SetAboveRangeColor (double, double, double, double)
 Set the color to use when a value above the range is encountered.
 
virtual void SetAboveRangeColor (double[4])
 Set the color to use when a value above the range is encountered.
 
virtual double * GetAboveRangeColor ()
 Set the color to use when a value above the range is encountered.
 
virtual void GetAboveRangeColor (double &, double &, double &, double &)
 Set the color to use when a value above the range is encountered.
 
virtual void GetAboveRangeColor (double[4])
 Set the color to use when a value above the range is encountered.
 
virtual void SetUseAboveRangeColor (vtkTypeBool)
 Set whether the above range color should be used.
 
virtual vtkTypeBool GetUseAboveRangeColor ()
 Set whether the above range color should be used.
 
virtual void UseAboveRangeColorOn ()
 Set whether the above range color should be used.
 
virtual void UseAboveRangeColorOff ()
 Set whether the above range color should be used.
 
void SetNumberOfTableValues (vtkIdType number)
 Specify the number of values (i.e., colors) in the lookup table.
 
vtkIdType GetNumberOfTableValues ()
 Specify the number of values (i.e., colors) in the lookup table.
 
double * GetRange () override
 Sets/Gets the range of scalars which will be mapped.
 
void SetRange (double min, double max) override
 Sets/Gets the range of scalars which will be mapped.
 
void SetRange (const double rng[2]) override
 Sets/Gets the range of scalars which will be mapped.
 
virtual void SetNumberOfColors (vtkIdType)
 Set the number of colors in the lookup table.
 
virtual vtkIdType GetNumberOfColors ()
 Set the number of colors in the lookup table.
 
void SetTable (vtkUnsignedCharArray *)
 Set/Get the internal table array that is used to map the scalars to colors.
 
virtual vtkUnsignedCharArrayGetTable ()
 Set/Get the internal table array that is used to map the scalars to colors.
 
- Public Member Functions inherited from vtkScalarsToColors
virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
vtkScalarsToColorsNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
virtual void Build ()
 Perform any processing required (if any) before processing scalars.
 
virtual const unsigned char * MapValue (double v)
 Map one value through the lookup table and return a color defined as an RGBA unsigned char tuple (4 bytes).
 
virtual void GetColor (double v, double rgb[3])
 Map one value through the lookup table and store the color as an RGB array of doubles between 0 and 1 in the rgb argument.
 
double * GetColor (double v)
 Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.
 
virtual double GetOpacity (double v)
 Map one value through the lookup table and return the alpha value (the opacity) as a double between 0 and 1.
 
double GetLuminance (double x)
 Map one value through the lookup table and return the luminance 0.3*red + 0.59*green + 0.11*blue as a double between 0 and 1.
 
void MapVectorsThroughTable (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat, int vectorComponent, int vectorSize)
 Map vectors through the lookup table.
 
void MapVectorsThroughTable (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
 
void MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output, int outputFormat)
 Map a set of scalars through the lookup table in a single operation.
 
void MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output)
 
void MapScalarsThroughTable (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
 
virtual void MapScalarsThroughTable2 (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
 An internal method typically not used in applications.
 
virtual void DeepCopy (vtkScalarsToColors *o)
 Copy the contents from another object.
 
virtual vtkTypeBool UsingLogScale ()
 This should return 1 if the subclass is using log scale for mapping scalars to colors.
 
virtual vtkIdType GetNumberOfAvailableColors ()
 Get the number of available colors for mapping to.
 
virtual vtkIdType SetAnnotation (vtkVariant value, vtkStdString annotation)
 Add a new entry (or change an existing entry) to the list of annotated values.
 
virtual vtkIdType SetAnnotation (vtkStdString value, vtkStdString annotation)
 This variant of SetAnnotation accepts the value as a string so ParaView can treat annotations as string vector arrays.
 
vtkIdType GetNumberOfAnnotatedValues ()
 Return the annotated value at a particular index in the list of annotations.
 
vtkVariant GetAnnotatedValue (vtkIdType idx)
 Return the annotated value at a particular index in the list of annotations.
 
vtkStdString GetAnnotation (vtkIdType idx)
 Return the annotation at a particular index in the list of annotations.
 
virtual void GetAnnotationColor (const vtkVariant &val, double rgba[4])
 Obtain the color associated with a particular annotated value (or NanColor if unmatched).
 
vtkIdType GetAnnotatedValueIndex (vtkVariant val)
 Return the index of the given value in the list of annotated values (or -1 if not present).
 
vtkIdType GetAnnotatedValueIndexInternal (const vtkVariant &val)
 Look up an index into the array of annotations given a value.
 
virtual void GetIndexedColor (vtkIdType i, double rgba[4])
 Get the "indexed color" assigned to an index.
 
virtual bool RemoveAnnotation (vtkVariant value)
 Remove an existing entry from the list of annotated values.
 
virtual void ResetAnnotations ()
 Remove all existing values and their annotations.
 
virtual void SetAlpha (double alpha)
 Specify an additional opacity (alpha) value to blend with.
 
virtual double GetAlpha ()
 Specify an additional opacity (alpha) value to blend with.
 
virtual vtkUnsignedCharArrayMapScalars (vtkDataArray *scalars, int colorMode, int component, int outputFormat=VTK_RGBA)
 Internal methods that map a data array into an unsigned char array.
 
virtual vtkUnsignedCharArrayMapScalars (vtkAbstractArray *scalars, int colorMode, int component, int outputFormat=VTK_RGBA)
 Internal methods that map a data array into an unsigned char array.
 
virtual void SetVectorMode (int)
 Change mode that maps vectors by magnitude vs.
 
virtual int GetVectorMode ()
 Change mode that maps vectors by magnitude vs.
 
void SetVectorModeToMagnitude ()
 Change mode that maps vectors by magnitude vs.
 
void SetVectorModeToComponent ()
 Change mode that maps vectors by magnitude vs.
 
void SetVectorModeToRGBColors ()
 Change mode that maps vectors by magnitude vs.
 
virtual void SetVectorComponent (int)
 If the mapper does not select which component of a vector to map to colors, you can specify it here.
 
virtual int GetVectorComponent ()
 If the mapper does not select which component of a vector to map to colors, you can specify it here.
 
virtual void SetVectorSize (int)
 When mapping vectors, consider only the number of components selected by VectorSize to be part of the vector, and ignore any other components.
 
virtual int GetVectorSize ()
 When mapping vectors, consider only the number of components selected by VectorSize to be part of the vector, and ignore any other components.
 
virtual void SetAnnotations (vtkAbstractArray *values, vtkStringArray *annotations)
 Set a list of discrete values, either as a categorical set of values (when IndexedLookup is true) or as a set of annotations to add to a scalar array (when IndexedLookup is false).
 
virtual vtkAbstractArrayGetAnnotatedValues ()
 Set a list of discrete values, either as a categorical set of values (when IndexedLookup is true) or as a set of annotations to add to a scalar array (when IndexedLookup is false).
 
virtual vtkStringArrayGetAnnotations ()
 Set a list of discrete values, either as a categorical set of values (when IndexedLookup is true) or as a set of annotations to add to a scalar array (when IndexedLookup is false).
 
virtual void SetIndexedLookup (vtkTypeBool)
 Set/get whether the lookup table is for categorical or ordinal data.
 
virtual vtkTypeBool GetIndexedLookup ()
 Set/get whether the lookup table is for categorical or ordinal data.
 
virtual void IndexedLookupOn ()
 Set/get whether the lookup table is for categorical or ordinal data.
 
virtual void IndexedLookupOff ()
 Set/get whether the lookup table is for categorical or ordinal data.
 
template<>
unsigned char ColorToUChar (double t)
 Specializations of vtkScalarsToColors::ColorToUChar Converts from a color in a floating point type in range 0.0-1.0 to a uchar in range 0-255.
 
template<>
unsigned char ColorToUChar (float t)
 Specializations of vtkScalarsToColors::ColorToUChar Converts from a color in a floating point type in range 0.0-1.0 to a uchar in range 0-255.
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on.
 
virtual void DebugOff ()
 Turn debugging output off.
 
bool GetDebug ()
 Get the value of the debug flag.
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag.
 
virtual void Modified ()
 Update the modification time for this object.
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output.
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method.
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes.
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes.
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string.
 
virtual std::string GetObjectDescription () const
 The object description printed in messages and PrintSelf output.
 
virtual vtkTypeBool IsA (const char *name)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
virtual void Delete ()
 Delete a VTK object.
 
virtual void FastDelete ()
 Delete a reference to this object.
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream.
 
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object).
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object).
 
int GetReferenceCount ()
 Return the current reference count of this object.
 
void SetReferenceCount (int)
 Sets the reference count.
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space.
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not.
 

Static Public Member Functions

static vtkLookupTableNew ()
 Construct with range=[0,1]; and hsv ranges set up for rainbow color table (from red to blue).
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkLookupTableSafeDownCast (vtkObjectBase *o)
 
static void GetColorAsUnsignedChars (const double colorIn[4], unsigned char colorOut[4])
 Given an RGBA[4] color in the [0,1] range, convert it to RGBA[4] in the [0,255] range.
 
static void GetLogRange (const double range[2], double log_range[2])
 Returns the log of range in log_range.
 
static double ApplyLogScale (double v, const double range[2], const double log_range[2])
 Apply log to value, with appropriate constraints.
 
- Static Public Member Functions inherited from vtkScalarsToColors
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkScalarsToColorsSafeDownCast (vtkObjectBase *o)
 
static vtkScalarsToColorsNew ()
 
template<typename T >
static unsigned char ColorToUChar (T t)
 Converts a color from numeric type T to uchar.
 
template<typename T >
static void ColorToUChar (T t, unsigned char *dest)
 Converts a color from numeric type T to uchar.
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes.
 
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class.
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space.
 

Static Public Attributes

static const vtkIdType REPEATED_LAST_COLOR_INDEX
 Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.
 
static const vtkIdType BELOW_RANGE_COLOR_INDEX
 Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.
 
static const vtkIdType ABOVE_RANGE_COLOR_INDEX
 Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.
 
static const vtkIdType NAN_COLOR_INDEX
 Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.
 
static const vtkIdType NUMBER_OF_SPECIAL_COLORS
 Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkLookupTable (int sze=256, int ext=256)
 
 ~vtkLookupTable () override
 
void ResizeTableForSpecialColors ()
 Resize the LookupTable to have enough room for the out-of-range colors.
 
- Protected Member Functions inherited from vtkScalarsToColors
virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkScalarsToColors ()
 
 ~vtkScalarsToColors () override
 
void MapColorsToColors (void *input, unsigned char *output, int inputDataType, int numberOfValues, int numberOfComponents, int vectorSize, int outputFormat)
 An internal method that assumes that the input already has the right colors, and only remaps the range to [0,255] and pads to the desired output format.
 
vtkUnsignedCharArrayConvertToRGBA (vtkDataArray *colors, int numComp, int numTuples)
 An internal method used to convert a color array to RGBA.
 
void MapVectorsToMagnitude (void *input, double *output, int inputDataType, int numberOfValues, int numberOfComponents, int vectorSize)
 An internal method for converting vectors to magnitudes, used as a preliminary step before doing magnitude mapping.
 
virtual vtkIdType CheckForAnnotatedValue (vtkVariant value)
 Allocate annotation arrays if needed, then return the index of the given value or -1 if not present.
 
virtual void UpdateAnnotatedValueMap ()
 Update the map from annotated values to indices in the array of annotations.
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events.
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events.
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void RegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
virtual void ObjectFinalize ()
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkIdType NumberOfColors
 
vtkUnsignedCharArrayTable
 
double TableRange [2]
 
double HueRange [2]
 
double SaturationRange [2]
 
double ValueRange [2]
 
double AlphaRange [2]
 
double NanColor [4]
 
double BelowRangeColor [4]
 
vtkTypeBool UseBelowRangeColor
 
double AboveRangeColor [4]
 
vtkTypeBool UseAboveRangeColor
 
int Scale
 
int Ramp
 
vtkTimeStamp InsertTime
 
vtkTimeStamp BuildTime
 
double RGBA [4]
 
unsigned char NanColorChar [4]
 
vtkTypeBool OpaqueFlag
 
vtkTimeStamp OpaqueFlagBuildTime
 
vtkTimeStamp SpecialColorsBuildTime
 
- Protected Attributes inherited from vtkScalarsToColors
vtkAbstractArrayAnnotatedValues
 
vtkStringArrayAnnotations
 
vtkInternalAnnotatedValueList * AnnotatedValueList
 
vtkTypeBool IndexedLookup
 
double Alpha
 
int VectorMode
 
int VectorComponent
 
int VectorSize
 
int UseMagnitude
 
unsigned char RGBABytes [4]
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

Detailed Description

map scalar values into colors via a lookup table

vtkLookupTable is an object that is used by mapper objects to map scalar values into RGBA (red-green-blue-alpha) color specification, or RGBA into scalar values. The color table can be created by direct insertion of color values, or by specifying a hue, saturation, value, and alpha range and generating a table.

A special color for NaN values in the data can be specified via SetNanColor(). In addition, a color for data values below the lookup table range minimum can be specified with SetBelowRangeColor(), and that color will be used for values below the range minimum when UseBelowRangeColor is on. Likewise, a color for data values above the lookup table range maximum can be specified with SetAboveRangeColor(), and it is used when UseAboveRangeColor is on.

This class behaves differently depending on how IndexedLookup is set. When true, vtkLookupTable enters a mode for representing categorical color maps. By setting IndexedLookup to true, you indicate that the annotated values are the only valid values for which entries in the color table should be returned. The colors in the lookup Table are assigned to annotated values by taking the modulus of their index in the list of annotations. IndexedLookup changes the behavior of GetIndex, which in turn changes the way MapScalarsThroughTable2 behaves; when IndexedLookup is true, MapScalarsThroughTable2 will search for scalar values in AnnotatedValues and use the resulting index to determine the color. If a scalar value is not present in AnnotatedValues, then NanColor will be used.

Warning
You need to explicitly call Build() when constructing the LUT by hand.
See also
vtkLogLookupTable vtkWindowLevelLookupTable
Examples:
vtkLookupTable (Examples)
Online Examples:

Tests:
vtkLookupTable (Tests)

Definition at line 173 of file vtkLookupTable.h.

Member Typedef Documentation

◆ Superclass

Definition at line 195 of file vtkLookupTable.h.

Constructor & Destructor Documentation

◆ vtkLookupTable()

vtkLookupTable::vtkLookupTable ( int  sze = 256,
int  ext = 256 
)
protected

◆ ~vtkLookupTable()

vtkLookupTable::~vtkLookupTable ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkLookupTable * vtkLookupTable::New ( )
static

Construct with range=[0,1]; and hsv ranges set up for rainbow color table (from red to blue).

◆ IsTypeOf()

static vtkTypeBool vtkLookupTable::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkLookupTable::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkScalarsToColors.

Reimplemented in vtkLogLookupTable, vtkLookupTableWithEnabling, and vtkWindowLevelLookupTable.

◆ SafeDownCast()

static vtkLookupTable * vtkLookupTable::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkLookupTable::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkLookupTable * vtkLookupTable::NewInstance ( ) const

◆ PrintSelf()

void vtkLookupTable::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObjectBase.

Reimplemented in vtkLookupTableWithEnabling, and vtkWindowLevelLookupTable.

◆ IsOpaque() [1/3]

vtkTypeBool vtkLookupTable::IsOpaque ( )
overridevirtual

Return true if all of the values defining the mapping have an opacity equal to 1.

Reimplemented from vtkScalarsToColors.

◆ IsOpaque() [2/3]

vtkTypeBool vtkLookupTable::IsOpaque ( vtkAbstractArray scalars,
int  colorMode,
int  component 
)
overridevirtual

Return true if all of the values defining the mapping have an opacity equal to 1.

Reimplemented from vtkScalarsToColors.

◆ IsOpaque() [3/3]

vtkTypeBool vtkLookupTable::IsOpaque ( vtkAbstractArray scalars,
int  colorMode,
int  component,
vtkUnsignedCharArray ghosts,
unsigned char  ghostsToSkip = 0xff 
)
overridevirtual

Return true if all of the values defining the mapping have an opacity equal to 1.

Reimplemented from vtkScalarsToColors.

◆ Allocate()

int vtkLookupTable::Allocate ( int  sz = 256,
int  ext = 256 
)

Allocate a color table of specified size.

Note that ext is no longer used.

◆ Build()

void vtkLookupTable::Build ( )
overridevirtual

Generate lookup table from hue, saturation, value, alpha min/max values.

Table is built from linear ramp of each value.

Reimplemented from vtkScalarsToColors.

◆ ForceBuild()

virtual void vtkLookupTable::ForceBuild ( )
virtual

Force the lookup table to regenerate from hue, saturation, value, and alpha min/max values.

Table is built from a linear ramp of each value. ForceBuild() is useful if a lookup table has been defined manually (using SetTableValue) and then an application decides to rebuild the lookup table using the implicit process.

Reimplemented in vtkWindowLevelLookupTable.

◆ BuildSpecialColors()

void vtkLookupTable::BuildSpecialColors ( )

Copies the "special" colors into the given table.

◆ SetRamp()

virtual void vtkLookupTable::SetRamp ( int  )
virtual

Set the shape of the table ramp to either S-curve, linear, or sqrt.

The default is S-curve, which tails off gradually at either end.

The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp.

The equation for the linear ramp is simply y = x.

The equation for the SQRT is y = sqrt(x).

◆ SetRampToLinear()

void vtkLookupTable::SetRampToLinear ( )
inline

Set the shape of the table ramp to either S-curve, linear, or sqrt.

The default is S-curve, which tails off gradually at either end.

The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp.

The equation for the linear ramp is simply y = x.

The equation for the SQRT is y = sqrt(x).

Definition at line 249 of file vtkLookupTable.h.

◆ SetRampToSCurve()

void vtkLookupTable::SetRampToSCurve ( )
inline

Set the shape of the table ramp to either S-curve, linear, or sqrt.

The default is S-curve, which tails off gradually at either end.

The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp.

The equation for the linear ramp is simply y = x.

The equation for the SQRT is y = sqrt(x).

Definition at line 250 of file vtkLookupTable.h.

◆ SetRampToSQRT()

void vtkLookupTable::SetRampToSQRT ( )
inline

Set the shape of the table ramp to either S-curve, linear, or sqrt.

The default is S-curve, which tails off gradually at either end.

The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp.

The equation for the linear ramp is simply y = x.

The equation for the SQRT is y = sqrt(x).

Definition at line 251 of file vtkLookupTable.h.

◆ GetRamp()

virtual int vtkLookupTable::GetRamp ( )
virtual

Set the shape of the table ramp to either S-curve, linear, or sqrt.

The default is S-curve, which tails off gradually at either end.

The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2, For an S-curve greyscale ramp, you should set NumberOfTableValues to 402 (which is 256*pi/2) to provide room for the tails of the ramp.

The equation for the linear ramp is simply y = x.

The equation for the SQRT is y = sqrt(x).

◆ SetScale()

void vtkLookupTable::SetScale ( int  scale)

Set the type of scale to use, linear or logarithmic.

The default is linear. If the scale is logarithmic, then the TableRange must not cross the value zero.

◆ SetScaleToLinear()

void vtkLookupTable::SetScaleToLinear ( )
inline

Set the type of scale to use, linear or logarithmic.

The default is linear. If the scale is logarithmic, then the TableRange must not cross the value zero.

Definition at line 262 of file vtkLookupTable.h.

◆ SetScaleToLog10()

void vtkLookupTable::SetScaleToLog10 ( )
inline

Set the type of scale to use, linear or logarithmic.

The default is linear. If the scale is logarithmic, then the TableRange must not cross the value zero.

Definition at line 263 of file vtkLookupTable.h.

◆ GetScale()

virtual int vtkLookupTable::GetScale ( )
virtual

Set the type of scale to use, linear or logarithmic.

The default is linear. If the scale is logarithmic, then the TableRange must not cross the value zero.

◆ SetTableRange() [1/2]

virtual void vtkLookupTable::SetTableRange ( const double  r[2])
virtual

Set/Get the minimum/maximum scalar values for scalar mapping.

Scalar values less than minimum range value are clamped to minimum range value. Scalar values greater than maximum range value are clamped to maximum range value.

The TableRange values are only used when IndexedLookup is false.

◆ SetTableRange() [2/2]

virtual void vtkLookupTable::SetTableRange ( double  min,
double  max 
)
virtual

Set/Get the minimum/maximum scalar values for scalar mapping.

Scalar values less than minimum range value are clamped to minimum range value. Scalar values greater than maximum range value are clamped to maximum range value.

The TableRange values are only used when IndexedLookup is false.

◆ GetTableRange() [1/2]

virtual double * vtkLookupTable::GetTableRange ( )
virtual

Set/Get the minimum/maximum scalar values for scalar mapping.

Scalar values less than minimum range value are clamped to minimum range value. Scalar values greater than maximum range value are clamped to maximum range value.

The TableRange values are only used when IndexedLookup is false.

◆ GetTableRange() [2/2]

virtual void vtkLookupTable::GetTableRange ( double  data[2])
virtual

Set/Get the minimum/maximum scalar values for scalar mapping.

Scalar values less than minimum range value are clamped to minimum range value. Scalar values greater than maximum range value are clamped to maximum range value.

The TableRange values are only used when IndexedLookup is false.

◆ SetHueRange() [1/2]

virtual void vtkLookupTable::SetHueRange ( double  ,
double   
)
virtual

Set the range in hue (using automatic generation).

Hue ranges between [0,1].

◆ SetHueRange() [2/2]

void vtkLookupTable::SetHueRange ( double  [2])

Set the range in hue (using automatic generation).

Hue ranges between [0,1].

◆ GetHueRange() [1/3]

virtual double * vtkLookupTable::GetHueRange ( )
virtual

Set the range in hue (using automatic generation).

Hue ranges between [0,1].

◆ GetHueRange() [2/3]

virtual void vtkLookupTable::GetHueRange ( double &  ,
double &   
)
virtual

Set the range in hue (using automatic generation).

Hue ranges between [0,1].

◆ GetHueRange() [3/3]

virtual void vtkLookupTable::GetHueRange ( double  [2])
virtual

Set the range in hue (using automatic generation).

Hue ranges between [0,1].

◆ SetSaturationRange() [1/2]

virtual void vtkLookupTable::SetSaturationRange ( double  ,
double   
)
virtual

Set the range in saturation (using automatic generation).

Saturation ranges between [0,1].

◆ SetSaturationRange() [2/2]

void vtkLookupTable::SetSaturationRange ( double  [2])

Set the range in saturation (using automatic generation).

Saturation ranges between [0,1].

◆ GetSaturationRange() [1/3]

virtual double * vtkLookupTable::GetSaturationRange ( )
virtual

Set the range in saturation (using automatic generation).

Saturation ranges between [0,1].

◆ GetSaturationRange() [2/3]

virtual void vtkLookupTable::GetSaturationRange ( double &  ,
double &   
)
virtual

Set the range in saturation (using automatic generation).

Saturation ranges between [0,1].

◆ GetSaturationRange() [3/3]

virtual void vtkLookupTable::GetSaturationRange ( double  [2])
virtual

Set the range in saturation (using automatic generation).

Saturation ranges between [0,1].

◆ SetValueRange() [1/2]

virtual void vtkLookupTable::SetValueRange ( double  ,
double   
)
virtual

Set the range in value (using automatic generation).

Value ranges between [0,1].

◆ SetValueRange() [2/2]

void vtkLookupTable::SetValueRange ( double  [2])

Set the range in value (using automatic generation).

Value ranges between [0,1].

◆ GetValueRange() [1/3]

virtual double * vtkLookupTable::GetValueRange ( )
virtual

Set the range in value (using automatic generation).

Value ranges between [0,1].

◆ GetValueRange() [2/3]

virtual void vtkLookupTable::GetValueRange ( double &  ,
double &   
)
virtual

Set the range in value (using automatic generation).

Value ranges between [0,1].

◆ GetValueRange() [3/3]

virtual void vtkLookupTable::GetValueRange ( double  [2])
virtual

Set the range in value (using automatic generation).

Value ranges between [0,1].

◆ SetAlphaRange() [1/2]

virtual void vtkLookupTable::SetAlphaRange ( double  ,
double   
)
virtual

Set the range in alpha (using automatic generation).

Alpha ranges from [0,1].

◆ SetAlphaRange() [2/2]

void vtkLookupTable::SetAlphaRange ( double  [2])

Set the range in alpha (using automatic generation).

Alpha ranges from [0,1].

◆ GetAlphaRange() [1/3]

virtual double * vtkLookupTable::GetAlphaRange ( )
virtual

Set the range in alpha (using automatic generation).

Alpha ranges from [0,1].

◆ GetAlphaRange() [2/3]

virtual void vtkLookupTable::GetAlphaRange ( double &  ,
double &   
)
virtual

Set the range in alpha (using automatic generation).

Alpha ranges from [0,1].

◆ GetAlphaRange() [3/3]

virtual void vtkLookupTable::GetAlphaRange ( double  [2])
virtual

Set the range in alpha (using automatic generation).

Alpha ranges from [0,1].

◆ SetNanColor() [1/2]

virtual void vtkLookupTable::SetNanColor ( double  ,
double  ,
double  ,
double   
)
virtual

Set the color to use when a NaN (not a number) is encountered.

This is an RGBA 4-tuple of doubles in the range [0,1].

◆ SetNanColor() [2/2]

virtual void vtkLookupTable::SetNanColor ( double  [4])
virtual

Set the color to use when a NaN (not a number) is encountered.

This is an RGBA 4-tuple of doubles in the range [0,1].

◆ GetNanColor() [1/3]

virtual double * vtkLookupTable::GetNanColor ( )
virtual

Set the color to use when a NaN (not a number) is encountered.

This is an RGBA 4-tuple of doubles in the range [0,1].

◆ GetNanColor() [2/3]

virtual void vtkLookupTable::GetNanColor ( double &  ,
double &  ,
double &  ,
double &   
)
virtual

Set the color to use when a NaN (not a number) is encountered.

This is an RGBA 4-tuple of doubles in the range [0,1].

◆ GetNanColor() [3/3]

virtual void vtkLookupTable::GetNanColor ( double  [4])
virtual

Set the color to use when a NaN (not a number) is encountered.

This is an RGBA 4-tuple of doubles in the range [0,1].

◆ GetNanColorAsUnsignedChars()

unsigned char * vtkLookupTable::GetNanColorAsUnsignedChars ( )

Return the NanColor as a pointer to 4 unsigned chars.

This will overwrite any data returned by previous calls to MapValue.

◆ GetColorAsUnsignedChars()

static void vtkLookupTable::GetColorAsUnsignedChars ( const double  colorIn[4],
unsigned char  colorOut[4] 
)
static

Given an RGBA[4] color in the [0,1] range, convert it to RGBA[4] in the [0,255] range.

◆ SetBelowRangeColor() [1/2]

virtual void vtkLookupTable::SetBelowRangeColor ( double  ,
double  ,
double  ,
double   
)
virtual

Set the color to use when a value below the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ SetBelowRangeColor() [2/2]

virtual void vtkLookupTable::SetBelowRangeColor ( double  [4])
virtual

Set the color to use when a value below the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ GetBelowRangeColor() [1/3]

virtual double * vtkLookupTable::GetBelowRangeColor ( )
virtual

Set the color to use when a value below the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ GetBelowRangeColor() [2/3]

virtual void vtkLookupTable::GetBelowRangeColor ( double &  ,
double &  ,
double &  ,
double &   
)
virtual

Set the color to use when a value below the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ GetBelowRangeColor() [3/3]

virtual void vtkLookupTable::GetBelowRangeColor ( double  [4])
virtual

Set the color to use when a value below the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ SetUseBelowRangeColor()

virtual void vtkLookupTable::SetUseBelowRangeColor ( vtkTypeBool  )
virtual

Set whether the below range color should be used.

◆ GetUseBelowRangeColor()

virtual vtkTypeBool vtkLookupTable::GetUseBelowRangeColor ( )
virtual

Set whether the below range color should be used.

◆ UseBelowRangeColorOn()

virtual void vtkLookupTable::UseBelowRangeColorOn ( )
virtual

Set whether the below range color should be used.

◆ UseBelowRangeColorOff()

virtual void vtkLookupTable::UseBelowRangeColorOff ( )
virtual

Set whether the below range color should be used.

◆ SetAboveRangeColor() [1/2]

virtual void vtkLookupTable::SetAboveRangeColor ( double  ,
double  ,
double  ,
double   
)
virtual

Set the color to use when a value above the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ SetAboveRangeColor() [2/2]

virtual void vtkLookupTable::SetAboveRangeColor ( double  [4])
virtual

Set the color to use when a value above the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ GetAboveRangeColor() [1/3]

virtual double * vtkLookupTable::GetAboveRangeColor ( )
virtual

Set the color to use when a value above the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ GetAboveRangeColor() [2/3]

virtual void vtkLookupTable::GetAboveRangeColor ( double &  ,
double &  ,
double &  ,
double &   
)
virtual

Set the color to use when a value above the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ GetAboveRangeColor() [3/3]

virtual void vtkLookupTable::GetAboveRangeColor ( double  [4])
virtual

Set the color to use when a value above the range is encountered.

This is an RGBA 4-tuple of doubles in the range [0, 1].

◆ SetUseAboveRangeColor()

virtual void vtkLookupTable::SetUseAboveRangeColor ( vtkTypeBool  )
virtual

Set whether the above range color should be used.

◆ GetUseAboveRangeColor()

virtual vtkTypeBool vtkLookupTable::GetUseAboveRangeColor ( )
virtual

Set whether the above range color should be used.

◆ UseAboveRangeColorOn()

virtual void vtkLookupTable::UseAboveRangeColorOn ( )
virtual

Set whether the above range color should be used.

◆ UseAboveRangeColorOff()

virtual void vtkLookupTable::UseAboveRangeColorOff ( )
virtual

Set whether the above range color should be used.

◆ MapValue()

const unsigned char * vtkLookupTable::MapValue ( double  v)
overridevirtual

Map one value through the lookup table, returning an RBGA[4] color.

Reimplemented from vtkScalarsToColors.

◆ GetColor()

void vtkLookupTable::GetColor ( double  v,
double  rgb[3] 
)
overridevirtual

Map one value through the lookup table and return the color as an RGB[3] array of doubles between 0 and 1.

Note lack of alpha.

Reimplemented from vtkScalarsToColors.

◆ GetOpacity()

double vtkLookupTable::GetOpacity ( double  v)
overridevirtual

Map one value through the lookup table and return the alpha value (the opacity) as a double between 0 and 1.

Reimplemented from vtkScalarsToColors.

◆ GetIndex()

virtual vtkIdType vtkLookupTable::GetIndex ( double  v)
virtual

Return the table index associated with a particular value.

Returns -1 if v is NaN.

Do not use this function when IndexedLookup is true: in that case, the set of values v may take on is exactly the integers from 0 to GetNumberOfTableValues() - 1; and v serves directly as an index into TableValues.

◆ SetNumberOfTableValues()

void vtkLookupTable::SetNumberOfTableValues ( vtkIdType  number)

Specify the number of values (i.e., colors) in the lookup table.

◆ GetNumberOfTableValues()

vtkIdType vtkLookupTable::GetNumberOfTableValues ( )
inline

Specify the number of values (i.e., colors) in the lookup table.

Definition at line 408 of file vtkLookupTable.h.

◆ SetTableValue() [1/2]

virtual void vtkLookupTable::SetTableValue ( vtkIdType  indx,
const double  rgba[4] 
)
virtual

Directly load color into lookup table.

Use [0,1] double values for color component specification. Make sure that you've either used the Build() method or used SetNumberOfTableValues() prior to using this method.

◆ SetTableValue() [2/2]

virtual void vtkLookupTable::SetTableValue ( vtkIdType  indx,
double  r,
double  g,
double  b,
double  a = 1.0 
)
virtual

Directly load color into lookup table.

Use [0,1] double values for color component specification. Alpha defaults to 1 if unspecified.

◆ GetTableValue() [1/2]

double * vtkLookupTable::GetTableValue ( vtkIdType  indx)

Return an RGBA color value for the given index into the lookup table.

Color components are expressed as [0,1] double values.

◆ GetTableValue() [2/2]

void vtkLookupTable::GetTableValue ( vtkIdType  indx,
double  rgba[4] 
)

Return an RGBA color value for the given index into the lookup table.

Color components are expressed as [0,1] double values.

◆ GetPointer()

unsigned char * vtkLookupTable::GetPointer ( vtkIdType  id)
inline

Get pointer to color table data.

Format is array of unsigned char R-G-B-A...R-G-B-A.

Definition at line 441 of file vtkLookupTable.h.

◆ WritePointer()

unsigned char * vtkLookupTable::WritePointer ( vtkIdType  id,
int  number 
)
inline

Get pointer to data.

Useful for direct writes into object. MaxId is bumped by number (and memory allocated if necessary). Id is the location you wish to write into; number is the number of rgba values to write.

Warning
If you modify the table data via the pointer returned by this member function, you must call vtkLookupTable::BuildSpecialColors() afterwards to ensure that the special colors (below/above range and NaN value) are up-to-date.

Definition at line 571 of file vtkLookupTable.h.

◆ GetRange()

double * vtkLookupTable::GetRange ( )
inlineoverridevirtual

Sets/Gets the range of scalars which will be mapped.

This is a duplicate of Get/SetTableRange.

Reimplemented from vtkScalarsToColors.

Definition at line 460 of file vtkLookupTable.h.

◆ SetRange() [1/2]

void vtkLookupTable::SetRange ( double  min,
double  max 
)
inlineoverridevirtual

Sets/Gets the range of scalars which will be mapped.

This is a duplicate of Get/SetTableRange.

Reimplemented from vtkScalarsToColors.

Definition at line 461 of file vtkLookupTable.h.

◆ SetRange() [2/2]

void vtkLookupTable::SetRange ( const double  rng[2])
inlineoverridevirtual

Sets/Gets the range of scalars which will be mapped.

This is a duplicate of Get/SetTableRange.

Reimplemented from vtkScalarsToColors.

Definition at line 462 of file vtkLookupTable.h.

◆ GetLogRange()

static void vtkLookupTable::GetLogRange ( const double  range[2],
double  log_range[2] 
)
static

Returns the log of range in log_range.

There is a little more to this than simply taking the log10 of the two range values: we do conversion of negative ranges to positive ranges, and conversion of zero to a 'very small number'.

◆ ApplyLogScale()

static double vtkLookupTable::ApplyLogScale ( double  v,
const double  range[2],
const double  log_range[2] 
)
static

Apply log to value, with appropriate constraints.

◆ SetNumberOfColors()

virtual void vtkLookupTable::SetNumberOfColors ( vtkIdType  )
virtual

Set the number of colors in the lookup table.

Use SetNumberOfTableValues() instead, it can be used both before and after the table has been built whereas SetNumberOfColors() has no effect after the table has been built.

◆ GetNumberOfColors()

virtual vtkIdType vtkLookupTable::GetNumberOfColors ( )
virtual

Set the number of colors in the lookup table.

Use SetNumberOfTableValues() instead, it can be used both before and after the table has been built whereas SetNumberOfColors() has no effect after the table has been built.

◆ SetTable()

void vtkLookupTable::SetTable ( vtkUnsignedCharArray )

Set/Get the internal table array that is used to map the scalars to colors.

The table array is an unsigned char array with 4 components representing RGBA.

◆ GetTable()

virtual vtkUnsignedCharArray * vtkLookupTable::GetTable ( )
virtual

Set/Get the internal table array that is used to map the scalars to colors.

The table array is an unsigned char array with 4 components representing RGBA.

◆ MapScalarsThroughTable2()

void vtkLookupTable::MapScalarsThroughTable2 ( void *  input,
unsigned char *  output,
int  inputDataType,
int  numberOfValues,
int  inputIncrement,
int  outputFormat 
)
overridevirtual

Map a set of scalars through the lookup table.

This member function is thread safe.

Reimplemented from vtkScalarsToColors.

Reimplemented in vtkLookupTableWithEnabling.

◆ DeepCopy()

void vtkLookupTable::DeepCopy ( vtkScalarsToColors obj)
overridevirtual

Copy the contents from another LookupTable.

Reimplemented from vtkScalarsToColors.

◆ UsingLogScale()

vtkTypeBool vtkLookupTable::UsingLogScale ( )
inlineoverridevirtual

This should return 1 if the subclass is using log scale for mapping scalars to colors.

Returns 1 is scale == VTK_SCALE_LOG10.

Reimplemented from vtkScalarsToColors.

Definition at line 516 of file vtkLookupTable.h.

◆ GetNumberOfAvailableColors()

vtkIdType vtkLookupTable::GetNumberOfAvailableColors ( )
overridevirtual

Get the number of available colors for mapping to.

Reimplemented from vtkScalarsToColors.

◆ GetIndexedColor()

void vtkLookupTable::GetIndexedColor ( vtkIdType  idx,
double  rgba[4] 
)
overridevirtual

Return a color given an integer index.

This is used to assign colors to annotations (given an offset into the list of annotations). If the table is empty or idx < 0, then NanColor is returned.

Reimplemented from vtkScalarsToColors.

◆ ResizeTableForSpecialColors()

void vtkLookupTable::ResizeTableForSpecialColors ( )
protected

Resize the LookupTable to have enough room for the out-of-range colors.

Member Data Documentation

◆ REPEATED_LAST_COLOR_INDEX

const vtkIdType vtkLookupTable::REPEATED_LAST_COLOR_INDEX
static

Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.

These should be considered private and not be used by clients of this class.

Definition at line 182 of file vtkLookupTable.h.

◆ BELOW_RANGE_COLOR_INDEX

const vtkIdType vtkLookupTable::BELOW_RANGE_COLOR_INDEX
static

Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.

These should be considered private and not be used by clients of this class.

Definition at line 183 of file vtkLookupTable.h.

◆ ABOVE_RANGE_COLOR_INDEX

const vtkIdType vtkLookupTable::ABOVE_RANGE_COLOR_INDEX
static

Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.

These should be considered private and not be used by clients of this class.

Definition at line 184 of file vtkLookupTable.h.

◆ NAN_COLOR_INDEX

const vtkIdType vtkLookupTable::NAN_COLOR_INDEX
static

Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.

These should be considered private and not be used by clients of this class.

Definition at line 185 of file vtkLookupTable.h.

◆ NUMBER_OF_SPECIAL_COLORS

const vtkIdType vtkLookupTable::NUMBER_OF_SPECIAL_COLORS
static

Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the maximum index in the lookup table.

These should be considered private and not be used by clients of this class.

Definition at line 186 of file vtkLookupTable.h.

◆ NumberOfColors

vtkIdType vtkLookupTable::NumberOfColors
protected

Definition at line 536 of file vtkLookupTable.h.

◆ Table

vtkUnsignedCharArray* vtkLookupTable::Table
protected

Definition at line 537 of file vtkLookupTable.h.

◆ TableRange

double vtkLookupTable::TableRange[2]
protected

Definition at line 538 of file vtkLookupTable.h.

◆ HueRange

double vtkLookupTable::HueRange[2]
protected

Definition at line 539 of file vtkLookupTable.h.

◆ SaturationRange

double vtkLookupTable::SaturationRange[2]
protected

Definition at line 540 of file vtkLookupTable.h.

◆ ValueRange

double vtkLookupTable::ValueRange[2]
protected

Definition at line 541 of file vtkLookupTable.h.

◆ AlphaRange

double vtkLookupTable::AlphaRange[2]
protected

Definition at line 542 of file vtkLookupTable.h.

◆ NanColor

double vtkLookupTable::NanColor[4]
protected

Definition at line 543 of file vtkLookupTable.h.

◆ BelowRangeColor

double vtkLookupTable::BelowRangeColor[4]
protected

Definition at line 544 of file vtkLookupTable.h.

◆ UseBelowRangeColor

vtkTypeBool vtkLookupTable::UseBelowRangeColor
protected

Definition at line 545 of file vtkLookupTable.h.

◆ AboveRangeColor

double vtkLookupTable::AboveRangeColor[4]
protected

Definition at line 546 of file vtkLookupTable.h.

◆ UseAboveRangeColor

vtkTypeBool vtkLookupTable::UseAboveRangeColor
protected

Definition at line 547 of file vtkLookupTable.h.

◆ Scale

int vtkLookupTable::Scale
protected

Definition at line 549 of file vtkLookupTable.h.

◆ Ramp

int vtkLookupTable::Ramp
protected

Definition at line 550 of file vtkLookupTable.h.

◆ InsertTime

vtkTimeStamp vtkLookupTable::InsertTime
protected

Definition at line 551 of file vtkLookupTable.h.

◆ BuildTime

vtkTimeStamp vtkLookupTable::BuildTime
protected

Definition at line 552 of file vtkLookupTable.h.

◆ RGBA

double vtkLookupTable::RGBA[4]
protected

Definition at line 553 of file vtkLookupTable.h.

◆ NanColorChar

unsigned char vtkLookupTable::NanColorChar[4]
protected

Definition at line 554 of file vtkLookupTable.h.

◆ OpaqueFlag

vtkTypeBool vtkLookupTable::OpaqueFlag
protected

Definition at line 556 of file vtkLookupTable.h.

◆ OpaqueFlagBuildTime

vtkTimeStamp vtkLookupTable::OpaqueFlagBuildTime
protected

Definition at line 557 of file vtkLookupTable.h.

◆ SpecialColorsBuildTime

vtkTimeStamp vtkLookupTable::SpecialColorsBuildTime
protected

Definition at line 558 of file vtkLookupTable.h.


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