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
106 int Allocate(
int sz=256,
int ext=256);
112 void Build() VTK_OVERRIDE;
121 virtual
void ForceBuild();
126 void BuildSpecialColors();
142 vtkGetMacro(Ramp,
int);
151 void SetScale(
int scale);
154 vtkGetMacro(Scale,
int);
166 void SetTableRange(
double r[2]);
167 virtual void SetTableRange(
double min,
double max);
168 vtkGetVectorMacro(TableRange,
double,2);
176 vtkSetVector2Macro(HueRange,
double);
177 vtkGetVector2Macro(HueRange,
double);
185 vtkSetVector2Macro(SaturationRange,
double);
186 vtkGetVector2Macro(SaturationRange,
double);
194 vtkSetVector2Macro(ValueRange,
double);
195 vtkGetVector2Macro(ValueRange,
double);
203 vtkSetVector2Macro(AlphaRange,
double);
204 vtkGetVector2Macro(AlphaRange,
double);
212 vtkSetVector4Macro(NanColor,
double);
213 vtkGetVector4Macro(NanColor,
double);
220 unsigned char* GetNanColorAsUnsignedChars();
226 static void GetColorAsUnsignedChars(
const double colorIn[4],
227 unsigned char colorOut[4]);
234 vtkSetVector4Macro(BelowRangeColor,
double);
235 vtkGetVector4Macro(BelowRangeColor,
double);
243 vtkGetMacro(UseBelowRangeColor,
int);
252 vtkSetVector4Macro(AboveRangeColor,
double);
253 vtkGetVector4Macro(AboveRangeColor,
double);
261 vtkGetMacro(UseAboveRangeColor,
int);
268 unsigned char*
MapValue(
double v) VTK_OVERRIDE;
274 void GetColor(
double x,
double rgb[3]) VTK_OVERRIDE;
297 void SetNumberOfTableValues(
vtkIdType number);
307 virtual void SetTableValue(
vtkIdType indx,
double rgba[4]);
313 virtual void SetTableValue(
vtkIdType indx,
314 double r,
double g,
double b,
double a=1.0);
326 void GetTableValue(
vtkIdType id,
double rgba[4]);
333 return this->Table->GetPointer(4*
id); };
345 unsigned char *WritePointer(
const vtkIdType id,
const int number);
353 {
return this->GetTableRange(); };
355 { this->SetTableRange(min,
max); };
365 static void GetLogRange(
const double range[2],
double log_range[2]);
370 static double ApplyLogScale(
double v,
const double range[2],
371 const double log_range[2]);
400 unsigned char *output,
404 int outputIncrement) VTK_OVERRIDE;
432 void GetIndexedColor(
vtkIdType idx,
double rgba[4]) VTK_OVERRIDE;
440 double TableRange[2];
442 double SaturationRange[2];
443 double ValueRange[2];
444 double AlphaRange[2];
446 double BelowRangeColor[4];
447 int UseBelowRangeColor;
448 double AboveRangeColor[4];
449 int UseAboveRangeColor;
456 unsigned char NanColorChar[4];
464 void ResizeTableForSpecialColors();
476 return this->Table->WritePointer(4*
id,4*number);
record modification and/or execution time
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.
void SetRange(double min, double max) override
Sets/Gets the range of scalars which will be mapped.
int UsingLogScale() override
This should return 1 is 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 unsigned char * MapValue(double v)
Map one value through the lookup table and return a color defined as a RGBA unsigned char tuple (4 by...
void SetRampToSCurve()
Set the shape of the table ramp to either linear or S-curve.
Superclass for mapping scalar values to colors.
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.
a simple class to control print indentation
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.
static const vtkIdType NAN_COLOR_INDEX
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
unsigned char * GetPointer(const vtkIdType id)
Get pointer to color table data.
dynamic, self-adjusting array of unsigned char
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetRange(double rng[2])
Sets/Gets the range of scalars which will be mapped.
void SetRampToSQRT()
Set the shape of the table ramp to either linear or S-curve.
static const vtkIdType BELOW_RANGE_COLOR_INDEX
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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.