Antiprism 0.23

- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# color_map_range Class Reference

A colour map using a range. More...

`#include <col_map.h>`

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

List of all members.

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

## Detailed Description

A colour map using a range.

## Member Function Documentation

color_map* color_map_range::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.

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.

Returns:
  The effective size

Reimplemented from color_map.

col_val color_map_range::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.

Reimplemented in color_map_range_rand, and color_map_spread.

int color_map_range::get_map_sz | ( |  | ) | const`[inline]`

Get the map size.

Returns:
  the number of entries in the map.

bool color_map_range::init | ( | const char * | name,
|  | char * | errmsg = `0`
| ) |  | `[virtual]`

Initialise from a string.

Parameters:

  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.

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.

Parameters:

  sz | the number of entries in the map.

bool color_map_range::set_range | ( | int | idx,
|  | vector< double > | range
| ) |  | `[virtual]`

Set a range.

Parameters:

  idx | the index number of the component (0-3 for RGBA or HSVA)
  range | the range to set.

Returns:
  true if the range was valid, else false and the range was not changed.

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

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