inlib
1.2.0
|
Public Member Functions | |
bool | get_color (unsigned int a_index, colorf &a_col) const |
bool | get_color (const std::string &a_s, colorf &a_col) const |
bool | get_string_color (unsigned int a_index, std::string &a_s) const |
Definition at line 34 of file style_colormap.
bool inlib::sg::style_colormap::get_color | ( | unsigned int | a_index, |
colorf & | a_col | ||
) | const [inline] |
Definition at line 36 of file style_colormap.
{ if(a_index>=size()) { a_col.set_value(0.5F,0.5F,0.5F); return false; } a_col = (*this)[a_index].second; return true; }
bool inlib::sg::style_colormap::get_color | ( | const std::string & | a_s, |
colorf & | a_col | ||
) | const [inline] |
Definition at line 44 of file style_colormap.
bool inlib::sg::style_colormap::get_string_color | ( | unsigned int | a_index, |
std::string & | a_s | ||
) | const [inline] |
Definition at line 55 of file style_colormap.
{ if(a_index>=size()) {a_s.clear();return false;} colorf c = (*this)[a_index].second; char ss[192]; //3*64 = 192 #ifdef WIN32 _snprintf(ss,sizeof(ss),"%g %g %g",c[0],c[1],c[2]); #else ::snprintf(ss,sizeof(ss),"%g %g %g",c[0],c[1],c[2]); #endif a_s = std::string(ss); return true; }