52 #ifndef vtkScalarsToColors_h
53 #define vtkScalarsToColors_h
55 #include "vtkCommonCoreModule.h"
79 virtual int IsOpaque();
96 virtual
void SetRange(
double min,
double max);
97 virtual
void SetRange(const
double rng[2]) { this->
SetRange(rng[0], rng[1]); }
104 virtual const unsigned char* MapValue(
double v);
110 virtual void GetColor(
double v,
double rgb[3]);
118 this->GetColor(v, this->RGB);
127 virtual double GetOpacity(
double v);
137 this->GetColor(x, rgb);
138 return static_cast<double>(rgb[0] * 0.30 + rgb[1] * 0.59 + rgb[2] * 0.11);
148 virtual void SetAlpha(
double alpha);
149 vtkGetMacro(Alpha,
double);
184 vtkSetMacro(VectorMode,
int);
185 vtkGetMacro(VectorMode,
int);
186 void SetVectorModeToMagnitude();
187 void SetVectorModeToComponent();
188 void SetVectorModeToRGBColors();
203 vtkSetMacro(VectorComponent,
int);
204 vtkGetMacro(VectorComponent,
int);
215 vtkSetMacro(VectorSize,
int);
216 vtkGetMacro(VectorSize,
int);
226 void MapVectorsThroughTable(
void* input,
unsigned char* output,
int inputDataType,
227 int numberOfValues,
int inputIncrement,
int outputFormat,
int vectorComponent,
int vectorSize);
229 int numberOfValues,
int inputIncrement,
int outputFormat)
231 this->MapVectorsThroughTable(
232 input, output, inputDataType, numberOfValues, inputIncrement, outputFormat, -1, -1);
243 void MapScalarsThroughTable(
vtkDataArray* scalars,
unsigned char* output,
int outputFormat);
246 this->MapScalarsThroughTable(scalars, output,
VTK_RGBA);
249 int numberOfValues,
int inputIncrement,
int outputFormat)
251 this->MapScalarsThroughTable2(
252 input, output, inputDataType, numberOfValues, inputIncrement, outputFormat);
260 virtual void MapScalarsThroughTable2(
void* input,
unsigned char* output,
int inputDataType,
261 int numberOfValues,
int inputIncrement,
int outputFormat);
277 virtual vtkIdType GetNumberOfAvailableColors();
328 virtual void GetAnnotationColor(
const vtkVariant& val,
double rgba[4]);
354 virtual void GetIndexedColor(
vtkIdType i,
double rgba[4]);
367 virtual void ResetAnnotations();
389 template <
typename T>
392 return static_cast<unsigned char>(t);
394 template <
typename T>
397 *dest = ColorToUChar(t);
416 void MapColorsToColors(
void* input,
unsigned char* output,
int inputDataType,
int numberOfValues,
417 int numberOfComponents,
int vectorSize,
int outputFormat);
430 void MapVectorsToMagnitude(
void* input,
double* output,
int inputDataType,
int numberOfValues,
431 int numberOfComponents,
int vectorSize);
443 virtual void UpdateAnnotatedValueMap();
449 class vtkInternalAnnotatedValueList;
464 unsigned char RGBABytes[4];
468 double InputRange[2];
483 return static_cast<unsigned char>(t * 255 + 0.5);
488 return static_cast<unsigned char>(t * 255 + 0.5);
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 atomic 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
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...
virtual int UsingLogScale()
This should return 1 is the subclass is using log scale for mapping scalars to colors.