40 #ifndef vtkScalarsToColors_h
41 #define vtkScalarsToColors_h
43 #include "vtkCommonCoreModule.h"
49 VTK_ABI_NAMESPACE_BEGIN
86 virtual
void SetRange(
double min,
double max);
87 virtual
void SetRange(const
double rng[2]) { this->
SetRange(rng[0], rng[1]); }
94 virtual const unsigned char* MapValue(
double v);
100 virtual void GetColor(
double v,
double rgb[3]);
108 this->GetColor(v, this->RGB);
117 virtual double GetOpacity(
double v);
127 this->GetColor(x, rgb);
128 return rgb[0] * 0.30 + rgb[1] * 0.59 + rgb[2] * 0.11;
138 virtual void SetAlpha(
double alpha);
139 vtkGetMacro(Alpha,
double);
174 vtkSetMacro(VectorMode,
int);
175 vtkGetMacro(VectorMode,
int);
176 void SetVectorModeToMagnitude();
177 void SetVectorModeToComponent();
178 void SetVectorModeToRGBColors();
193 vtkSetMacro(VectorComponent,
int);
194 vtkGetMacro(VectorComponent,
int);
205 vtkSetMacro(VectorSize,
int);
206 vtkGetMacro(VectorSize,
int);
217 void MapVectorsThroughTable(VTK_FUTURE_CONST
void* input,
unsigned char* output,
218 int inputDataType,
int numberOfTuples,
int numberOfComponents,
int outputFormat,
219 int vectorComponent,
int vectorSize);
221 int inputDataType,
int numberOfTuples,
int numberOfComponents,
int outputFormat)
223 this->MapVectorsThroughTable(
224 input, output, inputDataType, numberOfTuples, numberOfComponents, outputFormat, -1, -1);
226 void MapVectorsThroughTable(
vtkDataArray* input,
unsigned char* output,
int numberOfTuples,
227 int numberOfComponents,
int vectorComponent,
int vectorSize,
int outputFormat);
229 int numberOfComponents,
int outputFormat)
231 this->MapVectorsThroughTable(
232 input, output, numberOfTuples, numberOfComponents, -1, -1, outputFormat);
245 void MapScalarsThroughTable(
vtkDataArray* scalars,
unsigned char* output,
int outputFormat);
248 this->MapScalarsThroughTable(scalars, output,
VTK_RGBA);
258 virtual void MapScalarsThroughTable(
vtkAbstractArray* input,
unsigned char* output,
259 int numberOfTuples,
int numberOfComponents,
int vectorComponent,
int outputFormat);
260 void MapScalarsThroughTable(VTK_FUTURE_CONST
void* input,
unsigned char* output,
261 int inputDataType,
int numberOfTuples,
int numberOfComponents,
int outputFormat);
263 virtual
void MapScalarsThroughTable2(VTK_FUTURE_CONST
void* input,
unsigned char* output,
264 int inputDataType,
int numberOfTuples,
int numberOfComponents,
int outputFormat);
281 virtual vtkIdType GetNumberOfAvailableColors();
334 virtual void GetAnnotationColor(
const vtkVariant& val,
double rgba[4]);
360 virtual void GetIndexedColor(
vtkIdType i,
double rgba[4]);
373 virtual void ResetAnnotations();
395 template <
typename T>
398 return static_cast<unsigned char>(t);
400 template <
typename T>
403 *dest = ColorToUChar(t);
431 void MapColorsToColors(VTK_FUTURE_CONST
void* input,
unsigned char* output,
int inputDataType,
432 int numberOfTuples,
int numberOfComponents,
int vectorSize,
int outputFormat);
433 void MapColorsToColors(
vtkDataArray* input,
unsigned char* output,
int numberOfTuples,
434 int numberOfComponents,
int vectorComponent,
int vectorSize,
int outputFormat);
451 void MapVectorsToMagnitude(VTK_FUTURE_CONST
void* input,
double* output,
int inputDataType,
452 int numberOfTuples,
int numberOfComponents,
int vectorSize);
453 void MapVectorsToMagnitude(
vtkDataArray* input,
double* output,
int numberOfTuples,
454 int numberOfComponents,
int vectorComponent,
int vectorSize);
467 virtual
void UpdateAnnotatedValueMap();
473 class vtkInternalAnnotatedValueList;
474 vtkInternalAnnotatedValueList* AnnotatedValueList;
485 unsigned char RGBABytes[4];
489 double InputRange[2];
504 double temp = (t * 255.0) + 0.5;
505 return static_cast<unsigned char>(temp);
510 double temp = (t * 255.0) + 0.5;
511 return static_cast<unsigned char>(temp);
515 VTK_ABI_NAMESPACE_END
void MapScalarsThroughTable(vtkDataArray *scalars, unsigned char *output)
Map a set of scalars through the lookup table in a single operation.
Wrapper around std::string to keep symbols short.
void MapVectorsThroughTable(vtkDataArray *input, unsigned char *output, int numberOfTuples, int numberOfComponents, int outputFormat)
Map vectors through the lookup table.
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.
#define VTK_MARSHALMANUAL
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.
#define VTK_SIZEHINT(...)
dynamic, self-adjusting array of unsigned char
double * GetColor(double v)
Map one value through the lookup table and return the color as an RGB array of doubles between 0 and ...
dynamic, self-adjusting array of bits
void MapVectorsThroughTable(VTK_FUTURE_CONST void *input, unsigned char *output, int inputDataType, int numberOfTuples, int numberOfComponents, int outputFormat)
Map vectors through the lookup table.
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...
#define VTK_DEPRECATED_IN_9_7_0(reason)
double GetLuminance(double x)
Map one value through the lookup table and return the luminance 0.3*red + 0.59*green + 0...