VTK
|
map scalar values into colors via a lookup table More...
#include <vtkLookupTable.h>
Public Types | |
typedef vtkScalarsToColors | Superclass |
![]() | |
enum | VectorModes { MAGNITUDE =0, COMPONENT =1 } |
typedef vtkObject | Superclass |
![]() | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual int | IsOpaque () |
int | Allocate (int sz=256, int ext=256) |
virtual void | Build () |
virtual void | ForceBuild () |
unsigned char * | MapValue (double v) |
void | GetColor (double x, double rgb[3]) |
double | GetOpacity (double v) |
virtual vtkIdType | GetIndex (double v) |
void | SetTableValue (vtkIdType indx, double rgba[4]) |
void | SetTableValue (vtkIdType indx, double r, double g, double b, double a=1.0) |
double * | GetTableValue (vtkIdType id) |
void | GetTableValue (vtkIdType id, double rgba[4]) |
unsigned char * | WritePointer (const vtkIdType id, const int number) |
void | DeepCopy (vtkLookupTable *lut) |
virtual vtkIdType | GetNumberOfAvailableColors () |
virtual void | SetRamp (int) |
void | SetRampToLinear () |
void | SetRampToSCurve () |
void | SetRampToSQRT () |
virtual int | GetRamp () |
void | SetScale (int scale) |
void | SetScaleToLinear () |
void | SetScaleToLog10 () |
virtual int | GetScale () |
void | SetTableRange (double r[2]) |
virtual void | SetTableRange (double min, double max) |
virtual double * | GetTableRange () |
virtual void | GetTableRange (double data[2]) |
virtual void | SetHueRange (double, double) |
void | SetHueRange (double[2]) |
virtual double * | GetHueRange () |
virtual void | GetHueRange (double &, double &) |
virtual void | GetHueRange (double[2]) |
virtual void | SetSaturationRange (double, double) |
void | SetSaturationRange (double[2]) |
virtual double * | GetSaturationRange () |
virtual void | GetSaturationRange (double &, double &) |
virtual void | GetSaturationRange (double[2]) |
virtual void | SetValueRange (double, double) |
void | SetValueRange (double[2]) |
virtual double * | GetValueRange () |
virtual void | GetValueRange (double &, double &) |
virtual void | GetValueRange (double[2]) |
virtual void | SetAlphaRange (double, double) |
void | SetAlphaRange (double[2]) |
virtual double * | GetAlphaRange () |
virtual void | GetAlphaRange (double &, double &) |
virtual void | GetAlphaRange (double[2]) |
virtual void | SetNanColor (double, double, double, double) |
virtual void | SetNanColor (double[4]) |
virtual double * | GetNanColor () |
virtual void | GetNanColor (double &, double &, double &, double &) |
virtual void | GetNanColor (double[4]) |
void | SetNumberOfTableValues (vtkIdType number) |
vtkIdType | GetNumberOfTableValues () |
unsigned char * | GetPointer (const vtkIdType id) |
double * | GetRange () |
void | SetRange (double min, double max) |
void | SetRange (double rng[2]) |
virtual void | SetNumberOfColors (vtkIdType) |
virtual vtkIdType | GetNumberOfColors () |
void | SetTable (vtkUnsignedCharArray *) |
virtual vtkUnsignedCharArray * | GetTable () |
void | MapScalarsThroughTable2 (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputIncrement) |
virtual int | UsingLogScale () |
![]() | |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | SetRange (double rng[2]) |
double * | GetColor (double v) |
virtual double | GetOpacity (double vtkNotUsed(v)) |
double | GetLuminance (double x) |
virtual void | SetAlpha (double alpha) |
virtual double | GetAlpha () |
virtual vtkUnsignedCharArray * | MapScalars (vtkDataArray *scalars, int colorMode, int component) |
virtual void | SetVectorMode (int) |
virtual int | GetVectorMode () |
void | SetVectorModeToMagnitude () |
void | SetVectorModeToComponent () |
virtual void | SetVectorComponent (int) |
virtual int | GetVectorComponent () |
void | MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output, int outputFormat) |
void | MapScalarsThroughTable (vtkDataArray *scalars, unsigned char *output) |
virtual vtkUnsignedCharArray * | ConvertUnsignedCharToRGBA (vtkUnsignedCharArray *colors, int numComp, int numTuples) |
![]() | |
virtual void | DebugOn () |
virtual void | DebugOff () |
unsigned char | GetDebug () |
void | SetDebug (unsigned char debugFlag) |
virtual void | Modified () |
virtual unsigned long | GetMTime () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
![]() | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &os) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static vtkLookupTable * | New () |
static int | IsTypeOf (const char *type) |
static vtkLookupTable * | SafeDownCast (vtkObject *o) |
static void | GetLogRange (const double range[2], double log_range[2]) |
static double | ApplyLogScale (double v, const double range[2], const double log_range[2]) |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkScalarsToColors * | SafeDownCast (vtkObject *o) |
![]() | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObject *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
![]() | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
vtkLookupTable (int sze=256, int ext=256) | |
~vtkLookupTable () | |
![]() | |
vtkScalarsToColors () | |
~vtkScalarsToColors () | |
![]() | |
vtkObject () | |
virtual | ~vtkObject () |
virtual void | RegisterInternal (vtkObjectBase *, int check) |
virtual void | UnRegisterInternal (vtkObjectBase *, int check) |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
![]() | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &os) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
vtkIdType | NumberOfColors |
vtkUnsignedCharArray * | Table |
double | TableRange [2] |
double | HueRange [2] |
double | SaturationRange [2] |
double | ValueRange [2] |
double | AlphaRange [2] |
double | NanColor [4] |
int | Scale |
int | Ramp |
vtkTimeStamp | InsertTime |
vtkTimeStamp | BuildTime |
double | RGBA [4] |
int | OpaqueFlag |
vtkTimeStamp | OpaqueFlagBuildTime |
![]() | |
double | Alpha |
int | VectorMode |
int | UseMagnitude |
int | VectorComponent |
![]() | |
unsigned char | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
![]() | |
int | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
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 transparency) color specification, or rgba into scalar values. The color table can be created by direct insertion of color values, or by specifying hue, saturation, value, and alpha range and generating a table.
Definition at line 50 of file vtkLookupTable.h.
Definition at line 57 of file vtkLookupTable.h.
|
protected |
|
protected |
|
static |
Construct with range=[0,1]; and hsv ranges set up for rainbow color table (from red to blue).
|
virtual |
Reimplemented from vtkScalarsToColors.
Reimplemented in vtkLookupTableWithEnabling, vtkWindowLevelLookupTable, and vtkLogLookupTable.
|
static |
|
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 vtkLookupTableWithEnabling, vtkWindowLevelLookupTable, and vtkLogLookupTable.
|
static |
|
virtual |
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 vtkObject.
Reimplemented in vtkLookupTableWithEnabling, and vtkWindowLevelLookupTable.
|
virtual |
Return true if all of the values defining the mapping have an opacity equal to 1. Default implementation return true.
Reimplemented from vtkScalarsToColors.
int vtkLookupTable::Allocate | ( | int | sz = 256 , |
int | ext = 256 |
||
) |
Allocate a color table of specified size.
|
virtual |
Generate lookup table from hue, saturation, value, alpha min/max values. Table is built from linear ramp of each value.
Reimplemented from vtkScalarsToColors.
Reimplemented in vtkWindowLevelLookupTable.
|
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.
|
virtual |
Set the shape of the table ramp to either linear or S-curve. 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, while the equation for the linear ramp is simply y = x. 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 SQRT is y = sqrt(x).
|
inline |
Set the shape of the table ramp to either linear or S-curve. 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, while the equation for the linear ramp is simply y = x. 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 SQRT is y = sqrt(x).
Definition at line 87 of file vtkLookupTable.h.
|
inline |
Set the shape of the table ramp to either linear or S-curve. 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, while the equation for the linear ramp is simply y = x. 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 SQRT is y = sqrt(x).
Definition at line 88 of file vtkLookupTable.h.
|
inline |
Set the shape of the table ramp to either linear or S-curve. 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, while the equation for the linear ramp is simply y = x. 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 SQRT is y = sqrt(x).
Definition at line 89 of file vtkLookupTable.h.
|
virtual |
Set the shape of the table ramp to either linear or S-curve. 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, while the equation for the linear ramp is simply y = x. 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 SQRT is y = sqrt(x).
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.
|
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 98 of file vtkLookupTable.h.
|
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 99 of file vtkLookupTable.h.
|
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.
void vtkLookupTable::SetTableRange | ( | double | r[2] | ) |
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.
|
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.
|
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.
|
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.
|
virtual |
Set the range in hue (using automatic generation). Hue ranges between [0,1].
void vtkLookupTable::SetHueRange | ( | double | [2] | ) |
Set the range in hue (using automatic generation). Hue ranges between [0,1].
|
virtual |
Set the range in hue (using automatic generation). Hue ranges between [0,1].
|
virtual |
Set the range in hue (using automatic generation). Hue ranges between [0,1].
|
virtual |
Set the range in hue (using automatic generation). Hue ranges between [0,1].
|
virtual |
Set the range in saturation (using automatic generation). Saturation ranges between [0,1].
void vtkLookupTable::SetSaturationRange | ( | double | [2] | ) |
Set the range in saturation (using automatic generation). Saturation ranges between [0,1].
|
virtual |
Set the range in saturation (using automatic generation). Saturation ranges between [0,1].
|
virtual |
Set the range in saturation (using automatic generation). Saturation ranges between [0,1].
|
virtual |
Set the range in saturation (using automatic generation). Saturation ranges between [0,1].
|
virtual |
Set the range in value (using automatic generation). Value ranges between [0,1].
void vtkLookupTable::SetValueRange | ( | double | [2] | ) |
Set the range in value (using automatic generation). Value ranges between [0,1].
|
virtual |
Set the range in value (using automatic generation). Value ranges between [0,1].
|
virtual |
Set the range in value (using automatic generation). Value ranges between [0,1].
|
virtual |
Set the range in value (using automatic generation). Value ranges between [0,1].
|
virtual |
Set the range in alpha (using automatic generation). Alpha ranges from [0,1].
void vtkLookupTable::SetAlphaRange | ( | double | [2] | ) |
Set the range in alpha (using automatic generation). Alpha ranges from [0,1].
|
virtual |
Set the range in alpha (using automatic generation). Alpha ranges from [0,1].
|
virtual |
Set the range in alpha (using automatic generation). Alpha ranges from [0,1].
|
virtual |
Set the range in alpha (using automatic generation). Alpha ranges from [0,1].
|
virtual |
Set the color to use when a NaN (not a number) is encountered. This is an RGBA 4-tuple color of doubles in the range [0,1].
|
virtual |
Set the color to use when a NaN (not a number) is encountered. This is an RGBA 4-tuple color of doubles in the range [0,1].
|
virtual |
Set the color to use when a NaN (not a number) is encountered. This is an RGBA 4-tuple color of doubles in the range [0,1].
|
virtual |
Set the color to use when a NaN (not a number) is encountered. This is an RGBA 4-tuple color of doubles in the range [0,1].
|
virtual |
Set the color to use when a NaN (not a number) is encountered. This is an RGBA 4-tuple color of doubles in the range [0,1].
|
virtual |
Map one value through the lookup table.
Implements vtkScalarsToColors.
|
virtual |
Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.
Implements vtkScalarsToColors.
double vtkLookupTable::GetOpacity | ( | double | v | ) |
Map one value through the lookup table and return the alpha value (the opacity) as a double between 0 and 1.
|
virtual |
Return the table index associated with a particular value.
void vtkLookupTable::SetNumberOfTableValues | ( | vtkIdType | number | ) |
Specify the number of values (i.e., colors) in the lookup table.
|
inline |
Specify the number of values (i.e., colors) in the lookup table.
Definition at line 165 of file vtkLookupTable.h.
void vtkLookupTable::SetTableValue | ( | vtkIdType | indx, |
double | rgba[4] | ||
) |
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.
void vtkLookupTable::SetTableValue | ( | vtkIdType | indx, |
double | r, | ||
double | g, | ||
double | b, | ||
double | a = 1.0 |
||
) |
Directly load color into lookup table. Use [0,1] double values for color component specification.
double* vtkLookupTable::GetTableValue | ( | vtkIdType | id | ) |
Return a rgba color value for the given index into the lookup table. Color components are expressed as [0,1] double values.
void vtkLookupTable::GetTableValue | ( | vtkIdType | id, |
double | rgba[4] | ||
) |
Return a rgba color value for the given index into the lookup table. Color components are expressed as [0,1] double values.
|
inline |
Get pointer to color table data. Format is array of unsigned char r-g-b-a-r-g-b-a...
Definition at line 189 of file vtkLookupTable.h.
|
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.
Definition at line 287 of file vtkLookupTable.h.
|
inlinevirtual |
Sets/Gets the range of scalars which will be mapped. This is a duplicate of Get/SetTableRange.
Implements vtkScalarsToColors.
Definition at line 202 of file vtkLookupTable.h.
|
inlinevirtual |
Sets/Gets the range of scalars which will be mapped. This is a duplicate of Get/SetTableRange.
Implements vtkScalarsToColors.
Definition at line 203 of file vtkLookupTable.h.
|
inline |
Sets/Gets the range of scalars which will be mapped. This is a duplicate of Get/SetTableRange.
Definition at line 204 of file vtkLookupTable.h.
|
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'.
|
static |
Apply log to value, with appropriate constraints.
|
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.
|
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.
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.
|
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.
|
virtual |
map a set of scalars through the lookup table
Implements vtkScalarsToColors.
Reimplemented in vtkLookupTableWithEnabling.
void vtkLookupTable::DeepCopy | ( | vtkLookupTable * | lut | ) |
Copy the contents from another LookupTable
|
inlinevirtual |
This should return 1 is the subclass is using log scale for mapping scalars to colors. Returns 1 is scale == VTK_SCALE_LOG10.
Reimplemented from vtkScalarsToColors.
Definition at line 251 of file vtkLookupTable.h.
|
virtual |
Get the number of available colors for mapping to.
Implements vtkScalarsToColors.
|
protected |
Definition at line 264 of file vtkLookupTable.h.
|
protected |
Definition at line 265 of file vtkLookupTable.h.
|
protected |
Definition at line 266 of file vtkLookupTable.h.
|
protected |
Definition at line 267 of file vtkLookupTable.h.
|
protected |
Definition at line 268 of file vtkLookupTable.h.
|
protected |
Definition at line 269 of file vtkLookupTable.h.
|
protected |
Definition at line 270 of file vtkLookupTable.h.
|
protected |
Definition at line 271 of file vtkLookupTable.h.
|
protected |
Definition at line 272 of file vtkLookupTable.h.
|
protected |
Definition at line 273 of file vtkLookupTable.h.
|
protected |
Definition at line 274 of file vtkLookupTable.h.
|
protected |
Definition at line 275 of file vtkLookupTable.h.
|
protected |
Definition at line 276 of file vtkLookupTable.h.
|
protected |
Definition at line 278 of file vtkLookupTable.h.
|
protected |
Definition at line 279 of file vtkLookupTable.h.