Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members   Related Pages  

vtkLookupTable Class Reference

map scalar values into colors or colors to scalars; generate color table. More...

#include <vtkLookupTable.h>

Inheritance diagram for vtkLookupTable:

Inheritance graph
[legend]
Collaboration diagram for vtkLookupTable:

Collaboration graph
[legend]
List of all members.

Public Methods

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 SetNumberOfColors (int)
virtual int GetNumberOfColors ()
void SetTableRange (float r[2])
virtual void SetTableRange (float min, float max)
virtual float * GetTableRange ()
virtual void GetTableRange (float data[2])
virtual void SetHueRange (float, float)
void SetHueRange (float[2])
virtual float * GetHueRange ()
virtual void GetHueRange (float data[2])
virtual void SetSaturationRange (float, float)
void SetSaturationRange (float[2])
virtual float * GetSaturationRange ()
virtual void GetSaturationRange (float data[2])
virtual void SetValueRange (float, float)
void SetValueRange (float[2])
virtual float * GetValueRange ()
virtual void GetValueRange (float data[2])
virtual void SetAlphaRange (float, float)
void SetAlphaRange (float[2])
virtual float * GetAlphaRange ()
virtual void GetAlphaRange (float data[2])
unsigned char * MapValue (float v)
void MapScalarsThroughTable2 (void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputIncrement)
float * GetColor (float x)
void GetColor (float x, float rgb[3])
float GetOpacity (float v)
void SetNumberOfTableValues (int number)
void SetTableValue (int indx, float rgba[4])
void SetTableValue (int indx, float r, float g, float b, float a=1.0)
float * GetTableValue (int id)
void GetTableValue (int id, float rgba[4])
unsigned char * GetPointer (const int id)
unsigned char * WritePointer (const int id, const int number)
float * GetRange ()
void SetRange (float min, float max)
void SetRange (float rng[2])

Static Public Methods

vtkLookupTable * New ()
int IsTypeOf (const char *type)
vtkLookupTable * SafeDownCast (vtkObject *o)

Protected Methods

 vtkLookupTable (int sze=256, int ext=256)
 ~vtkLookupTable ()
 vtkLookupTable (const vtkLookupTable &)
void operator= (const vtkLookupTable &)

Protected Attributes

int NumberOfColors
vtkUnsignedCharArrayTable
float TableRange [2]
float HueRange [2]
float SaturationRange [2]
float ValueRange [2]
float AlphaRange [2]
vtkTimeStamp InsertTime
vtkTimeStamp BuildTime
float RGBA [4]

Detailed Description

map scalar values into colors or colors to scalars; generate color table.

Date:
2000/12/10 20:08:12
Revision:
1.55

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.

This class is designed as a base class for derivation by other classes. The Build(), MapValue(), MapValues(), and SetTableRange() methods are virtual and may require overloading in subclasses.

Warning:
vtkLookupTable is a reference counted object. Therefore, you should always use operator "new" to construct new objects. This procedure will avoid memory problems (see text).
See also:
vtkLogLookupTable vtkWindowLevelLookupTable
Examples:
vtkLookupTable (examples)


Member Function Documentation

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

Allocate a color table of specified size.

virtual void vtkLookupTable::Build   [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 const char* vtkLookupTable::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkScalarsToColors.

Reimplemented in vtkLogLookupTable.

void vtkLookupTable::GetColor float    x,
float    rgb[3]
[virtual]
 

Map one value through the lookup table and return the color as an RGB array of floats between 0 and 1.

Implements vtkScalarsToColors.

float* vtkLookupTable::GetColor float    x [inline]
 

Map one value through the lookup table and return the color as an RGB array of floats between 0 and 1.

Reimplemented from vtkScalarsToColors.

float vtkLookupTable::GetOpacity float    v
 

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

unsigned char* vtkLookupTable::GetPointer const int    id [inline]
 

Get pointer to color table data. Format is array of unsigned char r-g-b-a-r-g-b-a...

float* vtkLookupTable::GetRange   [inline, virtual]
 

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

Implements vtkScalarsToColors.

void vtkLookupTable::GetTableValue int    id,
float    rgba[4]
 

Return a rgba color value for the given index into the lookup table. Color components are expressed as [0,1] float values.

float* vtkLookupTable::GetTableValue int    id
 

Return a rgba color value for the given index into the lookup table. Color components are expressed as [0,1] float values.

virtual int vtkLookupTable::IsA const char *    type [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.

int vtkLookupTable::IsTypeOf const char *    type [static]
 

Return 1 if this class type 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.

void vtkLookupTable::MapScalarsThroughTable2 void *    input,
unsigned char *    output,
int    inputDataType,
int    numberOfValues,
int    inputIncrement,
int    outputIncrement
[virtual]
 

map a set of scalars through the lookup table

Implements vtkScalarsToColors.

Reimplemented in vtkLogLookupTable.

unsigned char* vtkLookupTable::MapValue float    v [virtual]
 

Map one value through the lookup table.

Implements vtkScalarsToColors.

Reimplemented in vtkLogLookupTable.

vtkLookupTable* vtkLookupTable::New   [static]
 

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

Reimplemented from vtkObject.

Reimplemented in vtkLogLookupTable.

void vtkLookupTable::PrintSelf ostream &    os,
vtkIndent    indent
[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 vtkLogLookupTable.

vtkLookupTable* vtkLookupTable::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkScalarsToColors.

Reimplemented in vtkLogLookupTable.

virtual void vtkLookupTable::SetAlphaRange float   ,
float   
[virtual]
 

Set the range in alpha (using automatic generation). Alpha ranges from (0,1).

virtual void vtkLookupTable::SetHueRange float   ,
float   
[virtual]
 

Set the range in hue (using automatic generation). Hue ranges between (0,1).

virtual void vtkLookupTable::SetNumberOfColors int    [virtual]
 

Set the number of colors in the lookup table. Use this method before building the lookup table. Use SetNumberOfTableValues() to change the table size after the lookup table has been built.

void vtkLookupTable::SetNumberOfTableValues int    number
 

Specify the number of values (i.e., colors) in the lookup table. This method simply allocates memory and prepares the table for use with SetTableValue(). It differs from Build() method in that the allocated memory is not initialized according to HSVA ramps.

virtual void vtkLookupTable::SetSaturationRange float   ,
float   
[virtual]
 

Set the range in saturation (using automatic generation). Saturation ranges between (0,1).

void vtkLookupTable::SetTableRange float    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.

Reimplemented in vtkLogLookupTable.

void vtkLookupTable::SetTableValue int    indx,
float    r,
float    g,
float    b,
float    a = 1.0
 

Directly load color into lookup table. Use [0,1] float values for color component specification.

void vtkLookupTable::SetTableValue int    indx,
float    rgba[4]
 

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

virtual void vtkLookupTable::SetValueRange float   ,
float   
[virtual]
 

Set the range in value (using automatic generation). Value ranges between (0,1).

unsigned char * vtkLookupTable::WritePointer const int    id,
const 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.


The documentation for this class was generated from the following file:
Generated on Tue Mar 19 13:28:41 2002 for VTK by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002