MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.basecode.ColorMapper Class Reference

The ColorMapper maps a value within a number range, to a Color within a color scheme. More...

Public Types

enum  COLORSCHEME { NORMAL , GBR }
 Defines the color scheme to use. More...
 

Public Member Functions

 ColorMapper (double dfMin, double dfMax, Color clrDefault, Color clrError, COLORSCHEME clrScheme=COLORSCHEME.NORMAL, int nResolution=160)
 The ColorMapper constructor. More...
 
 ColorMapper (double dfMin, double dfMax, Color clrDefault, Color clrError, List< double > rgClrStart, List< double > rgClrEnd, int nResolution=160)
 The ColorMapper constructor. More...
 
Color GetColorLegacy (double dfVal)
 Returns the color associated with the value. More...
 
double GetValue (Color clr)
 Returns the value associated with the color. More...
 
Color GetColor (double dfVal)
 Find the color using a binary search algorithm. More...
 

Properties

int Resolution [get]
 Returns the color resolution used. More...
 
Color NoMinMaxColor [getset]
 Get/set the color used when the Min and Max both equal 0. More...
 

Detailed Description

The ColorMapper maps a value within a number range, to a Color within a color scheme.

Definition at line 13 of file ColorMapper.cs.

Member Enumeration Documentation

◆ COLORSCHEME

Defines the color scheme to use.

Enumerator
NORMAL 

Use normal coloring where Red is a high value, Blue is a low value, and Green is in the middle.

GBR 

Use coloring where Green is a high value, Red is a low value and Blue is in the middle.

Definition at line 33 of file ColorMapper.cs.

Constructor & Destructor Documentation

◆ ColorMapper() [1/2]

MyCaffe.basecode.ColorMapper.ColorMapper ( double  dfMin,
double  dfMax,
Color  clrDefault,
Color  clrError,
COLORSCHEME  clrScheme = COLORSCHEME.NORMAL,
int  nResolution = 160 
)

The ColorMapper constructor.

Parameters
dfMinSpecifies the minimum value in the number range.
dfMaxSpecifies the maximum value in the number range.
clrDefaultSpecifies the default color to use.
clrErrorSpecifies the color to use when an error is detected.
clrSchemeSpecifies the color scheme to use (default = COLORSCHEME.NORMAL).
nResolutionSpecifies the number of colors to generate (default = 160).

Definition at line 54 of file ColorMapper.cs.

◆ ColorMapper() [2/2]

MyCaffe.basecode.ColorMapper.ColorMapper ( double  dfMin,
double  dfMax,
Color  clrDefault,
Color  clrError,
List< double >  rgClrStart,
List< double >  rgClrEnd,
int  nResolution = 160 
)

The ColorMapper constructor.

Parameters
dfMinSpecifies the minimum value in the number range.
dfMaxSpecifies the maximum value in the number range.
clrDefaultSpecifies the default color to use.
clrErrorSpecifies the color to use when an error is detected.
rgClrStartSpecifies the RGB three color starting color with values of 0 to 1.
rgClrEndSpecifies the RGB three color ending color with values of 0 to 1.
nResolutionSpecifies the number of colors to generate (default = 160).

Definition at line 113 of file ColorMapper.cs.

Member Function Documentation

◆ GetColor()

Color MyCaffe.basecode.ColorMapper.GetColor ( double  dfVal)

Find the color using a binary search algorithm.

See also
Binary Search Implementation Using C#
Parameters
dfValSpecifies the value to search for.
Returns
The matching color is returned.

Definition at line 350 of file ColorMapper.cs.

◆ GetColorLegacy()

Color MyCaffe.basecode.ColorMapper.GetColorLegacy ( double  dfVal)

Returns the color associated with the value.

Parameters
dfValSpecifies the value.
Returns
The color associated with the value is returned.

Definition at line 184 of file ColorMapper.cs.

◆ GetValue()

double MyCaffe.basecode.ColorMapper.GetValue ( Color  clr)

Returns the value associated with the color.

Parameters
clr
Returns
The value associated with the color is returned.

Definition at line 251 of file ColorMapper.cs.

Property Documentation

◆ NoMinMaxColor

Color MyCaffe.basecode.ColorMapper.NoMinMaxColor
getset

Get/set the color used when the Min and Max both equal 0.

Definition at line 173 of file ColorMapper.cs.

◆ Resolution

int MyCaffe.basecode.ColorMapper.Resolution
get

Returns the color resolution used.

Definition at line 165 of file ColorMapper.cs.


The documentation for this class was generated from the following file: