![]() |
|
Container for color, transparency (alpha) and textual id and description. Does not contain intensity thresholds (intervals). More...
#include <PaletteEntry.h>
Public Types | |
typedef double | value_t |
Intensity type. | |
typedef std::vector< value_t > | color_vect_t |
typedef drain::FlexVariableMap | map_t |
typedef FlexibleVariable | color_t |
Color vector type. | |
Public Member Functions | |
PaletteEntry () | |
Default constructor. | |
PaletteEntry (const PaletteEntry &entry) | |
Copy constructor. | |
PaletteEntry (const char *code, const char *label, const color_vect_t &color, value_t alpha=255.0, bool hidden=false) | |
PaletteEntry (const char *label, const color_vect_t &color, value_t alpha=255.0, bool hidden=false) | |
PaletteEntry (const color_vect_t &color, value_t alpha=255.0, bool hidden=false) | |
PaletteEntry (const std::initializer_list< Variable::init_pair_t > &args) | |
Constructor supporting Palette initialization using "{key,value}" form. | |
PaletteEntry (const char *label) | |
Special dummy constructor for reading a title or other metadata related to Palette. | |
PaletteEntry & | operator= (const PaletteEntry &b) |
const map_t & | getParameters () const |
map_t & | getParameters () |
std::ostream & | toStream (std::ostream &ostr, char separator='\t') const |
void | checkAlpha () |
void | getHexColor (std::ostream &ostr) const |
Returns the color without leading marker (like "0x"). | |
void | getHexColor (std::string &str, const std::string &prefix="") const |
Write colour in hexadecimal notation, with an optional prefix (often "#"). | |
Public Attributes | |
map_t | parameters |
std::string | code |
Technical identifier (optional). | |
std::string | label |
Short description for legends. | |
FlexibleVariable & | color |
Index or threshold value. Must be signed, as image data may generally have negative values. | |
value_t | alpha |
Colors, or more generally, channel values. | |
bool | hidden |
Suggests hiding the entry in legends. Does not affect colouring of images. | |
Protected Member Functions | |
void | init () |
Container for color, transparency (alpha) and textual id and description. Does not contain intensity thresholds (intervals).
The color is stored as 8 bit value [0.0 ,255.0]. Alpha is stored (currenly) as a float: [0.0, 1.0].
PaletteEntry | ( | ) |
Default constructor.
Colorizes an image of 1 channel to an image of N channels by using a palette image as a lookup table.
Treats an RGB truecolor image of N pixels as as a palette of N colors.
PaletteEntry | ( | const char * | code, |
const char * | label, | ||
const color_vect_t & | color, | ||
value_t | alpha = 255.0 , |
||
bool | hidden = false |
||
) |
This constructor supports Palette initialization of form:
PaletteEntry | ( | const char * | label, |
const color_vect_t & | color, | ||
value_t | alpha = 255.0 , |
||
bool | hidden = false |
||
) |
This constructor supports Palette initialization with following entry syntax:
PaletteEntry | ( | const color_vect_t & | color, |
value_t | alpha = 255.0 , |
||
bool | hidden = false |
||
) |
This constructor supports Palette initialization of form:
PaletteEntry | ( | const std::initializer_list< Variable::init_pair_t > & | args | ) |
Constructor supporting Palette initialization using "{key,value}" form.
PaletteEntry | ( | const char * | label | ) |
Special dummy constructor for reading a title or other metadata related to Palette.
This constructor supports Palette initialization of form:
std::ostream & toStream | ( | std::ostream & | ostr, |
char | separator = '\t' |
||
) | const |
ostr | - output stream |
separator | - char after palette index |
separator2 | - char after each color intensity value |
value_t alpha |
Colors, or more generally, channel values.
Transparency
bool hidden |
Suggests hiding the entry in legends. Does not affect colouring of images.
When true, indicates that this entry is less significant and can be skipped when rendering legends, for example.