40 #ifndef vtkScalarsToColors_h
41 #define vtkScalarsToColors_h
43 #include "vtkCommonCoreModule.h"
47 VTK_ABI_NAMESPACE_BEGIN
85 virtual
void SetRange(
double min,
double max);
86 virtual
void SetRange(const
double rng[2]) { this->
SetRange(rng[0], rng[1]); }
93 virtual const unsigned char* MapValue(
double v);
99 virtual void GetColor(
double v,
double rgb[3]);
107 this->GetColor(v, this->RGB);
116 virtual double GetOpacity(
double v);
126 this->GetColor(x, rgb);
127 return static_cast<double>(rgb[0] * 0.30 + rgb[1] * 0.59 + rgb[2] * 0.11);
137 virtual void SetAlpha(
double alpha);
138 vtkGetMacro(Alpha,
double);
173 vtkSetMacro(VectorMode,
int);
174 vtkGetMacro(VectorMode,
int);
175 void SetVectorModeToMagnitude();
176 void SetVectorModeToComponent();
177 void SetVectorModeToRGBColors();
192 vtkSetMacro(VectorComponent,
int);
193 vtkGetMacro(VectorComponent,
int);
204 vtkSetMacro(VectorSize,
int);
205 vtkGetMacro(VectorSize,
int);
215 void MapVectorsThroughTable(
void* input,
unsigned char* output,
int inputDataType,
216 int numberOfValues,
int inputIncrement,
int outputFormat,
int vectorComponent,
int vectorSize);
218 int numberOfValues,
int inputIncrement,
int outputFormat)
220 this->MapVectorsThroughTable(
221 input, output, inputDataType, numberOfValues, inputIncrement, outputFormat, -1, -1);
232 void MapScalarsThroughTable(
vtkDataArray* scalars,
unsigned char* output,
int outputFormat);
235 this->MapScalarsThroughTable(scalars, output,
VTK_RGBA);
238 int numberOfValues,
int inputIncrement,
int outputFormat)
240 this->MapScalarsThroughTable2(
241 input, output, inputDataType, numberOfValues, inputIncrement, outputFormat);
249 virtual void MapScalarsThroughTable2(
void* input,
unsigned char* output,
int inputDataType,
250 int numberOfValues,
int inputIncrement,
int outputFormat);
266 virtual vtkIdType GetNumberOfAvailableColors();
319 virtual void GetAnnotationColor(
const vtkVariant& val,
double rgba[4]);
345 virtual void GetIndexedColor(
vtkIdType i,
double rgba[4]);
358 virtual void ResetAnnotations();
380 template <
typename T>
383 return static_cast<unsigned char>(t);
385 template <
typename T>
388 *dest = ColorToUChar(t);
407 void MapColorsToColors(
void* input,
unsigned char* output,
int inputDataType,
int numberOfValues,
408 int numberOfComponents,
int vectorSize,
int outputFormat);
422 void MapVectorsToMagnitude(
void* input,
double* output,
int inputDataType,
int numberOfValues,
423 int numberOfComponents,
int vectorSize);
435 virtual void UpdateAnnotatedValueMap();
441 class vtkInternalAnnotatedValueList;
453 #if !defined(VTK_LEGACY_REMOVE)
458 unsigned char RGBABytes[4];
462 double InputRange[2];
477 double temp = (t * 255.0) + 0.5;
478 return static_cast<unsigned char>(temp);
483 double temp = (t * 255.0) + 0.5;
484 return static_cast<unsigned char>(temp);
488 VTK_ABI_NAMESPACE_END
void MapScalarsThroughTable(vtkDataArray *scalars, unsigned char *output)
Wrapper around std::string to keep symbols short.
static void ColorToUChar(T t, unsigned char *dest)
Converts a color from numeric type T to uchar.
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Abstract superclass for all arrays.
a vtkAbstractArray subclass for strings
A type representing the union of many types.
virtual void SetRange(const double rng[2])
Sets/Gets the range of scalars that will be mapped.
Superclass for mapping scalar values to colors.
a simple class to control print indentation
abstract superclass for arrays of numeric data
virtual vtkTypeBool UsingLogScale()
This should return 1 if the subclass is using log scale for mapping scalars to colors.
static unsigned char ColorToUChar(T t)
Converts a color from numeric type T to uchar.
void MapScalarsThroughTable(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
#define VTK_SIZEHINT(...)
dynamic, self-adjusting array of unsigned char
vtkTypeBool IndexedLookup
double * GetColor(double v)
Map one value through the lookup table and return the color as an RGB array of doubles between 0 and ...
vtkInternalAnnotatedValueList * AnnotatedValueList
vtkStringArray * Annotations
void MapVectorsThroughTable(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
virtual void Build()
Perform any processing required (if any) before processing scalars.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkAbstractArray * AnnotatedValues
double GetLuminance(double x)
Map one value through the lookup table and return the luminance 0.3*red + 0.59*green + 0...