Antiprism 0.23

- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# color_map_multi Class Reference

A colour map that looks up in other colour maps in order. More...

`#include <col_map.h>`

Inheritance diagram for color_map_multi:
[legend]
Collaboration diagram for color_map_multi:
[legend]

List of all members.

## 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.

## Detailed Description

A colour map that looks up in other colour maps in order.

## Constructor & Destructor Documentation

color_map_multi::color_map_multi | ( | const color_map_multi & | cmap | ) |

Copy Constructor.

Parameters:

  cmap | the multiple colour map to copy from.

## Member Function Documentation

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

Parameters:

  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.

Returns:
  a pointer to the dynamically allocated copy, which must be freed by the caller with `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.

Parameters:

  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.

Returns:
  The effective size

Reimplemented from color_map.

const vector<color_map *>& color_map_multi::get_cmaps | ( |  | ) | const`[inline]`

Get a the colour maps.

Returns:
  The colour maps.

col_val color_map_multi::get_col | ( | int | idx | ) | const`[virtual]`

Get the colour value for an index number.

Parameters:

  idx | the index.

Returns:
  The colour.

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.

Parameters:

  map_name | the map name.
  errmsg | an array at least `MSG_SZ` chars long to return any error message.

Returns:
  true if the file could be read, otherwise false and the error is detailed in errmsg.

Reimplemented from color_map.

color_map_multi & color_map_multi::operator= | ( | const color_map_multi & | cmap | ) |

Copy Assignment.

Parameters:

  cmap | the multiple colour map to copy from.

void color_map_multi::set_map_sz | ( | int | sz | ) | `[inline]`

Set the map size.

Parameters:

  sz | the number of entries in the map.

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

- base/col_map.h
- base/col_map.cc