#include <ColorMapping.h>
Public Member Functions | |
ColorMapping () | |
ColorMapping (Color c1, Color c2) | |
~ColorMapping () | |
bool | addColor (double x) |
bool | removeColor (int i) |
void | moveColor (int i, double x) |
void | setColor (int i, int r, int g, int b) |
Color | getColor (int i) |
Color | getColorAt (double x) |
void | resetColorIter () |
bool | hasNextColor () |
Color | getNextColor () |
Private Member Functions | |
void | init (Color c1, Color c2) |
Private Attributes | |
list< Color > | m_Colors |
list< Color >::iterator | m_colorIter |
ColorMapping::ColorMapping | ( | ) |
default constructor. Fills first and last node with default colors.
Constructor.
c1 | color of the first color node | |
c2 | color of the last color node |
ColorMapping::~ColorMapping | ( | ) |
destructor
bool ColorMapping::addColor | ( | double | x | ) |
Adds a new Color at a place between 0,1. The new color node has default values.
x | place of the new color node, between 0,1. |
bool ColorMapping::removeColor | ( | int | i | ) |
Removes a color at a certain counter.
i | count of the color node to remove. |
void ColorMapping::moveColor | ( | int | i, | |
double | x | |||
) |
Moves a certain color to another place.
i | count of the color node to be moved | |
x | new place of the color node |
void ColorMapping::setColor | ( | int | i, | |
int | r, | |||
int | g, | |||
int | b | |||
) |
Sets the color of a node of a certain count.
i | count of the color node to be altered | |
r | new red value | |
g | new green value | |
b | new blue balue |
Color ColorMapping::getColor | ( | int | i | ) |
Returns the color of a the color node at a certain count.
i | count of the color node |
Color ColorMapping::getColorAt | ( | double | x | ) |
Returns the interpolated color at a place between 0,1 in dependence of the other color nodes.
x | value of the color map, between 0,1 |
void ColorMapping::resetColorIter | ( | ) |
Resets the color iterator.
bool ColorMapping::hasNextColor | ( | ) |
Returns if there are any colors left relative to the iterator.
Color ColorMapping::getNextColor | ( | ) |
Returns the color of the iterator and increases the iterator.
This method is called by the constructors to initialize the color map.
list<Color> ColorMapping::m_Colors [private] |
list<Color>::iterator ColorMapping::m_colorIter [private] |
list of all color nodes