IGLib
1.5
The IGLib base library for development of numerical, technical and business applications.
|
Public Member Functions | |
abstract double | FromReference (double referenceValue) |
Transforms the specified value from reference domain (interval [0,1]) to actual domain. More... | |
abstract double | ToReference (double actualValue) |
Transforms the specified value from actual domain to reference domain (interval [0,1]). More... | |
virtual color | GetColor (double value) |
Returns the color from the current collor scale that corresponds to the specified value. More... | |
virtual color | GetReferenceColor (double referenceValue) |
Returns the color from the current color scale that corresponds to the specified value in the reference domain (interval [0,1]). More... | |
abstract color | GetContinuousReferenceColor (double referenceValue) |
Returns the CONTINUOUS color from the current color scale that corresponds to the specified value in the REFERENCE domain (interval [0, 1]). More... | |
virtual color | GetContinuousColor (double value) |
Returns the CONTINUOUS color from the current color scale that corresponds to the specified value. More... | |
abstract double | GetReferenceCellValue (int cellIndex) |
Returns the reference value (in the interval [0, 1]) corresponding to the specified cell in the discrete color map. This value is used to obtain the uniform (discrete) color of the cell by the methods that produces continuous scale colors (continuous methods are usually basis for scale definitions). More... | |
virtual double | GetCellValue (int cellIndex) |
Returns the value corresponding to the specified cell in the discrete color map. This value is used to obtain the uniform (discrete) color of the cell by the methods that produces continuous scale colors (continuous methods are usually basis for scale definitions). More... | |
virtual color | GetCellColor (int cellIndex) |
Returns the (discrete) color corresponding to the specified cell index. If the index is out of range then the lowest or the highest cell color is returned, dependent on whether the value is smaller than lower bound or greater than upper bound. More... | |
abstract int | GetReferenceCellIndex (double referenceValue) |
Retuns index of the cell of the discrete color scale that corresponds to the specified value in the reference domain (interval [0, 1]). More... | |
virtual int | GetCellIndex (double value) |
Retuns index of the cell of the discrete color scale that corresponds to the specified value (in the actusl domain). More... | |
virtual color | GetDiscreteReferenceColor (double referenceValue) |
Returns a color from the DISCRETE color scale represented by the current object that corresponds to he specified value in the REFERENCE domain (interval [0, 1]). More... | |
virtual color | GetDiscreteColor (double value) |
Returns a color from the DISCRETE color scale represented by the current object that corresponds to he specified value (in the actual domain). More... | |
Static Public Member Functions | |
static ColorScale | Create (double minValue, double maxValue, params color[] scaleColors) |
Creates and returns a continuous color scale that runs through the specified colors. More... | |
static ColorScale | Create (double minValue, double maxValue, int numCells, params color[] scaleColors) |
Creates and returns a discrete color scale that runs through the specified colors. More... | |
static ColorScale | CreateDefault (double minValue, double maxValue) |
Creates and returns a continuous color scale that runs from blue through red till yellow color. More... | |
static ColorScale | CreateDefault (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that runs from blue through red till yellow color. More... | |
static ColorScale | CreateRainbowFull (double minValue, double maxValue) |
Creates and returns a continuous color scale that runs from violet till red color and passes rainbow colors in their natural order (red-orange-yellow-green-blue-indigo-violet). More... | |
static ColorScale | CreateRainbowFull (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that runs from violet till red color and passes rainbow colors in their natural order (red-orange-yellow-green-blue-indigo-violet). More... | |
static ColorScale | CreateRainbow (double minValue, double maxValue) |
Creates and returns a continuous color scale that runs from violet till red color and passes rainbow colors in their natural order (red-orange-yellow-green-blue-violet). More... | |
static ColorScale | CreateRainbow (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that runs from violet till red color and passes rainbow colors in their natural order (red-orange-yellow-green-blue-indigo-violet). More... | |
static ColorScale | CreateColorBlind (double minValue, double maxValue) |
Creates and returns a continuous color scale that is adapted to color blind people in general. More... | |
static ColorScale | CreateColorBlind (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that is adapted to color blind people in general. More... | |
static ColorScale | CreateColorBlindProtanopia (double minValue, double maxValue) |
Creates and returns a continuous color scale that is adapted to people with protanopia. More... | |
static ColorScale | CreateColorBlindProtanopia (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that is adapted to people with protanopia. More... | |
static ColorScale | CreateColorBlindDeuteranopia (double minValue, double maxValue) |
Creates and returns a continuous color scale that is adapted to people with deuteranopia. More... | |
static ColorScale | CreateColorBlindDeuteranopia (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that is adapted to people with deuteranopia. More... | |
static ColorScale | CreateColorBlindTritanopia (double minValue, double maxValue) |
Creates and returns a continuous color scale that is adapted to people with tritanopia. More... | |
static ColorScale | CreateColorBlindTritanopia (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that is adapted to people with tritanopia. More... | |
static ColorScale | CreateGray (double minValue, double maxValue) |
Creates and returns a continuous color scale with various hues of gray. More... | |
static ColorScale | CreateGray (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale with various hues of gray. More... | |
static ColorScale | CreateBlueRed (double minValue, double maxValue) |
Creates and returns a continuous color scale that ranges from dark blue to red. More... | |
static ColorScale | CreateBlueRed (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that ranges from dark blue to red. More... | |
static ColorScale | CreateBlueYellow (double minValue, double maxValue) |
Creates and returns a continuous color scale that ranges from dark blue to yellow. More... | |
static ColorScale | CreateBlueYellow (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that ranges from dark blue to yellow. More... | |
static ColorScale | CreateBlueRedYellow (double minValue, double maxValue) |
Creates and returns a continuous color scale that runs from blue through red till yellow color. More... | |
static ColorScale | CreateBlueRedYellow (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that runs from blue through red till yellow color. More... | |
static IColorScale | CreateBlueGreenYellow (double minValue, double maxValue) |
Creates and returns a continuous color scale that runs from blue through green till red color. More... | |
static ColorScale | CreateBlueGreenRed (double minValue, double maxValue, int numCells) |
Creates and returns a discrete color scale that runs from blue through green till red color. More... | |
Protected Attributes | |
int | _numCells = 0 |
Properties | |
bool | IsDiscrete [get, protected set] |
Gets the flag indicating whether the color scale is discrete (with a finite number of possible colors, as opposed to continuous). More... | |
int | NumCells [get, set] |
Number of cells in discrete color scale. More... | |
![]() | |
bool | IsDiscrete [get] |
Gets the flag indicating whether the color scale is discrete (with a finite number of possible colors, as opposed to continuous). More... | |
int | NumCells [get, set] |
Number of cells in discrete color scale. More... | |
Private Attributes | |
bool | _isDiscrete = false |
Color scale.
Provides mapping from scalar values to colors, defining continuous or discrete color scales.
NOT thread safe.
Mapping from scalar value to color is usually defined continuously on the reference interval of values ranging from 0 to 1.
This class was initially used in GUI building for fadeouts, but has now broader applicaton and is used in all kins of graphical applications. This is also the reason that it is placed in the IG.Lib namespace. Discrete color values are added in 2011 for needs in graphic applications.
$A Igor Jul08 Oct11;
|
pure virtual |
Transforms the specified value from reference domain (interval [0,1]) to actual domain.
referenceValue | Value in the reference domain. |
Implements IG.Lib.IColorScale.
Implemented in IG.Lib.ColorScale.
|
pure virtual |
Transforms the specified value from actual domain to reference domain (interval [0,1]).
actualValue | Value in the actual domain. |
Implements IG.Lib.IColorScale.
Implemented in IG.Lib.ColorScale.
|
inlinevirtual |
Returns the color from the current collor scale that corresponds to the specified value.
Scale can be continuous or discrete (in the latter case IsDiscrete is true).
To get a color from the scale corresponding to a value in the reference domain [0,1], use the GetReferenceColor method instead.
value | Value for which the corresponding color is returned. |
Implements IG.Lib.IColorScale.
Referenced by IG.Gr3d.TestVtkGraphicBase.ColorBar(), IG.Gr3d.VtkCurvePlot.Create(), IG.Gr3d.VtkSurfacePlot.Create(), IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridContours(), IG.Gr.PlotterZedGraph.ExempleSinePlots(), and IG.Gr3d.UtilVtk.LookUpTableRange().
|
inlinevirtual |
Returns the color from the current color scale that corresponds to the specified value in the reference domain (interval [0,1]).
Scale can be continuous or discrete (in the latter case IsDiscrete is true).
referenceValue | Value from the interval [0, 1] (the reference domain) for which the corresponding color is returned. |
Implements IG.Lib.IColorScale.
|
pure virtual |
Returns the CONTINUOUS color from the current color scale that corresponds to the specified value in the REFERENCE domain (interval [0, 1]).
Scale can be continuous or discrete (in the latter case IsDiscrete is true).
referenceValue | Value in the reference domain (interval [0, 1]) for which the corresponding color is returned. |
Implements IG.Lib.IColorScale.
Implemented in IG.Lib.ColorScale.
|
inlinevirtual |
Returns the CONTINUOUS color from the current color scale that corresponds to the specified value.
Scale can be continuous or discrete (in the latter case IsDiscrete is true).
value | Value (in the actual domain) for which the corresponding color is returned. |
Implements IG.Lib.IColorScale.
|
pure virtual |
Returns the reference value (in the interval [0, 1]) corresponding to the specified cell in the discrete color map. This value is used to obtain the uniform (discrete) color of the cell by the methods that produces continuous scale colors (continuous methods are usually basis for scale definitions).
cellIndex | Index of the cell for which the corresponding characteristic value (usually in the middle of the cell interval) is returned. |
Implements IG.Lib.IColorScale.
Implemented in IG.Lib.ColorScale.
|
inlinevirtual |
Returns the value corresponding to the specified cell in the discrete color map. This value is used to obtain the uniform (discrete) color of the cell by the methods that produces continuous scale colors (continuous methods are usually basis for scale definitions).
cellIndex | Index of the cell for which the corresponding characteristic value (usually in the middle of the cell interval) is returned. |
Implements IG.Lib.IColorScale.
|
inlinevirtual |
Returns the (discrete) color corresponding to the specified cell index. If the index is out of range then the lowest or the highest cell color is returned, dependent on whether the value is smaller than lower bound or greater than upper bound.
cellIndex | Index of the discrete cell for which color is returned. |
Implements IG.Lib.IColorScale.
|
pure virtual |
Retuns index of the cell of the discrete color scale that corresponds to the specified value in the reference domain (interval [0, 1]).
referenceValue | Value in the reference domain (interval [0, 1]) for wihich index of the discrete cell of the color scale is returned. |
Implements IG.Lib.IColorScale.
Implemented in IG.Lib.ColorScale.
|
inlinevirtual |
Retuns index of the cell of the discrete color scale that corresponds to the specified value (in the actusl domain).
value | Value in the reference domain (interval [0, 1]) for wihich index of the discrete cell of the color scale is returned. |
Implements IG.Lib.IColorScale.
|
inlinevirtual |
Returns a color from the DISCRETE color scale represented by the current object that corresponds to he specified value in the REFERENCE domain (interval [0, 1]).
referenceValue | Value in the reference domain (interval [0, 1]) for which the corresponding color from the discrete color scale is returned. |
Implements IG.Lib.IColorScale.
|
inlinevirtual |
Returns a color from the DISCRETE color scale represented by the current object that corresponds to he specified value (in the actual domain).
value | Value (in the actual domain) for which the corresponding color from the discrete color scale is returned. |
Implements IG.Lib.IColorScale.
|
inlinestatic |
Creates and returns a continuous color scale that runs through the specified colors.
The first specified color corresponds to the lowest and the last one to the highest values. Other colors (if specified) are positioned between, and colors for intermediate values are interpolated between two neighboring colors. Only one color can also be specified, in this case the whole scale has the same color.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
scaleColors | Colors that determine the color scale. T |
Referenced by IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridContours(), IG.Gr3d.TestVtkGraphicBase.ExampleCellsGridEfficient(), IG.Gr3d.VtkPlotBase.ExampleCustomSurfaceComparison(), and IG.Gr3d.TestVtkGraphicBase.ExampleStructuredGrid().
|
inlinestatic |
Creates and returns a discrete color scale that runs through the specified colors.
The first specified color corresponds to the lowest and the last one to the highest values. Other colors (if specified) are positioned between, and colors for intermediate values are interpolated between two neighboring colors. Only one color can also be specified, in this case the whole scale has the same color.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of cells in the color scale. |
scaleColors | Colors that determine the color scale. |
|
inlinestatic |
Creates and returns a continuous color scale that runs from blue through red till yellow color.
This is intended as default color scale for graphical representations. The advantge is that color brightness varies monotonically () and relatively significantly) form the lower to the upper bounds, while hue varies significantly, too.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
|
inlinestatic |
Creates and returns a discrete color scale that runs from blue through red till yellow color.
This is intended as default color scale for graphical representations. The advantge is that color brightness varies monotonically () and relatively significantly) form the lower to the upper bounds, while hue varies significantly, too.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
|
inlinestatic |
Creates and returns a continuous color scale that runs from violet till red color and passes rainbow colors in their natural order (red-orange-yellow-green-blue-indigo-violet).
Indigo is included.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
|
inlinestatic |
Creates and returns a discrete color scale that runs from violet till red color and passes rainbow colors in their natural order (red-orange-yellow-green-blue-indigo-violet).
Indigo is included.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
|
inlinestatic |
Creates and returns a continuous color scale that runs from violet till red color and passes rainbow colors in their natural order (red-orange-yellow-green-blue-violet).
Indigo is excluded from the scale.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
Referenced by IG.Gr3d.VtkPlotBase.ExampleCurvePlotLissajous(), IG.Gr3d.VtkPlotBase.ExampleCurvePlotTorusKnot(), IG.Gr3d.VtkPlotBase.ExampleCustomSurfaceComparison(), IG.Gr.PlotterZedGraph.ExempleSinePlots(), and IG.Gr3d.VtkControlBase.VtkControlBase_LoadVtkGraphics().
|
inlinestatic |
Creates and returns a discrete color scale that runs from violet till red color and passes rainbow colors in their natural order (red-orange-yellow-green-blue-indigo-violet).
Indigo is excluded from the scale.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
|
inlinestatic |
Creates and returns a continuous color scale that is adapted to color blind people in general.
Colors follow as #E69F00 - #56B4E9 - #2B9F78 - #F0E442 - #0072B2 - #D55E00 - CC79A7.
This scale should be well distinguished by normal sighted persons as well as color vision deficients with different kinds of color blindness.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
See also:
|
inlinestatic |
Creates and returns a discrete color scale that is adapted to color blind people in general.
Colors follow as #E69F00 - #56B4E9 - #2B9F78 - #F0E442 - #0072B2 - #D55E00 - CC79A7.
This scale should be well distinguished by normal sighted persons as well as color vision deficients with different kinds of color blindness.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
See also:
|
inlinestatic |
Creates and returns a continuous color scale that is adapted to people with protanopia.
Colors follow as orange-yellow-blue-violet.
Protanopia is a color vision deficiency caused by absence of red retinal photoreceptors. In this dichromacy, red appears dark.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
See also:
|
inlinestatic |
Creates and returns a discrete color scale that is adapted to people with protanopia.
Colors follow as orange-yellow-blue-violet.
Protanopia is a color vision deficiency caused by absence of red retinal photoreceptors. In this dichromacy, red appears dark.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
See also:
|
inlinestatic |
Creates and returns a continuous color scale that is adapted to people with deuteranopia.
Colors follow as red - yellow - blue.
Deuteranopia is a color vision deficiency caused by absence of green retinal photoreceptors and afects red-green discrimination.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
See also:
|
inlinestatic |
Creates and returns a discrete color scale that is adapted to people with deuteranopia.
Colors follow as red - yellow - blue.
Deuteranopia is a color vision deficiency caused by absence of green retinal photoreceptors and afects red-green discrimination.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
See also:
|
inlinestatic |
Creates and returns a continuous color scale that is adapted to people with tritanopia.
Colors follow as red - yellow - blue.
Tritanopia is a color vision deficiency caused by absence of blue retinal photoreceptors.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
See also:
|
inlinestatic |
Creates and returns a discrete color scale that is adapted to people with tritanopia.
Colors follow as red - yellow - blue.
Tritanopia is a color vision deficiency caused by absence of blue retinal photoreceptors.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
See also:
|
inlinestatic |
Creates and returns a continuous color scale with various hues of gray.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
|
inlinestatic |
Creates and returns a discrete color scale with various hues of gray.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
|
inlinestatic |
Creates and returns a continuous color scale that ranges from dark blue to red.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
|
inlinestatic |
Creates and returns a discrete color scale that ranges from dark blue to red.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
|
inlinestatic |
Creates and returns a continuous color scale that ranges from dark blue to yellow.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
Referenced by IG.Gr3d.VtkPlotBase.ExampleCurvePlotLissajous(), IG.Gr3d.VtkPlotBase.ExampleCurvePlotTorusKnot(), and IG.Gr3d.VtkControlBase.VtkControlBase_LoadVtkGraphics().
|
inlinestatic |
Creates and returns a discrete color scale that ranges from dark blue to yellow.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
|
inlinestatic |
Creates and returns a continuous color scale that runs from blue through red till yellow color.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
Referenced by IG.Gr3d.TestVtkGraphicBase.ColorBar().
|
inlinestatic |
Creates and returns a discrete color scale that runs from blue through red till yellow color.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
|
inlinestatic |
Creates and returns a continuous color scale that runs from blue through green till red color.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
|
inlinestatic |
Creates and returns a discrete color scale that runs from blue through green till red color.
minValue | Lower bound of the range of values for which color scale is defined. |
maxValue | Upper bound of the range of values for which color scale is defined. |
numCells | Number of discrete cells of the color scale. |
|
private |
|
protected |
|
getprotected set |
Gets the flag indicating whether the color scale is discrete (with a finite number of possible colors, as opposed to continuous).
|
getset |
Number of cells in discrete color scale.
Remarks:
If less than 1 then the current object can not represent a discrete color scale, and the related methods such as should throw exception.
Minimal value is 1. If p or less is assigned then an exception is thrown.