54 #ifndef vtkLookupTable_h 55 #define vtkLookupTable_h 57 #include "vtkCommonCoreModule.h" 62 #define VTK_RAMP_LINEAR 0 63 #define VTK_RAMP_SCURVE 1 64 #define VTK_RAMP_SQRT 2 65 #define VTK_SCALE_LINEAR 0 66 #define VTK_SCALE_LOG10 1 100 int Allocate(
int sz=256,
int ext=256);
106 void Build() VTK_OVERRIDE;
115 virtual
void ForceBuild();
120 void BuildSpecialColors();
136 vtkGetMacro(Ramp,
int);
145 void SetScale(
int scale);
148 vtkGetMacro(Scale,
int);
160 void SetTableRange(
double r[2]);
161 virtual void SetTableRange(
double min,
double max);
162 vtkGetVectorMacro(TableRange,
double,2);
170 vtkSetVector2Macro(HueRange,
double);
171 vtkGetVector2Macro(HueRange,
double);
179 vtkSetVector2Macro(SaturationRange,
double);
180 vtkGetVector2Macro(SaturationRange,
double);
188 vtkSetVector2Macro(ValueRange,
double);
189 vtkGetVector2Macro(ValueRange,
double);
197 vtkSetVector2Macro(AlphaRange,
double);
198 vtkGetVector2Macro(AlphaRange,
double);
206 vtkSetVector4Macro(NanColor,
double);
207 vtkGetVector4Macro(NanColor,
double);
214 unsigned char* GetNanColorAsUnsignedChars();
220 static void GetColorAsUnsignedChars(
const double colorIn[4],
221 unsigned char colorOut[4]);
228 vtkSetVector4Macro(BelowRangeColor,
double);
229 vtkGetVector4Macro(BelowRangeColor,
double);
237 vtkGetMacro(UseBelowRangeColor,
int);
246 vtkSetVector4Macro(AboveRangeColor,
double);
247 vtkGetVector4Macro(AboveRangeColor,
double);
255 vtkGetMacro(UseAboveRangeColor,
int);
262 unsigned char*
MapValue(
double v) VTK_OVERRIDE;
268 void GetColor(
double x,
double rgb[3]) VTK_OVERRIDE;
291 void SetNumberOfTableValues(
vtkIdType number);
301 virtual void SetTableValue(
vtkIdType indx,
double rgba[4]);
307 virtual void SetTableValue(
vtkIdType indx,
308 double r,
double g,
double b,
double a=1.0);
320 void GetTableValue(
vtkIdType id,
double rgba[4]);
327 return this->Table->GetPointer(4*
id); };
339 unsigned char *WritePointer(
const vtkIdType id,
const int number);
347 {
return this->GetTableRange(); };
349 { this->SetTableRange(min, max); };
359 static void GetLogRange(
const double range[2],
double log_range[2]);
364 static double ApplyLogScale(
double v,
const double range[2],
365 const double log_range[2]);
394 unsigned char *output,
398 int outputIncrement) VTK_OVERRIDE;
434 double TableRange[2];
436 double SaturationRange[2];
437 double ValueRange[2];
438 double AlphaRange[2];
440 double BelowRangeColor[4];
442 double AboveRangeColor[4];
450 unsigned char NanColorChar[4];
459 void ResizeTableForSpecialColors();
470 this->InsertTime.Modified();
471 return this->Table->WritePointer(4*
id,4*number);
vtkTimeStamp OpaqueFlagBuildTime
vtkTimeStamp SpecialColorsBuildTime
record modification and/or execution time
map scalar values into colors via a lookup table
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.
unsigned char * WritePointer(const vtkIdType id, const int number)
Get pointer to data.
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 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.