60 #ifndef vtkLookupTable_h
61 #define vtkLookupTable_h
63 #include "vtkCommonCoreModule.h"
68 #define VTK_RAMP_LINEAR 0
69 #define VTK_RAMP_SCURVE 1
70 #define VTK_RAMP_SQRT 2
71 #define VTK_SCALE_LINEAR 0
72 #define VTK_SCALE_LOG10 1
114 int Allocate(
int sz = 256,
int ext = 256);
120 void Build()
override;
129 virtual void ForceBuild();
134 void BuildSpecialColors();
149 vtkSetMacro(Ramp,
int);
153 vtkGetMacro(Ramp,
int);
162 void SetScale(
int scale);
165 vtkGetMacro(Scale,
int);
177 virtual void SetTableRange(
const double r[2]);
178 virtual void SetTableRange(
double min,
double max);
179 vtkGetVectorMacro(TableRange,
double, 2);
187 vtkSetVector2Macro(HueRange,
double);
188 vtkGetVector2Macro(HueRange,
double);
196 vtkSetVector2Macro(SaturationRange,
double);
197 vtkGetVector2Macro(SaturationRange,
double);
205 vtkSetVector2Macro(ValueRange,
double);
206 vtkGetVector2Macro(ValueRange,
double);
214 vtkSetVector2Macro(AlphaRange,
double);
215 vtkGetVector2Macro(AlphaRange,
double);
223 vtkSetVector4Macro(NanColor,
double);
224 vtkGetVector4Macro(NanColor,
double);
231 unsigned char* GetNanColorAsUnsignedChars();
236 static void GetColorAsUnsignedChars(
const double colorIn[4],
unsigned char colorOut[4]);
243 vtkSetVector4Macro(BelowRangeColor,
double);
244 vtkGetVector4Macro(BelowRangeColor,
double);
261 vtkSetVector4Macro(AboveRangeColor,
double);
262 vtkGetVector4Macro(AboveRangeColor,
double);
277 const unsigned char*
MapValue(
double v)
override;
283 void GetColor(
double v,
double rgb[3])
override;
306 void SetNumberOfTableValues(
vtkIdType number);
316 virtual void SetTableValue(
vtkIdType indx,
const double rgba[4]);
322 virtual void SetTableValue(
vtkIdType indx,
double r,
double g,
double b,
double a = 1.0);
334 void GetTableValue(
vtkIdType indx,
double rgba[4]);
352 unsigned char* WritePointer(
vtkIdType id,
int number);
360 void SetRange(
double min,
double max)
override { this->SetTableRange(min, max); }
370 static void GetLogRange(
const double range[2],
double log_range[2]);
375 static double ApplyLogScale(
double v,
const double range[2],
const double log_range[2]);
404 int numberOfValues,
int inputIncrement,
int outputFormat)
override;
437 double TableRange[2];
439 double SaturationRange[2];
440 double ValueRange[2];
441 double AlphaRange[2];
443 double BelowRangeColor[4];
445 double AboveRangeColor[4];
453 unsigned char NanColorChar[4];
462 void ResizeTableForSpecialColors();
void SetRampToLinear()
Set the shape of the table ramp to either S-curve, linear, or sqrt.
ValueType * WritePointer(vtkIdType valueIdx, vtkIdType numValues)
Get the address of a particular data index.
vtkTimeStamp OpaqueFlagBuildTime
Abstract superclass for all arrays.
vtkTimeStamp SpecialColorsBuildTime
vtkTypeBool UseBelowRangeColor
record modification and/or execution time
static const vtkIdType REPEATED_LAST_COLOR_INDEX
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
map scalar values into colors via a lookup table
void Modified()
Set this objects time to the current time.
virtual void MapScalarsThroughTable2(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
An internal method typically not used in applications.
unsigned char * WritePointer(vtkIdType id, int number)
Get pointer to data.
void SetRange(double min, double max) override
Sets/Gets the range of scalars which will be mapped.
int UsingLogScale() override
This should return 1 if the subclass is using log scale for mapping scalars to colors.
static const vtkIdType NUMBER_OF_SPECIAL_COLORS
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
double * GetRange() override
Sets/Gets the range of scalars which will be mapped.
void SetScaleToLog10()
Set the type of scale to use, linear or logarithmic.
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 b...
void SetRampToSCurve()
Set the shape of the table ramp to either S-curve, linear, or sqrt.
Superclass for mapping scalar values to colors.
vtkTypeBool UseAboveRangeColor
virtual double GetOpacity(double v)
Map one value through the lookup table and return the alpha value (the opacity) as a double between 0...
static vtkScalarsToColors * New()
virtual int IsOpaque()
Return true if all of the values defining the mapping have an opacity equal to 1. ...
void SetScaleToLinear()
Set the type of scale to use, linear or logarithmic.
void SetRange(const double rng[2]) override
Sets/Gets the range of scalars which will be mapped.
a simple class to control print indentation
unsigned char * GetPointer(vtkIdType id)
Get pointer to color table data.
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...
vtkIdType GetNumberOfTableValues()
Specify the number of values (i.e., colors) in the lookup table.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_SIZEHINT(...)
static const vtkIdType NAN_COLOR_INDEX
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
dynamic, self-adjusting array of unsigned char
vtkUnsignedCharArray * Table
virtual void GetIndexedColor(vtkIdType i, double rgba[4])
Get the "indexed color" assigned to an index.
void SetRampToSQRT()
Set the shape of the table ramp to either S-curve, linear, or sqrt.
virtual void Build()
Perform any processing required (if any) before processing scalars.
static const vtkIdType BELOW_RANGE_COLOR_INDEX
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
virtual void DeepCopy(vtkScalarsToColors *o)
Copy the contents from another object.
static const vtkIdType ABOVE_RANGE_COLOR_INDEX
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
virtual vtkIdType GetNumberOfAvailableColors()
Get the number of available colors for mapping to.