46 #ifndef vtkScalarsToColors_h 47 #define vtkScalarsToColors_h 49 #include "vtkCommonCoreModule.h" 71 virtual int IsOpaque();
84 virtual
void SetRange(
double min,
double max);
85 virtual
void SetRange(const
double rng[2])
86 {this->SetRange(rng[0],rng[1]);}
93 virtual const unsigned char *MapValue(
double v);
99 virtual void GetColor(
double v,
double rgb[3]);
106 {this->GetColor(v,this->RGB);
return this->RGB;}
113 virtual double GetOpacity(
double v);
121 {
double rgb[3]; this->GetColor(x,rgb);
122 return static_cast<double>(rgb[0]*0.30 + rgb[1]*0.59 + rgb[2]*0.11);}
131 virtual void SetAlpha(
double alpha);
132 vtkGetMacro(Alpha,
double);
165 vtkSetMacro(VectorMode,
int);
166 vtkGetMacro(VectorMode,
int);
167 void SetVectorModeToMagnitude();
168 void SetVectorModeToComponent();
169 void SetVectorModeToRGBColors();
183 vtkSetMacro(VectorComponent,
int);
184 vtkGetMacro(VectorComponent,
int);
195 vtkSetMacro(VectorSize,
int);
196 vtkGetMacro(VectorSize,
int);
206 void MapVectorsThroughTable(
void *input,
unsigned char *output,
207 int inputDataType,
int numberOfValues,
208 int inputIncrement,
int outputFormat,
209 int vectorComponent,
int vectorSize);
211 int inputDataType,
int numberOfValues,
212 int inputIncrement,
int outputFormat)
213 { this->MapVectorsThroughTable(input, output, inputDataType, numberOfValues,
214 inputIncrement, outputFormat, -1, -1); }
225 unsigned char *output,
228 unsigned char *output)
229 {this->MapScalarsThroughTable(scalars,output,
VTK_RGBA);}
231 int inputDataType,
int numberOfValues,
234 {this->MapScalarsThroughTable2(input, output, inputDataType,
235 numberOfValues, inputIncrement, outputFormat);}
242 virtual void MapScalarsThroughTable2(
void *input,
unsigned char *output,
243 int inputDataType,
int numberOfValues,
262 virtual vtkIdType GetNumberOfAvailableColors();
313 virtual void GetAnnotationColor(
const vtkVariant& val,
double rgba[4]);
339 virtual void GetIndexedColor(
vtkIdType i,
double rgba[4]);
352 virtual void ResetAnnotations();
375 template<
typename T>
static 378 return static_cast<unsigned char>(t);
380 template<
typename T>
static 383 *dest = ColorToUChar(t);
404 void MapColorsToColors(
void *input,
unsigned char *output,
405 int inputDataType,
int numberOfValues,
406 int numberOfComponents,
int vectorSize,
422 void MapVectorsToMagnitude(
void *input,
double *output,
423 int inputDataType,
int numberOfValues,
424 int numberOfComponents,
int vectorSize);
436 virtual void UpdateAnnotatedValueMap();
442 class vtkInternalAnnotatedValueMap;
457 unsigned char RGBABytes[4];
461 double InputRange[2];
476 return static_cast<unsigned char>(t*255 + 0.5);
481 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.
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 ...
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...
vtkInternalAnnotatedValueMap * AnnotatedValueMap
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.