52 #ifndef vtkScalarsToColors_h 53 #define vtkScalarsToColors_h 55 #include "vtkCommonCoreModule.h" 77 virtual int IsOpaque();
90 virtual void SetRange(
double min,
double max);
92 {this->SetRange(rng[0],rng[1]);}
99 virtual const unsigned char *MapValue(
double v);
105 virtual void GetColor(
double v,
double rgb[3]);
112 {this->GetColor(v,this->RGB);
return this->RGB;}
119 virtual double GetOpacity(
double v);
127 {
double rgb[3]; this->GetColor(x,rgb);
128 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);
171 vtkSetMacro(VectorMode,
int);
172 vtkGetMacro(VectorMode,
int);
173 void SetVectorModeToMagnitude();
174 void SetVectorModeToComponent();
175 void SetVectorModeToRGBColors();
189 vtkSetMacro(VectorComponent,
int);
190 vtkGetMacro(VectorComponent,
int);
201 vtkSetMacro(VectorSize,
int);
202 vtkGetMacro(VectorSize,
int);
212 void MapVectorsThroughTable(
void *input,
unsigned char *output,
213 int inputDataType,
int numberOfValues,
214 int inputIncrement,
int outputFormat,
215 int vectorComponent,
int vectorSize);
217 int inputDataType,
int numberOfValues,
218 int inputIncrement,
int outputFormat)
219 { this->MapVectorsThroughTable(input, output, inputDataType, numberOfValues,
220 inputIncrement, outputFormat, -1, -1); }
231 unsigned char *output,
234 unsigned char *output)
235 {this->MapScalarsThroughTable(scalars,output,
VTK_RGBA);}
237 int inputDataType,
int numberOfValues,
240 {this->MapScalarsThroughTable2(input, output, inputDataType,
241 numberOfValues, inputIncrement, outputFormat);}
248 virtual void MapScalarsThroughTable2(
void *input,
unsigned char *output,
249 int inputDataType,
int numberOfValues,
268 virtual vtkIdType GetNumberOfAvailableColors();
319 virtual void GetAnnotationColor(
const vtkVariant& val,
double rgba[4]);
345 virtual void GetIndexedColor(
vtkIdType i,
double rgba[4]);
353 virtual bool RemoveAnnotation(
vtkVariant value);
358 virtual void ResetAnnotations();
381 template<
typename T>
static 384 return static_cast<unsigned char>(t);
386 template<
typename T>
static 389 *dest = ColorToUChar(t);
410 void MapColorsToColors(
void *input,
unsigned char *output,
411 int inputDataType,
int numberOfValues,
412 int numberOfComponents,
int vectorSize,
428 void MapVectorsToMagnitude(
void *input,
double *output,
429 int inputDataType,
int numberOfValues,
430 int numberOfComponents,
int vectorSize);
442 virtual void UpdateAnnotatedValueMap();
448 class vtkInternalAnnotatedValueMap;
463 unsigned char RGBABytes[4];
467 double InputRange[2];
482 return static_cast<unsigned char>(t*255 + 0.5);
487 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 ...
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.