Go to the documentation of this file.
42 #ifndef vtkColorTransferFunction_h
43 #define vtkColorTransferFunction_h
45 #include "vtkRenderingCoreModule.h"
48 class vtkColorTransferFunctionInternals;
53 #define VTK_CTF_DIVERGING 3
55 #define VTK_CTF_LINEAR 0
56 #define VTK_CTF_LOG10 1
85 double midpoint,
double sharpness );
88 double midpoint,
double sharpness );
98 double x2,
double r2,
double g2,
double b2 );
100 double x2,
double h2,
double s2,
double v2 );
143 vtkGetVector2Macro( Range,
double );
160 void GetTable(
double x1,
double x2,
int n,
double* table );
161 void GetTable(
double x1,
double x2,
int n,
float* table );
162 const unsigned char *
GetTable(
double x1,
double x2,
int n );
185 vtkSetClampMacro( Clamping,
int, 0, 1 );
186 vtkGetMacro( Clamping,
int );
205 vtkGetMacro( ColorSpace,
int );
207 vtkGetMacro(HSVWrap,
int);
220 vtkGetMacro(Scale,
int);
229 vtkSetVector3Macro(NanColor,
double);
230 vtkGetVector3Macro(NanColor,
double);
238 vtkSetVector3Macro(BelowRangeColor,
double);
239 vtkGetVector3Macro(BelowRangeColor,
double);
247 vtkGetMacro(UseBelowRangeColor,
int);
256 vtkSetVector3Macro(AboveRangeColor,
double);
257 vtkGetVector3Macro(AboveRangeColor,
double);
265 vtkGetMacro(UseAboveRangeColor,
int);
289 int inputDataType,
int numberOfValues,
290 int inputIncrement,
int outputIncrement);
298 vtkGetMacro(AllowDuplicateScalars,
int);
358 double BelowRangeColor[3];
368 double AboveRangeColor[3];
388 unsigned char UnsignedCharRGBAValue[4];
void DeepCopy(vtkScalarsToColors *f)
Copy the contents from another object.
double * GetColor(double x)
Returns an RGB color for the specified scalar value.
~vtkColorTransferFunction()
double * GetDataPointer()
Returns a pointer to an array of all node values in an interleaved array with the layout [X1,...
int AddHSVPoint(double x, double h, double s, double v)
static vtkColorTransferFunction * New()
void GetTable(double x1, double x2, int n, float *table)
vtkColorTransferFunction()
virtual vtkIdType GetNumberOfAvailableColors()
Get the number of available colors for mapping to.
virtual unsigned char * MapValue(double v)
Map one value through the lookup table.
record modification and/or execution time
const unsigned char * GetTable(double x1, double x2, int n)
void SetColorSpaceToDiverging()
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 SetRange(double rng[2])
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 HSVWrap
Specify if HSV is wrap or not.
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.
Defines a transfer function for mapping a property to an RGB color value.
virtual void SetRange(double, double)
Set the range of scalars being mapped.
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()
int AddRGBPoint(double x, double r, double g, double b, double midpoint, double sharpness)
double GetRedValue(double x)
Get the color components individually.
double GetBlueValue(double x)
void SetColorSpaceToRGB()
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)
int TableSize
Temporary storage for the size of the table.
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.
int UseAboveRangeColor
Flag indicating whether below-range color should be used.
Superclass for mapping scalar values to colors.
void PrintSelf(ostream &os, vtkIndent indent)
Print method for vtkColorTransferFunction.
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...
int UseBelowRangeColor
Flag indicating whether below-range color should be used.
void RemoveAllPoints()
Remove all points.
double GetGreenValue(double x)
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int ColorSpace
The color space in which interpolation is performed.
int RemovePoint(double x)
void SetColorSpaceToHSV()
int Clamping
Determines the function value outside of defined points Zero = always return 0.0 outside of defined p...
int SetNodeValue(int index, double val[6])
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...
int EstimateMinNumberOfSamples(double const &x1, double const &x2)
Estimates the minimum size of a table such that it would correctly sample this function.
int AllowDuplicateScalars
If on, the same scalar value may have more than one node assigned to it.
void GetColor(double x, double rgb[3])
Map one value through the lookup table and store the color as an RGB array of doubles between 0 and 1...
double * Function
Temporary array to store data from the nodes.
virtual void GetIndexedColor(vtkIdType idx, double rgba[4])
Return a color given an integer index.
#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)
virtual void MapScalarsThroughTable2(void *input, unsigned char *output, int inputDataType, int numberOfValues, int inputIncrement, int outputIncrement)
Map a set of scalars through the lookup table.
double FindMinimumXDistance()
Traverses the nodes to find the minimum distance.