48 #ifndef vtkScalarsToColors_h
49 #define vtkScalarsToColors_h
71 virtual int IsOpaque();
79 virtual double *GetRange();
80 virtual void SetRange(
double min,
double max);
82 {this->SetRange(rng[0],rng[1]);}
87 virtual unsigned char *MapValue(
double v);
91 virtual void GetColor(
double v,
double rgb[3]);
97 {this->GetColor(v,this->RGB);
return this->RGB;}
103 virtual double GetOpacity(
double v);
110 {
double rgb[3]; this->GetColor(x,rgb);
111 return static_cast<double>(rgb[0]*0.30 + rgb[1]*0.59 + rgb[2]*0.11);}
119 virtual void SetAlpha(
double alpha);
120 vtkGetMacro(Alpha,
double);
148 vtkSetMacro(VectorMode,
int);
149 vtkGetMacro(VectorMode,
int);
150 void SetVectorModeToMagnitude();
151 void SetVectorModeToComponent();
152 void SetVectorModeToRGBColors();
167 vtkSetMacro(VectorComponent,
int);
168 vtkGetMacro(VectorComponent,
int);
177 vtkSetMacro(VectorSize,
int);
178 vtkGetMacro(VectorSize,
int);
187 void MapVectorsThroughTable(
void *input,
unsigned char *output,
188 int inputDataType,
int numberOfValues,
189 int inputIncrement,
int outputFormat,
190 int vectorComponent,
int vectorSize);
192 int inputDataType,
int numberOfValues,
193 int inputIncrement,
int outputFormat)
194 { this->MapVectorsThroughTable(input, output, inputDataType, numberOfValues,
195 inputIncrement, outputFormat, -1, -1); }
206 unsigned char *output,
209 unsigned char *output)
210 {this->MapScalarsThroughTable(scalars,output,
VTK_RGBA);}
212 int inputDataType,
int numberOfValues,
215 {this->MapScalarsThroughTable2(input, output, inputDataType,
216 numberOfValues, inputIncrement, outputFormat);}
223 virtual void MapScalarsThroughTable2(
void *input,
unsigned char *output,
224 int inputDataType,
int numberOfValues,
240 virtual vtkIdType GetNumberOfAvailableColors();
280 virtual void GetAnnotationColor(
const vtkVariant& val,
double rgba[4]);
300 virtual void GetIndexedColor(
vtkIdType i,
double rgba[4]);
308 virtual void ResetAnnotations();
316 vtkSetMacro(IndexedLookup,
int);
317 vtkGetMacro(IndexedLookup,
int);
318 vtkBooleanMacro(IndexedLookup,
int);
326 template<
typename T>
static
331 template<
typename T>
static
334 *dest = ColorToUChar(t);
354 void MapColorsToColors(
void *input,
unsigned char *output,
355 int inputDataType,
int numberOfValues,
356 int numberOfComponents,
int vectorSize,
372 void MapVectorsToMagnitude(
void *input,
double *output,
373 int inputDataType,
int numberOfValues,
374 int numberOfComponents,
int vectorSize);
383 virtual void UpdateAnnotatedValueMap();
389 class vtkInternalAnnotatedValueMap;
404 unsigned char RGBABytes[4];
408 double InputRange[2];
421 return static_cast<unsigned char>(t*255 + 0.5);
426 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)
abstract base class for most VTK objects
Abstract superclass for all arrays.
void SetRange(double rng[2])
#define VTKCOMMONCORE_EXPORT
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
a vtkAbstractArray subclass for strings
A atomic type representing the union of many types.
Superclass for mapping scalar values to colors.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
abstract superclass for arrays of numeric data
static unsigned char ColorToUChar(T t)
void MapScalarsThroughTable(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
dynamic, self-adjusting array of unsigned char
double * GetColor(double v)
vtkStringArray * Annotations
void MapVectorsThroughTable(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
vtkInternalAnnotatedValueMap * AnnotatedValueMap
vtkAbstractArray * AnnotatedValues
double GetLuminance(double x)
virtual int UsingLogScale()