|
cgv
|
This class represents a discrete color scheme using sets of colors to convert discrete scalars to colors. More...
#include <color_scheme.h>
Public Member Functions | |
| discrete_color_scheme () | |
| Construct an empty scheme. | |
| discrete_color_scheme (const std::vector< cgv::rgb > &colors, ColorSchemeType type=ColorSchemeType::kUndefined) | |
| Construct from a set of colors and scheme type. | |
| discrete_color_scheme (const std::vector< std::vector< cgv::rgb > > &variants, ColorSchemeType type=ColorSchemeType::kUndefined) | |
| Construct from a list of color sets and scheme type. | |
| const std::vector< cgv::rgb > | get_colors (size_t n) const |
| Return a sequence of colors of the specified count. | |
Additional Inherited Members | |
Public Attributes inherited from cgv::media::color_scheme | |
| ColorSchemeType | type = ColorSchemeType::kUndefined |
| The type of this color scheme. | |
This class represents a discrete color scheme using sets of colors to convert discrete scalars to colors.
Definition at line 149 of file color_scheme.h.
|
inline |
Construct an empty scheme.
Definition at line 152 of file color_scheme.h.
|
inline |
Construct from a set of colors and scheme type.
The type should describe the color set produced by the interpolator if possible (typically ColorSchemeType::kCategorical).
| colors | The set of used colors. |
| type | The color scheme type. |
Definition at line 158 of file color_scheme.h.
|
inline |
Construct from a list of color sets and scheme type.
The color sets represent variants of the scheme that should be similar but can express slight variations at different scheme sizes.
| variants | The list of sets of color scheme variants. |
| type | The color scheme type. |
Definition at line 165 of file color_scheme.h.
References cgv::media::color_scheme::type.
|
inline |
Return a sequence of colors of the specified count.
Returns the scheme variant with exact size n if it exists. Otherwise, for schemes of type ColorSchemeType::kCategorical the next largest or largest available variant is returned, possibly being larger than n. For all other scheme types the next smaller variant is smoothly interpolated at n positions and the result returned.
| n | The number of requested colors. |
Definition at line 180 of file color_scheme.h.
References cgv::math::interpolator< ValueT, ParamT >::quantize().
Referenced by cgv::media::discrete_color_scale::set_scheme().