Geogram
Version 1.9.1
A programming library of geometric algorithms
|
#include <geogram/image/colormap.h>
Public Types | |
typedef GenColor< Numeric::uint8 > | ColorCell |
Type of each cell of the Colormap. | |
Public Member Functions | |
Colormap (index_t size_in=256) | |
Colormap constructor. More... | |
~Colormap () override | |
Colormap destructor. | |
const ColorCell & | color_cell (index_t index) const |
Gets a ColorCell by index. More... | |
ColorCell & | color_cell (index_t index) |
Gets a ColorCell by index. More... | |
index_t | size () const |
Gets the size. More... | |
void | set_color (index_t index, float r, float g, float b) |
Sets a color by index and components. More... | |
void | set_color (index_t index, float r, float g, float b, float a) |
Sets a color by index and components. More... | |
void | color_ramp_component (index_t component, index_t index1, Numeric::uint8 val1, index_t index2, Numeric::uint8 val2) |
Make a color component linearly interpolate two values between two given indices. More... | |
void | color_ramp_rgba (index_t index1, const Color &c1, index_t index2, const Color &c2) |
Make a color linearly interpolate two values between two given indices. More... | |
void | color_ramp_rgb (index_t index1, const Color &c1, index_t index2, const Color &c2) |
Make a color linearly interpolate two values between two given indices. More... | |
Public Member Functions inherited from GEO::Counted | |
void | ref () const |
Increments the reference count. More... | |
void | unref () const |
Decrements the reference count. More... | |
bool | is_shared () const |
Check if the object is shared. More... | |
int | nb_refs () const |
Gets the number of references that point to this object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from GEO::Counted | |
static void | ref (const Counted *counted) |
Increments the reference count. More... | |
static void | unref (const Counted *counted) |
Decrements the reference count. More... | |
Protected Member Functions inherited from GEO::Counted | |
Counted () | |
Creates a reference counted object. More... | |
virtual | ~Counted () |
Destroys a reference counted object. More... | |
A Colormap.
A Colormap is an array of colors, encoded with one byte per component.
Definition at line 61 of file colormap.h.
GEO::Colormap::Colormap | ( | index_t | size_in = 256 | ) |
Gets a ColorCell by index.
[in] | index | the index of the ColorCell |
Definition at line 97 of file colormap.h.
Gets a ColorCell by index.
[in] | index | the index of the ColorCell |
Definition at line 86 of file colormap.h.
void GEO::Colormap::color_ramp_component | ( | index_t | component, |
index_t | index1, | ||
Numeric::uint8 | val1, | ||
index_t | index2, | ||
Numeric::uint8 | val2 | ||
) |
Make a color component linearly interpolate two values between two given indices.
[in] | component | the index of the component, one of 0,1,2,3 |
[in] | index1 | the first index |
[in] | val1 | the first value of the component, associated with index1 |
[in] | index2 | the second index |
[in] | val2 | the second value of the component, associated with index2 |
void GEO::Colormap::color_ramp_rgb | ( | index_t | index1, |
const Color & | c1, | ||
index_t | index2, | ||
const Color & | c2 | ||
) |
Make a color linearly interpolate two values between two given indices.
Only r,g,b are updated. Transparency a is left unmodified in the concerned color cells.
[in] | index1 | the first index |
[in] | c1 | the first color, associated with index1 |
[in] | index2 | the second index |
[in] | c2 | the first color, associated with index2 |
void GEO::Colormap::color_ramp_rgba | ( | index_t | index1, |
const Color & | c1, | ||
index_t | index2, | ||
const Color & | c2 | ||
) |
Make a color linearly interpolate two values between two given indices.
All components and transparency are updated.
[in] | index1 | the first index |
[in] | c1 | the first color, associated with index1 |
[in] | index2 | the second index |
[in] | c2 | the first color, associated with index2 |
void GEO::Colormap::set_color | ( | index_t | index, |
float | r, | ||
float | g, | ||
float | b | ||
) |
Sets a color by index and components.
The transparency a is left unchanged.
[in] | index | the index |
[in] | r,g,b | the components, as single-precision floating points, between 0.0f, and 1.0f |
void GEO::Colormap::set_color | ( | index_t | index, |
float | r, | ||
float | g, | ||
float | b, | ||
float | a | ||
) |
Sets a color by index and components.
[in] | index | the index |
[in] | r,g,b,a | the components, as single-precision floating points, between 0.0f, and 1.0f |
|
inline |
Gets the size.
Definition at line 106 of file colormap.h.