Antiprism 0.23
|
A colour map that looks up in other colour maps in order. More...
#include <col_map.h>
Public Member Functions | |
color_map_multi (const color_map_multi &cmap) | |
Copy Constructor. | |
color_map_multi & | operator= (const color_map_multi &cmap) |
Copy Assignment. | |
~color_map_multi () | |
Destructor. | |
virtual bool | init (const char *map_name, char *errmsg=0) |
Initialise from a string. | |
virtual color_map * | clone () const |
Get a copy of the map. | |
void | set_map_sz (int sz) |
Set the map size. | |
virtual int | effective_size () const |
The effective size of the map. | |
void | add_cmap (color_map *col_map, unsigned int pos=INT_MAX) |
Add a colour map. | |
void | del_cmap (unsigned int pos=INT_MAX) |
Delete a colour map. | |
const vector< color_map * > & | get_cmaps () const |
Get a the colour maps. | |
virtual col_val | get_col (int idx) const |
Get the colour value for an index number. |
A colour map that looks up in other colour maps in order.
color_map_multi::color_map_multi | ( | const color_map_multi & | cmap | ) |
Copy Constructor.
cmap | the multiple colour map to copy from. |
void color_map_multi::add_cmap | ( | color_map * | col_map, |
unsigned int | pos = INT_MAX |
||
) |
Add a colour map.
The color_map must be dynamically allocated, using new
directly or through, for example, init_color_map(name)
. The calling program must not delete it. The color_map_multi
object will delete the added map when it is no longer needed
col_map | the colour map. |
pos | the position to add it, or at the end if pos is greater then the current size |
virtual color_map* color_map_multi::clone | ( | ) | const [inline, virtual] |
Get a copy of the map.
delete
, 0 indicates that the clone failed. Reimplemented from color_map.
void color_map_multi::del_cmap | ( | unsigned int | pos = INT_MAX | ) |
Delete a colour map.
pos | the position of the colour map to delete, or delete the last colour map if pos is greater than or equal to the current size |
virtual int color_map_multi::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.
const vector<color_map *>& color_map_multi::get_cmaps | ( | ) | const [inline] |
Get a the colour maps.
col_val color_map_multi::get_col | ( | int | idx | ) | const [virtual] |
Get the colour value for an index number.
idx | the index. |
Reimplemented from color_map.
bool color_map_multi::init | ( | const char * | map_name, |
char * | errmsg = 0 |
||
) | [virtual] |
Initialise from a string.
The colour map can be in the Antiprism, GIMP or Fractint format. If the filename isn't found then the name will be looked for in the Antiprism data directory colour map resources.
map_name | the map name. |
errmsg | an array at least MSG_SZ chars long to return any error message. |
Reimplemented from color_map.
color_map_multi & color_map_multi::operator= | ( | const color_map_multi & | cmap | ) |
Copy Assignment.
cmap | the multiple colour map to copy from. |
void color_map_multi::set_map_sz | ( | int | sz | ) | [inline] |
Set the map size.
sz | the number of entries in the map. |