|
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 UniTuple< value_t, 3 > | color_t |
Color vector type. | |
Public Member Functions | |
PaletteEntry () | |
Default constructor. More... | |
PaletteEntry (const PaletteEntry &entry) | |
Copy constructor. | |
PaletteEntry (const char *code, const char *label, const color_t &color, value_t alpha=255.0, bool hidden=false) | |
PaletteEntry (const char *label, const color_t &color, value_t alpha=255.0, bool hidden=false) | |
PaletteEntry (const color_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. More... | |
PaletteEntry (const char *label) | |
Special dummy constructor for reading a title or other metadata related to Palette. More... | |
void | checkAlpha () |
std::ostream & | toStream (std::ostream &ostr, char separator='\t') const |
void | getHexColor (std::ostream &ostr) const |
Returns the color without leading marker (like "0x"). | |
void | getHexColor (std::string &str) const |
Public Member Functions inherited from BeanLike | |
virtual const std::string & | getName () const |
Return the name of an instance. | |
virtual const std::string & | getDescription () const |
Return a brief description. | |
bool | hasParameters () const |
template<class F > | |
F | getParameter (const std::string &p) const |
Gets a single parameter. | |
const ReferenceMap & | getParameters () const |
ReferenceMap & | getParameters () |
template<class F > | |
void | setParametersFromEntries (const F &args) |
void | setParameters (std::initializer_list< Variable::init_pair_t > args) |
Grants access to (if above hidden) | |
virtual void | setParameters (const std::string &p, char assignmentSymbol='=', char separatorSymbol=0) |
Sets comma-separated parameters in a predetermined order "a,b,c" or by specifing them "b=2". More... | |
template<class T > | |
void | setParameters (const std::map< std::string, T > &args) |
Set parameters. | |
template<class T > | |
void | setParameters (const SmartMap< T > &args) |
Set parameters. | |
void | setParameter (const std::string &p, const Castable &value) |
Sets a single parameter. | |
template<class T > | |
void | setParameter (const std::string &p, const VariableT< T > &value) |
template<class F > | |
void | setParameter (const std::string &p, const F &value) |
Sets a single parameter. More... | |
template<class F > | |
void | setParameter (const std::string &p, std::initializer_list< F > value) |
Sets a single parameter. | |
BeanLike & | operator= (const BeanLike &b) |
virtual std::ostream & | toStream (std::ostream &ostr, bool compact=true) const |
BeanLike (const BeanLike &b) | |
BeanLike (const std::string &name, const std::string &description="") | |
Public Attributes | |
std::string | code |
Technical identifier (optional). | |
std::string | label |
Short description for legends. | |
color_t | color |
Index or threshold value. Must be signed, as image data may generally have negative values. More... | |
value_t | alpha |
Transparency. | |
bool | hidden |
Suggests hiding the entry in legends. Does not affect colouring of images. More... | |
Protected Member Functions | |
void | init () |
Protected Member Functions inherited from BeanLike | |
virtual void | storeLastArguments (const std::string &p) |
Called after setParameters() | |
virtual void | updateBean () const |
Called after setParameters() | |
Additional Inherited Members | |
Protected Attributes inherited from BeanLike | |
const std::string | name |
const std::string | description |
ReferenceMap | parameters |
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_t & | color, | ||
value_t | alpha = 255.0 , |
||
bool | hidden = false |
||
) |
This constructor supports Palette initialization of form:
PaletteEntry | ( | const char * | label, |
const color_t & | color, | ||
value_t | alpha = 255.0 , |
||
bool | hidden = false |
||
) |
This constructor supports Palette initialization with following entry syntax:
PaletteEntry | ( | const color_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 |
color_t color |
Index or threshold value. Must be signed, as image data may generally have negative values.
Colors, or more generally, channel values
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.