 |
VTK
9.1.0
|
Go to the documentation of this file.
145 #ifndef vtkColorTransferFunction_h
146 #define vtkColorTransferFunction_h
148 #include "vtkRenderingCoreModule.h"
151 class vtkColorTransferFunctionInternals;
153 #define VTK_CTF_RGB 0
154 #define VTK_CTF_HSV 1
155 #define VTK_CTF_LAB 2
156 #define VTK_CTF_DIVERGING 3
157 #define VTK_CTF_LAB_CIEDE2000 4
158 #define VTK_CTF_STEP 5
160 #define VTK_CTF_LINEAR 0
161 #define VTK_CTF_LOG10 1
189 int AddRGBPoint(
double x,
double r,
double g,
double b,
double midpoint,
double sharpness);
191 int AddHSVPoint(
double x,
double h,
double s,
double v,
double midpoint,
double sharpness);
201 double x1,
double r1,
double g1,
double b1,
double x2,
double r2,
double g2,
double b2);
203 double x1,
double h1,
double s1,
double v1,
double x2,
double h2,
double s2,
double v2);
248 arg1 = this->
Range[0];
249 arg2 = this->
Range[1];
268 void GetTable(
double x1,
double x2,
int n,
double* table);
269 void GetTable(
double x1,
double x2,
int n,
float* table);
270 const unsigned char*
GetTable(
double x1,
double x2,
int n);
318 vtkGetMacro(ColorSpace,
int);
330 vtkSetMacro(Scale,
int);
333 vtkGetMacro(Scale,
int);
342 vtkSetVector3Macro(NanColor,
double);
343 vtkGetVector3Macro(NanColor,
double);
351 vtkSetMacro(NanOpacity,
double);
352 vtkGetMacro(NanOpacity,
double);
363 this->SetNanColor(r, g, b);
364 this->SetNanOpacity(a);
369 this->SetNanColorRGBA(rgba[0], rgba[1], rgba[2], rgba[3]);
378 vtkSetVector3Macro(BelowRangeColor,
double);
379 vtkGetVector3Macro(BelowRangeColor,
double);
396 vtkSetVector3Macro(AboveRangeColor,
double);
397 vtkGetVector3Macro(AboveRangeColor,
double);
429 int numberOfValues,
int inputIncrement,
int outputIncrement)
override;
502 double BelowRangeColor[3];
512 double AboveRangeColor[3];
532 unsigned char UnsignedCharRGBAValue[4];
~vtkColorTransferFunction() override
void SetColorSpaceToStep()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
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.
virtual void GetRange(double _arg[2])
Returns min and max position of all function points.
double * GetColor(double x)
Returns an RGB color for the specified scalar value.
void SetNanColorRGBA(double rgba[4])
Set the RGBA color to use when a NaN (not a number) is encountered.
double * GetDataPointer()
Returns a pointer to an array of all node values in an interleaved array with the layout [X1,...
vtkTypeBool UseBelowRangeColor
Flag indicating whether below-range color should be used.
void SetRange(double, double) override
Set the range of scalars being mapped.
int AddHSVPoint(double x, double h, double s, double v)
Add/Remove a point to/from the function defined in RGB or HSV Return the index of the point (0 based)...
vtkTypeBool AllowDuplicateScalars
If on, the same scalar value may have more than one node assigned to it.
void SetRange(const double rng[2]) override
Sets/Gets the range of scalars that will be mapped.
static vtkColorTransferFunction * New()
void GetTable(double x1, double x2, int n, float *table)
Fills in a table of n colors mapped from values mapped with even spacing between x1 and x2,...
vtkColorTransferFunction()
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.
record modification and/or execution time
const unsigned char * GetTable(double x1, double x2, int n)
Fills in a table of n colors mapped from values mapped with even spacing between x1 and x2,...
void SetColorSpaceToDiverging()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
void MovePoint(double oldX, double newX)
Moves point from oldX to newX.
vtkColorTransferFunctionInternals * Internal
void GetTable(double x1, double x2, int n, double *table)
Fills in a table of n colors mapped from values mapped with even spacing between x1 and x2,...
void FillFromDataPointer(int n, double *ptr)
Defines the nodes from an array ptr with the layout [X1, R1, G1, B1, X2, R2, G2, B2,...
bool UpdateRange()
Returns true if the range has been changed.
int Scale
The color interpolation scale (linear or logarithmic).
int GetSize()
How many nodes define this function?
void BuildFunctionFromTable(double x1, double x2, int size, double *table)
Construct a color transfer function from a table.
double NanOpacity
The opacity to use for not-a-number.
Defines a transfer function for mapping a property to an RGB color value.
int AddRGBPoint(double x, double r, double g, double b)
Add/Remove a point to/from the function defined in RGB or HSV Return the index of the point (0 based)...
void SetColorSpaceToLab()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
int AddRGBPoint(double x, double r, double g, double b, double midpoint, double sharpness)
Add/Remove a point to/from the function defined in RGB or HSV Return the index of the point (0 based)...
double GetRedValue(double x)
Get the color components individually.
void GetIndexedColor(vtkIdType idx, double rgba[4]) override
Return a color given an integer index.
double GetBlueValue(double x)
Get the color components individually.
#define VTK_CTF_LAB_CIEDE2000
vtkIdType GetNumberOfAvailableColors() override
Get the number of available colors for mapping to.
void SetScaleToLog10()
Set the type of scale to use, linear or logarithmic.
#define VTK_SIZEHINT(...)
void SetColorSpaceToRGB()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
void SetScaleToLinear()
Set the type of scale to use, linear or logarithmic.
int AdjustRange(double range[2])
Remove all points out of the new range, and make sure there is a point at each end of that range.
a simple class to control print indentation
int AddHSVPoint(double x, double h, double s, double v, double midpoint, double sharpness)
Add/Remove a point to/from the function defined in RGB or HSV Return the index of the point (0 based)...
int TableSize
Temporary storage for the size of the table.
vtkTypeBool UseAboveRangeColor
Flag indicating whether below-range color should be used.
void AddRGBSegment(double x1, double r1, double g1, double b1, double x2, double r2, double g2, double b2)
Add two points to the function and remove all the points between them.
Superclass for mapping scalar values to colors.
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 RemoveAllPoints()
Remove all points.
double GetGreenValue(double x)
Get the color components individually.
void DeepCopy(vtkScalarsToColors *f) override
Copy the contents from another object.
int ColorSpace
The color space in which interpolation is performed.
void GetColor(double x, double rgb[3]) override
Map one value through the lookup table and store the color as an RGB array of doubles between 0 and 1...
double * GetRange() override
Returns min and max position of all function points.
vtkTypeBool Clamping
Determines the function value outside of defined points Zero = always return 0.0 outside of defined p...
const unsigned char * MapValue(double v) override
Map one value through the lookup table.
int RemovePoint(double x)
Add/Remove a point to/from the function defined in RGB or HSV Return the index of the point (0 based)...
void SetColorSpaceToHSV()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
int SetNodeValue(int index, double val[6])
For the node specified by index, set/get the location (X), R, G, and B values, midpoint,...
int GetNodeValue(int index, double val[6])
For the node specified by index, set/get the location (X), R, G, and B values, midpoint,...
void SortAndUpdateRange()
Internal method to sort the vector and update the Range whenever a node is added, edited or removed I...
void MapScalarsThroughTable2(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputIncrement) override
Map a set of scalars through the lookup table.
int EstimateMinNumberOfSamples(double const &x1, double const &x2)
Estimates the minimum size of a table such that it would correctly sample this function.
void SetColorSpaceToLabCIEDE2000()
Set/Get the color space used for interpolation: RGB, HSV, CIELAB, Diverging or Step.
virtual void GetRange(double &arg1, double &arg2)
Returns min and max position of all function points.
double * Function
Temporary array to store data from the nodes.
#define VTK_CTF_DIVERGING
void ShallowCopy(vtkColorTransferFunction *f)
void AddHSVSegment(double x1, double h1, double s1, double v1, double x2, double h2, double s2, double v2)
Add two points to the function and remove all the points between them.
vtkFrustumSelector is a vtkSelector that selects elements based on whether they are inside or interse...
void PrintSelf(ostream &os, vtkIndent indent) override
Print method for vtkColorTransferFunction.
vtkTypeBool HSVWrap
Specify if HSV is wrap or not.
double FindMinimumXDistance()
Traverses the nodes to find the minimum distance.