 |
VTK
9.1.0
|
Go to the documentation of this file.
163 #ifndef vtkLookupTable_h
164 #define vtkLookupTable_h
166 #include "vtkCommonCoreModule.h"
171 #define VTK_RAMP_LINEAR 0
172 #define VTK_RAMP_SCURVE 1
173 #define VTK_RAMP_SQRT 2
174 #define VTK_SCALE_LINEAR 0
175 #define VTK_SCALE_LOG10 1
250 vtkSetMacro(Ramp,
int);
254 vtkGetMacro(Ramp,
int);
266 vtkGetMacro(Scale,
int);
280 vtkGetVectorMacro(TableRange,
double, 2);
288 vtkSetVector2Macro(HueRange,
double);
289 vtkGetVector2Macro(HueRange,
double);
297 vtkSetVector2Macro(SaturationRange,
double);
298 vtkGetVector2Macro(SaturationRange,
double);
306 vtkSetVector2Macro(ValueRange,
double);
307 vtkGetVector2Macro(ValueRange,
double);
315 vtkSetVector2Macro(AlphaRange,
double);
316 vtkGetVector2Macro(AlphaRange,
double);
324 vtkSetVector4Macro(NanColor,
double);
325 vtkGetVector4Macro(NanColor,
double);
344 vtkSetVector4Macro(BelowRangeColor,
double);
345 vtkGetVector4Macro(BelowRangeColor,
double);
362 vtkSetVector4Macro(AboveRangeColor,
double);
363 vtkGetVector4Macro(AboveRangeColor,
double);
453 unsigned char* WritePointer(
vtkIdType id,
int number);
461 void SetRange(
double min,
double max)
override { this->SetTableRange(min,
max); }
505 int numberOfValues,
int inputIncrement,
int outputFormat)
override;
538 double TableRange[2];
540 double SaturationRange[2];
541 double ValueRange[2];
542 double AlphaRange[2];
544 double BelowRangeColor[4];
546 double AboveRangeColor[4];
554 unsigned char NanColorChar[4];
int IsOpaque(vtkAbstractArray *scalars, int colorMode, int component) override
Return true if all of the values defining the mapping have an opacity equal to 1.
virtual void SetTableValue(vtkIdType indx, const double rgba[4])
Directly load color into lookup table.
void MapScalarsThroughTable2(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat) override
Map a set of scalars through the lookup table.
ValueType * WritePointer(vtkIdType valueIdx, vtkIdType numValues)
Get the address of a particular data index.
vtkTimeStamp OpaqueFlagBuildTime
vtkTypeBool UseAboveRangeColor
vtkIdType GetNumberOfAvailableColors() override
Get the number of available colors for mapping to.
void DeepCopy(vtkScalarsToColors *obj) override
Copy the contents from another LookupTable.
unsigned char * GetNanColorAsUnsignedChars()
Return the NanColor as a pointer to 4 unsigned chars.
void Build() override
Generate lookup table from hue, saturation, value, alpha min/max values.
static const vtkIdType NAN_COLOR_INDEX
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
static vtkLookupTable * New()
Construct with range=[0,1]; and hsv ranges set up for rainbow color table (from red to blue).
void BuildSpecialColors()
Copies the "special" colors into the given table.
vtkLookupTable(int sze=256, int ext=256)
static const vtkIdType ABOVE_RANGE_COLOR_INDEX
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
void ResizeTableForSpecialColors()
Resize the LookupTable to have enough room for the out-of-range colors.
static const vtkIdType BELOW_RANGE_COLOR_INDEX
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
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...
dynamic, self-adjusting array of unsigned char
double GetOpacity(double v) override
Map one value through the lookup table and return the alpha value (the opacity) as a double between 0...
void SetScaleToLog10()
Set the type of scale to use, linear or logarithmic.
void GetIndexedColor(vtkIdType idx, double rgba[4]) override
Return a color given an integer index.
static void GetColorAsUnsignedChars(const double colorIn[4], unsigned char colorOut[4])
Given an RGBA[4] color in the [0,1] range, convert it to RGBA[4] in the [0,255] range.
static double ApplyLogScale(double v, const double range[2], const double log_range[2])
Apply log to value, with appropriate constraints.
void SetRange(const double rng[2]) override
Sets/Gets the range of scalars which will be mapped.
unsigned char * WritePointer(vtkIdType id, int number)
Get pointer to data.
void SetTable(vtkUnsignedCharArray *)
Set/Get the internal table array that is used to map the scalars to colors.
void SetRampToSCurve()
Set the shape of the table ramp to either S-curve, linear, or sqrt.
virtual void ForceBuild()
Force the lookup table to regenerate from hue, saturation, value, and alpha min/max values.
static const vtkIdType NUMBER_OF_SPECIAL_COLORS
Constants for offsets of special colors (e.g., NanColor, BelowRangeColor, AboveRangeColor) from the m...
vtkTimeStamp SpecialColorsBuildTime
#define VTK_SIZEHINT(...)
void Modified()
Set this objects time to the current time.
virtual void SetTableRange(double min, double max)
Set/Get the minimum/maximum scalar values for scalar mapping.
void GetColor(double v, double rgb[3]) override
Map one value through the lookup table and return the color as an RGB[3] array of doubles between 0 a...
virtual void SetTableRange(const double r[2])
Set/Get the minimum/maximum scalar values for scalar mapping.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetScaleToLinear()
Set the type of scale to use, linear or logarithmic.
a simple class to control print indentation
virtual void SetTableValue(vtkIdType indx, double r, double g, double b, double a=1.0)
Directly load color into lookup table.
void SetRampToSQRT()
Set the shape of the table ramp to either S-curve, linear, or sqrt.
Superclass for mapping scalar values to colors.
void SetScale(int scale)
Set the type of scale to use, linear or logarithmic.
double * GetTableValue(vtkIdType indx)
Return an RGBA color value for the given index into the lookup table.
Abstract superclass for all arrays.
vtkIdType GetNumberOfTableValues()
Specify the number of values (i.e., colors) in the lookup table.
const unsigned char * MapValue(double v) override
Map one value through the lookup table, returning an RBGA[4] color.
map scalar values into colors via a lookup table
~vtkLookupTable() override
int Allocate(int sz=256, int ext=256)
Allocate a color table of specified size.
int UsingLogScale() override
This should return 1 if the subclass is using log scale for mapping scalars to colors.
static void GetLogRange(const double range[2], double log_range[2])
Returns the log of range in log_range.
void SetNumberOfTableValues(vtkIdType number)
Specify the number of values (i.e., colors) in the lookup table.
void GetTableValue(vtkIdType indx, double rgba[4])
Return an RGBA color value for the given index into the lookup table.
vtkUnsignedCharArray * Table
void SetRampToLinear()
Set the shape of the table ramp to either S-curve, linear, or sqrt.
unsigned char * GetPointer(vtkIdType id)
Get pointer to color table data.
vtkTypeBool UseBelowRangeColor
double * GetRange() override
Sets/Gets the range of scalars which will be mapped.
virtual vtkIdType GetIndex(double v)
Return the table index associated with a particular value.
int IsOpaque() override
Return true if all of the values defining the mapping have an opacity equal to 1.
void SetRange(double min, double max) override
Sets/Gets the range of scalars which will be mapped.