#include <ColorMap.h>
Public Member Functions | |
| ColorMap () | |
| ColorMap (const std::string &filename) | |
| ColorMap (const std::string &name, const std::vector< ColorType > &table) | |
| ColorMap (const std::string &name, const Gradient &gradient) | |
| ColorMap (const ColorMap &colorMap) | |
| ~ColorMap () | |
| ColorMap & | operator= (const ColorMap &colorMap) |
| bool | operator== (const ColorMap &colorMap) const |
| const std::string & | getName () const |
| bool | saveToFile (const std::string &filename) const |
| bool | saveToBuffer (std::string &buffer) const |
| const std::vector< ColorType > & | getTable () const |
| const ColorType & | operator[] (int index) const |
| ColorType & | operator[] (int index) |
| void | resetToDefault () |
| bool | isDefault () const |
| bool | isFullyOpaque () const |
| const Gradient * | getGradientDefinition () const |
| bool | loadFromFile (const std::string &filename) |
| bool | loadFromBuffer (const std::string &buffer) |
Classes | |
| struct | Gradient |
| This struct defines a color table. More... | |
A colormap can be a hold any number of colors, and may contain RGB or RGBA color. Each channel must have a value of between 0 and 256.
Definition at line 27 of file ColorMap.h.
| ColorMap::ColorMap | ( | ) |
Construct a default ColorMap.
| ColorMap::ColorMap | ( | const std::string & | filename | ) | [explicit] |
| ColorMap::ColorMap | ( | const std::string & | name, | |
| const std::vector< ColorType > & | table | |||
| ) |
| ColorMap::ColorMap | ( | const std::string & | name, | |
| const Gradient & | gradient | |||
| ) |
| ColorMap::ColorMap | ( | const ColorMap & | colorMap | ) |
| ColorMap::~ColorMap | ( | ) |
Frees all resources associated with a ColorMap.
| bool ColorMap::operator== | ( | const ColorMap & | colorMap | ) | const |
Determine if ColorMaps are equal.
| colorMap | The map to compare against |
true if the maps are equal, false otherwise. | const std::string& ColorMap::getName | ( | ) | const |
| bool ColorMap::saveToFile | ( | const std::string & | filename | ) | const |
Save the ColorMap to a file.
| filename | The name of the file to save to. |
true if the operation was a success, false otherwise. | bool ColorMap::saveToBuffer | ( | std::string & | buffer | ) | const |
| const std::vector<ColorType>& ColorMap::getTable | ( | ) | const |
| const ColorType& ColorMap::operator[] | ( | int | index | ) | const |
Get a specific color from the map.
| index | The index to retrieve. This must be within the bounds of the map. |
| ColorType& ColorMap::operator[] | ( | int | index | ) |
Get a specific color from the map as a non-const reference.
This allows for code like map[i] = ColorType(255, 255, 255)
| index | The index to retrieve. This must be within the bounds of the map. |
| void ColorMap::resetToDefault | ( | ) |
Clear the table and name, replacing it with a default grayscale.
| bool ColorMap::isDefault | ( | ) | const |
Determine if the ColorMap has not been changed from the default.
true if the object is still default, false otherwise. | bool ColorMap::isFullyOpaque | ( | ) | const |
Determine if the ColorMap contains only fully opaque colors.
true if the object is fully opaque, false otherwise. | const Gradient* ColorMap::getGradientDefinition | ( | ) | const |
| bool ColorMap::loadFromFile | ( | const std::string & | filename | ) |
| bool ColorMap::loadFromBuffer | ( | const std::string & | buffer | ) |