vtkLookupTable Class Reference
#include <vtkLookupTable.h>
Inheritance diagram for vtkLookupTable:
[legend]Collaboration diagram for vtkLookupTable:
[legend]List of all members.
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 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.
- Warning:
- You need to explicitely call Build() when constructing the LUT by hand.
- See also:
- vtkLogLookupTable vtkWindowLevelLookupTable
- Created by:
-
- CVS contributions (if > 5%):
- Schroeder, Will (32%)
- Gobbi, David (26%)
- Martin, Ken (18%)
- CVS logs (CVSweb):
.cxx (/Common/vtkLookupTable
.cxx)
.h (/Common/vtkLookupTable
.h)
- Examples:
- vtkLookupTable (Examples)
- Tests:
- vtkLookupTable (Tests)
Definition at line 62 of file vtkLookupTable.h.
|
Public Types |
typedef vtkScalarsToColors | Superclass |
Public Member Functions |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
int | Allocate (int sz=256, int ext=256) |
virtual void | Build () |
virtual void | ForceBuild () |
unsigned char * | MapValue (double v) |
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 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]) |
|
double * | GetColor (double x) |
void | GetColor (double x, double rgb[3]) |
|
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 | MapScalarsThroughTable2 (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputIncrement) |
Static Public Member Functions |
vtkLookupTable * | New () |
int | IsTypeOf (const char *type) |
vtkLookupTable * | SafeDownCast (vtkObject *o) |
Protected Member Functions |
| vtkLookupTable (int sze=256, int ext=256) |
| ~vtkLookupTable () |
Protected Attributes |
vtkIdType | NumberOfColors |
vtkUnsignedCharArray * | Table |
double | TableRange [2] |
double | HueRange [2] |
double | SaturationRange [2] |
double | ValueRange [2] |
double | AlphaRange [2] |
int | Scale |
int | Ramp |
vtkTimeStamp | InsertTime |
vtkTimeStamp | BuildTime |
double | RGBA [4] |
Member Typedef Documentation
Constructor & Destructor Documentation
vtkLookupTable::vtkLookupTable |
( |
int |
sze = 256 , |
|
|
int |
ext = 256 |
|
) |
[protected] |
|
Member Function Documentation
virtual const char* vtkLookupTable::GetClassName |
( |
|
) |
[virtual] |
|
int vtkLookupTable::IsTypeOf |
( |
const char * |
type |
) |
[static] |
|
virtual int vtkLookupTable::IsA |
( |
const char * |
type |
) |
[virtual] |
|
void vtkLookupTable::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
[virtual] |
|
int vtkLookupTable::Allocate |
( |
int |
sz = 256 , |
|
|
int |
ext = 256 |
|
) |
|
|
|
Allocate a color table of specified size. |
virtual void vtkLookupTable::Build |
( |
|
) |
[virtual] |
|
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. |
virtual void vtkLookupTable::SetRamp |
( |
int |
|
) |
[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::SetRampToLinear |
( |
|
) |
[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 95 of file vtkLookupTable.h.
References VTK_RAMP_LINEAR. |
void vtkLookupTable::SetRampToSCurve |
( |
|
) |
[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 96 of file vtkLookupTable.h.
References VTK_RAMP_SCURVE. |
void vtkLookupTable::SetRampToSQRT |
( |
|
) |
[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 97 of file vtkLookupTable.h.
References VTK_RAMP_SQRT. |
virtual int vtkLookupTable::GetRamp |
( |
|
) |
[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. |
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 106 of file vtkLookupTable.h.
References VTK_SCALE_LINEAR. |
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 107 of file vtkLookupTable.h.
References VTK_SCALE_LOG10. |
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. |
void vtkLookupTable::SetTableRange |
( |
double |
r[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. |
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. |
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. |
virtual void vtkLookupTable::SetHueRange |
( |
double |
, |
|
|
double |
|
|
) |
[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 double* vtkLookupTable::GetHueRange |
( |
|
) |
[virtual] |
|
|
Set the range in hue (using automatic generation). Hue ranges between [0,1]. |
virtual void vtkLookupTable::GetHueRange |
( |
double & |
, |
|
|
double & |
|
|
) |
[virtual] |
|
|
Set the range in hue (using automatic generation). Hue ranges between [0,1]. |
virtual void vtkLookupTable::GetHueRange |
( |
double |
[2] |
) |
[virtual] |
|
|
Set the range in hue (using automatic generation). Hue ranges between [0,1]. |
virtual void vtkLookupTable::SetSaturationRange |
( |
double |
, |
|
|
double |
|
|
) |
[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 double* vtkLookupTable::GetSaturationRange |
( |
|
) |
[virtual] |
|
|
Set the range in saturation (using automatic generation). Saturation ranges between [0,1]. |
virtual void vtkLookupTable::GetSaturationRange |
( |
double & |
, |
|
|
double & |
|
|
) |
[virtual] |
|
|
Set the range in saturation (using automatic generation). Saturation ranges between [0,1]. |
virtual void vtkLookupTable::GetSaturationRange |
( |
double |
[2] |
) |
[virtual] |
|
|
Set the range in saturation (using automatic generation). Saturation ranges between [0,1]. |
virtual void vtkLookupTable::SetValueRange |
( |
double |
, |
|
|
double |
|
|
) |
[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 double* vtkLookupTable::GetValueRange |
( |
|
) |
[virtual] |
|
|
Set the range in value (using automatic generation). Value ranges between [0,1]. |
virtual void vtkLookupTable::GetValueRange |
( |
double & |
, |
|
|
double & |
|
|
) |
[virtual] |
|
|
Set the range in value (using automatic generation). Value ranges between [0,1]. |
virtual void vtkLookupTable::GetValueRange |
( |
double |
[2] |
) |
[virtual] |
|
|
Set the range in value (using automatic generation). Value ranges between [0,1]. |
virtual void vtkLookupTable::SetAlphaRange |
( |
double |
, |
|
|
double |
|
|
) |
[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 double* vtkLookupTable::GetAlphaRange |
( |
|
) |
[virtual] |
|
|
Set the range in alpha (using automatic generation). Alpha ranges from [0,1]. |
virtual void vtkLookupTable::GetAlphaRange |
( |
double & |
, |
|
|
double & |
|
|
) |
[virtual] |
|
|
Set the range in alpha (using automatic generation). Alpha ranges from [0,1]. |
virtual void vtkLookupTable::GetAlphaRange |
( |
double |
[2] |
) |
[virtual] |
|
|
Set the range in alpha (using automatic generation). Alpha ranges from [0,1]. |
unsigned char* vtkLookupTable::MapValue |
( |
double |
v |
) |
[virtual] |
|
double* vtkLookupTable::GetColor |
( |
double |
x |
) |
[inline] |
|
void vtkLookupTable::GetColor |
( |
double |
x, |
|
|
double |
rgb[3] |
|
) |
[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 vtkIdType vtkLookupTable::GetIndex |
( |
double |
v |
) |
[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. |
vtkIdType vtkLookupTable::GetNumberOfTableValues |
( |
|
) |
[inline] |
|
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. |
unsigned char* vtkLookupTable::GetPointer |
( |
const 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 193 of file vtkLookupTable.h.
References vtkIdType. |
unsigned char * vtkLookupTable::WritePointer |
( |
const vtkIdType |
id, |
|
|
const int |
number |
|
) |
[inline] |
|
double* vtkLookupTable::GetRange |
( |
|
) |
[inline, virtual] |
|
void vtkLookupTable::SetRange |
( |
double |
min, |
|
|
double |
max |
|
) |
[inline, virtual] |
|
void vtkLookupTable::SetRange |
( |
double |
rng[2] |
) |
[inline] |
|
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. |
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. |
void vtkLookupTable::MapScalarsThroughTable2 |
( |
void * |
input, |
|
|
unsigned char * |
output, |
|
|
int |
inputDataType, |
|
|
int |
numberOfValues, |
|
|
int |
inputIncrement, |
|
|
int |
outputIncrement |
|
) |
[virtual] |
|
|
Copy the contents from another LookupTable |
Member Data Documentation
The documentation for this class was generated from the following file: