|
roo_display
API Documentation for roo_display
|
Multi-point gradient specification. More...
#include <gradient.h>
Data Structures | |
| struct | Node |
| A single node in the gradient. More... | |
Public Types | |
| enum class | Boundary { kExtended , kTruncated , kPeriodic } |
| Boundary behavior outside gradient range. More... | |
Public Member Functions | |
| ColorGradient (std::vector< Node > gradient, Boundary boundary=Boundary::kExtended) | |
| Create a gradient specification. | |
| Color | getColor (float value) const |
| Return the color for a given value. | |
| TransparencyMode | getTransparencyMode () const |
| Return the transparency mode of the gradient. | |
Static Public Attributes | |
| static constexpr Boundary | EXTENDED = Boundary::kExtended |
| static constexpr Boundary | TRUNCATED = Boundary::kTruncated |
| static constexpr Boundary | PERIODIC = Boundary::kPeriodic |
Multi-point gradient specification.
Definition at line 19 of file gradient.h.
Boundary behavior outside gradient range.
| Enumerator | |
|---|---|
| kExtended | |
| kTruncated | |
| kPeriodic | |
Definition at line 28 of file gradient.h.
| roo_display::ColorGradient::ColorGradient | ( | std::vector< Node > | gradient, |
| Boundary | boundary = Boundary::kExtended |
||
| ) |
Create a gradient specification.
Node list must contain at least one node for EXTENDED/TRUNCATED, and at least two nodes with different values for PERIODIC. Nodes must be sorted by value. Equal successive values create sharp transitions.
Definition at line 7 of file gradient.cpp.
References roo_display::kCrude, and roo_display::kFull.
Return the color for a given value.
Color is linearly interpolated between surrounding nodes. Values outside the range follow the boundary specification.
Definition at line 24 of file gradient.cpp.
References roo_display::InterpolateColors(), kExtended, kPeriodic, and kTruncated.
Referenced by roo_display::LinearGradient::readColorRect(), roo_display::RadialGradient::readColors(), roo_display::RadialGradientSq::readColors(), roo_display::LinearGradient::readColors(), and roo_display::AngularGradient::readColors().
|
inline |
Return the transparency mode of the gradient.
Definition at line 62 of file gradient.h.
|
staticconstexpr |
Definition at line 41 of file gradient.h.
|
staticconstexpr |
Definition at line 45 of file gradient.h.
|
staticconstexpr |
Definition at line 43 of file gradient.h.