30 #ifndef vtkColorTransferFunction_h
31 #define vtkColorTransferFunction_h
33 #include "vtkRenderingCoreModule.h"
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkColorTransferFunctionInternals;
43 #define VTK_CTF_DIVERGING 3
44 #define VTK_CTF_LAB_CIEDE2000 4
45 #define VTK_CTF_STEP 5
47 #define VTK_CTF_LINEAR 0
48 #define VTK_CTF_LOG10 1
75 int AddRGBPoint(
double x,
double r,
double g,
double b);
76 int AddRGBPoint(
double x,
double r,
double g,
double b,
double midpoint,
double sharpness);
79 int AddHSVPoint(
double x,
double h,
double s,
double v);
80 int AddHSVPoint(
double x,
double h,
double s,
double v,
double midpoint,
double sharpness);
81 int RemovePoint(
double x);
90 double x1,
double r1,
double g1,
double b1,
double x2,
double r2,
double g2,
double b2);
92 double x1,
double h1,
double s1,
double v1,
double x2,
double h2,
double s2,
double v2);
98 void RemoveAllPoints();
104 void GetColor(
double x,
double rgb[3])
override;
110 double GetRedValue(
double x);
111 double GetGreenValue(
double x);
112 double GetBlueValue(
double x);
121 int GetNodeValue(
int index,
double val[6]);
122 int SetNodeValue(
int index,
double val[6]);
128 const unsigned char*
MapValue(
double v)
override;
137 arg1 = this->
Range[0];
138 arg2 = this->
Range[1];
148 int AdjustRange(
double range[2]);
157 void GetTable(
double x1,
double x2,
int n,
double* table);
158 void GetTable(
double x1,
double x2,
int n,
float* table);
159 const unsigned char* GetTable(
double x1,
double x2,
int n);
171 void BuildFunctionFromTable(
double x1,
double x2,
int size,
double* table);
207 vtkGetMacro(ColorSpace,
int);
219 vtkSetMacro(Scale,
int);
222 vtkGetMacro(Scale,
int);
231 vtkSetVector3Macro(NanColor,
double);
232 vtkGetVector3Macro(NanColor,
double);
240 vtkSetMacro(NanOpacity,
double);
241 vtkGetMacro(NanOpacity,
double);
252 this->SetNanColor(r, g, b);
253 this->SetNanOpacity(a);
258 this->SetNanColorRGBA(rgba[0], rgba[1], rgba[2], rgba[3]);
267 vtkSetVector3Macro(BelowRangeColor,
double);
268 vtkGetVector3Macro(BelowRangeColor,
double);
285 vtkSetVector3Macro(AboveRangeColor,
double);
286 vtkGetVector3Macro(AboveRangeColor,
double);
305 double* GetDataPointer();
312 void FillFromDataPointer(
int n,
double* ptr);
318 int numberOfValues,
int inputIncrement,
int outputIncrement)
override;
327 vtkBooleanMacro(AllowDuplicateScalars,
vtkTypeBool);
347 int EstimateMinNumberOfSamples(
double const& x1,
double const& x2);
391 double BelowRangeColor[3];
401 double AboveRangeColor[3];
421 unsigned char UnsignedCharRGBAValue[4];
449 void SortAndUpdateRange();
461 void MovePoint(
double oldX,
double newX);
466 double FindMinimumXDistance();
473 VTK_ABI_NAMESPACE_END
virtual void SetNanColorRGBA(double r, double g, double b, double a)
Set the RGBA color to use when a NaN (not a number) is encountered.
double NanOpacity
The opacity to use for not-a-number.
int Scale
The color interpolation scale (linear or logarithmic).
record modification and/or execution time
void SetScaleToLinear()
Set the type of scale to use, linear or logarithmic.
virtual void MapScalarsThroughTable2(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputFormat)
An internal method typically not used in applications.
void SetRange(double, double) override
Set the range of scalars being mapped.
vtkColorTransferFunctionInternals * Internal
dynamic, self-adjusting array of double
virtual const unsigned char * MapValue(double v)
Map one value through the lookup table and return a color defined as an RGBA unsigned char tuple (4 b...
Superclass for mapping scalar values to colors.
auto Range(IterablePtr iterable, Options &&...opts) -> typename detail::IterableTraits< typename detail::StripPointers< IterablePtr >::type >::RangeType
Generate an iterable STL proxy object for a VTK container.
static vtkScalarsToColors * New()
double * GetColor(double x)
Returns an RGB color for the specified scalar value.
void SetColorSpaceToLab()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
a simple class to control print indentation
virtual void GetColor(double v, double rgb[3])
Map one value through the lookup table and store the color as an RGB array of doubles between 0 and 1...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool HSVWrap
Specify if HSV is wrap or not.
void SetColorSpaceToRGB()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
virtual void GetRange(double _arg[2])
Returns min and max position of all function points.
vtkTypeBool AllowDuplicateScalars
If on, the same scalar value may have more than one node assigned to it.
vtkTypeBool UseBelowRangeColor
Flag indicating whether below-range color should be used.
#define VTK_SIZEHINT(...)
double * GetRange() override
Returns min and max position of all function points.
vtkTypeBool UseAboveRangeColor
Flag indicating whether below-range color should be used.
virtual void GetRange(double &arg1, double &arg2)
Returns min and max position of all function points.
void SetColorSpaceToDiverging()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
#define VTK_CTF_LAB_CIEDE2000
Defines a transfer function for mapping a property to an RGB color value.
virtual void GetIndexedColor(vtkIdType i, double rgba[4])
Get the "indexed color" assigned to an index.
int TableSize
Temporary storage for the size of the table.
void SetColorSpaceToStep()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
void UpdateRange(A &min0, A &max0, const A &value, typename std::enable_if<!std::is_floating_point< A >::value >::type *=nullptr)
vtkTypeBool Clamping
Determines the function value outside of defined points Zero = always return 0.0 outside of defined p...
double * Function
Temporary array to store data from the nodes.
void SetScaleToLog10()
Set the type of scale to use, linear or logarithmic.
virtual void DeepCopy(vtkScalarsToColors *o)
Copy the contents from another object.
void SetColorSpaceToHSV()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
void SetRange(const double rng[2]) override
Sets/Gets the range of scalars that will be mapped.
#define VTK_CTF_DIVERGING
int ColorSpace
The color space in which interpolation is performed.
virtual vtkIdType GetNumberOfAvailableColors()
Get the number of available colors for mapping to.
void SetColorSpaceToLabCIEDE2000()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
void SetNanColorRGBA(double rgba[4])
Set the RGBA color to use when a NaN (not a number) is encountered.