class HT_Gray_Ramp
Design Description
This class defines a simple ramp of gray color that can
be added to a palette in order to elaborate on the gray scale available
from HT_Color_Cube.
See Also
HT_Color_Cube
Access Methods
base_index, set_base_index
The starting point of the
ramp within the palette.
closest_match
Finds an index whose color is closest to the target.
color
Computes the color, based on the index as opposed to
lookup.
gamma
Allows for a non-linear
mapping of gray values.
range
Returns a structure that holds the range values for
each R, G, and B component.
resolution
The size of the gray ramp.
total
The same as resolution
for a gray ramp.
Constructor
HT_Gray_Ramp
Constructs an HT_Gray_Ramp
object.
HT_Gray_Ramp::base_index,
set_base_index
Purpose
This is the starting point
of the ramp within the palette.
Synopsis
int base_index (void) const
void set_base_index (int p_base_index) alter
Details
For more information see HT_Color_Cube, base_index
Note: read only access
HT_Gray_Ramp::closest_match
Purpose
Finds an index whose color is closest to the target.
Synopsis
int HT_Gray_Ramp::closest_match (
stack HT_RGB32 const & target) const
HEIDI_API int closest_match (HT_RGB32 const & target) const;
Details
If you are thresholding, then the nearest color is picked
¾ this is the "rounded" color. For dithering,
the code alternates between the floor and ceiling of the value, which implies
a "truncated" color is to be used as the base.
For more information see HT_Color_Cube, closest_match.
HT_Gray_Ramp::color
Purpose
Computes the color, based on the index as opposed to
lookup.
Synopsis
HT_RGB32 HT_Gray_Ramp::color (
stack int index) const
HEIDI_API HT_RGB32 color (int index) const;
Details
For more information see HT_Color_Cube, color.
HT_Gray_Ramp::gamma,
set_gamma
Purpose
Allows for a non-linear
mapping of gray values.
Synopsis
float gamma(void) const
void set_gamma (float p_gamma) alter
Details
For more information see HT_Color_Cube,gamma
Note: read only
access
HT_Gray_Ramp::HT_Gray_Ramp
Purpose
Constructor.
Synopsis
HEIDI_API HT_Gray_Ramp (int p_resolution = 2, float p_gamma = 1.0f, int p_base_index = 0);
HT_Gray_Ramp::range
Purpose
Returns a structure that holds the range values for
each R, G, and B component.
Synopsis
int range (void) const
Details
For more information see HT_Color_Cube, range.
Note: read only access
HT_Gray_Ramp::resolution,
set_resolution
Purpose
Resolution is the size
of the gray ramp ¾
how many array values.
Synopsis
int resolution (void) const
void set_resolution (int p_resolution) alter
Details
For more information see HT_Color_Cube, resolution.
Note: read only access
HT_Gray_Ramp::total
Purpose
This is the same as resolution
for a gray ramp.
Synopsis
int total (void) const
Details
This method is included so as to have a similar structure
to HT_Color_Cube. For more information see HT_Color_Cube,
total.
Note: read only access