|
cgv
|
This class represents a continuous color scheme using an interpolator to convert continuous scalar values to colors. More...
#include <color_scheme.h>
Public Types | |
| using | interpolator_type = cgv::math::interpolator< cgv::rgb, float > |
| The used interpolator type. | |
Public Member Functions | |
| continuous_color_scheme () | |
| Construct using an interpolator that represents the identity function, basically providing a grayscale color ramp. | |
| continuous_color_scheme (const interpolator_type &interpolator, ColorSchemeType type=ColorSchemeType::kUndefined) | |
| Construct using the given interpolator and scheme type. | |
| std::shared_ptr< const interpolator_type > | get_interpolator () const |
| Return the interpolator. | |
| cgv::rgb | interpolate (float t) const |
| Evaluate the color scheme at position t. | |
| std::vector< cgv::rgb > | quantize (size_t n) const |
| Evaluate the color scheme at n uniformly-spaced positions within the range [0,1]. | |
Static Public Member Functions | |
| static continuous_color_scheme | linear (const std::vector< cgv::rgb > &colors, ColorSchemeType type=ColorSchemeType::kUndefined) |
| Create a continuous_color_scheme using uniform linear interpolation of the given colors. | |
| static continuous_color_scheme | linear (const std::vector< std::pair< float, cgv::rgb > > &colors, ColorSchemeType type=ColorSchemeType::kUndefined) |
| Create a continuous_color_scheme using linear interpolation of the given control points consisting of position and color. | |
| static continuous_color_scheme | smooth (const std::vector< cgv::rgb > &colors, ColorSchemeType type=ColorSchemeType::kUndefined) |
| Create a continuous_color_scheme using uniform b-spline interpolation of the given colors. | |
| static continuous_color_scheme | function (std::function< cgv::rgb(float)> fn, ColorSchemeType type=ColorSchemeType::kUndefined) |
| Create a continuous_color_scheme using a functor as interpolator. | |
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 continuous color scheme using an interpolator to convert continuous scalar values to colors.
Definition at line 68 of file color_scheme.h.
| using cgv::media::continuous_color_scheme::interpolator_type = cgv::math::interpolator<cgv::rgb, float> |
The used interpolator type.
Definition at line 71 of file color_scheme.h.
|
inline |
Construct using an interpolator that represents the identity function, basically providing a grayscale color ramp.
Definition at line 74 of file color_scheme.h.
|
inline |
Construct using the given interpolator and scheme type.
The type should describe the color ramp produced by the interpolator if possible.
| interpolator | The used interpolator. |
| type | The color scheme type. |
Definition at line 80 of file color_scheme.h.
References cgv::media::color_scheme::type.
|
inlinestatic |
Create a continuous_color_scheme using a functor as interpolator.
| colors | The function used to map scalars to colors. |
| type | The color scheme type. |
Definition at line 118 of file color_scheme.h.
References cgv::media::color_scheme::type.
|
inline |
Return the interpolator.
Definition at line 123 of file color_scheme.h.
Referenced by cgv::media::continuous_color_scale::quantize().
|
inline |
Evaluate the color scheme at position t.
| t | The position at which to evaluate the interpolated values. |
Definition at line 131 of file color_scheme.h.
Referenced by cgv::media::continuous_color_scale::get_mapped_color().
|
inlinestatic |
Create a continuous_color_scheme using uniform linear interpolation of the given colors.
| colors | The list of colors to interpolate. |
| type | The color scheme type. |
Definition at line 90 of file color_scheme.h.
References cgv::media::color_scheme::type.
Referenced by cgv::overlay::performance_monitor::init().
|
inlinestatic |
Create a continuous_color_scheme using linear interpolation of the given control points consisting of position and color.
The positions should be within the range [0,1].
| colors | The list of control points to interpolate. |
| type | The color scheme type. |
Definition at line 100 of file color_scheme.h.
References cgv::media::color_scheme::type.
|
inline |
Evaluate the color scheme at n uniformly-spaced positions within the range [0,1].
| n | The number of samples to interpolate. |
Definition at line 139 of file color_scheme.h.
Referenced by cgv::media::transfer_function::set_color_points_from_scheme().
|
inlinestatic |
Create a continuous_color_scheme using uniform b-spline interpolation of the given colors.
| colors | The list of colors to interpolate. |
| type | The color scheme type. |
Definition at line 109 of file color_scheme.h.
References cgv::media::color_scheme::type.