Antiprism 0.23
|
A colour map using a range. More...
#include <col_map.h>
Public Member Functions | |
virtual bool | init (const char *name, char *errmsg=0) |
Initialise from a string. | |
color_map * | clone () const |
Get a copy of the map. | |
virtual bool | set_range (int idx, vector< double > range) |
Set a range. | |
virtual col_val | get_col (int idx) const |
Get the colour value for an index number. | |
void | set_map_sz (int sz) |
Set the map size. | |
int | get_map_sz () const |
Get the map size. | |
virtual int | effective_size () const |
The effective size of the map. |
A colour map using a range.
color_map* color_map_range::clone | ( | ) | const [inline, virtual] |
Get a copy of the map.
delete
, 0 indicates that the clone failed. Reimplemented from color_map.
Reimplemented in color_map_range_hsv, color_map_range_rgb, color_map_range_rand, color_map_range_rand_hsv, color_map_range_rand_rgb, and color_map_spread.
virtual int color_map_range::effective_size | ( | ) | const [inline, virtual] |
The effective size of the map.
The effective size of a map is one greater than the highest index number in the map. It is the size of the smallest map (sequential, starting at 0) that will include all the entries of the map.
Reimplemented from color_map.
col_val color_map_range::get_col | ( | int | idx | ) | const [virtual] |
Get the colour value for an index number.
idx | the index. |
Reimplemented from color_map.
Reimplemented in color_map_range_rand, and color_map_spread.
int color_map_range::get_map_sz | ( | ) | const [inline] |
Get the map size.
bool color_map_range::init | ( | const char * | name, |
char * | errmsg = 0 |
||
) | [virtual] |
Initialise from a string.
name | the map name. |
errmsg | an array at least MSG_SZ chars long to return any error message. |
Reimplemented from color_map.
Reimplemented in color_map_range_hsv, color_map_range_rgb, color_map_range_rand_hsv, color_map_range_rand_rgb, and color_map_spread.
void color_map_range::set_map_sz | ( | int | sz | ) | [inline] |
Set the map size.
sz | the number of entries in the map. |
bool color_map_range::set_range | ( | int | idx, |
vector< double > | range | ||
) | [virtual] |
Set a range.
idx | the index number of the component (0-3 for RGBA or HSVA) |
range | the range to set. |