cgv
Loading...
Searching...
No Matches
cgv::render::color_map Class Reference
Inheritance diagram for cgv::render::color_map:
cgv::render::gl_color_map

Public Member Functions

 color_map (const std::initializer_list< color_control_point_type > color_points)
 
 color_map (const std::initializer_list< color_type > colors)
 
 color_map (const std::initializer_list< opacity_control_point_type > opacity_points)
 
 color_map (const std::initializer_list< opacity_type > opacities)
 
 color_map (const std::initializer_list< std::pair< float, sample_point_type > > control_points)
 
virtual bool has_texture_support () const
 
void clear ()
 
void clear_color_points ()
 
void clear_opacity_points ()
 
bool empty () const
 
unsigned get_resolution () const
 
void set_resolution (unsigned resolution)
 
bool is_interpolation_enabled () const
 
void enable_interpolation (bool enabled)
 
void flip ()
 
void apply_gamma (float gamma)
 
void add_color_point (float t, rgb color)
 
void add_opacity_point (float t, float opacity)
 
const std::vector< color_control_point_type > & ref_color_points () const
 
const std::vector< opacity_control_point_type > & ref_opacity_points () const
 
rgb interpolate_color (float t) const
 
std::vector< rgbinterpolate_color (size_t n) const
 
float interpolate_opacity (float t) const
 
std::vector< float > interpolate_opacity (size_t n) const
 
rgba interpolate (float t) const
 
std::vector< rgbainterpolate (size_t n) const
 

Protected Types

typedef rgb color_type
 
typedef float opacity_type
 
typedef std::pair< opacity_type, color_typesample_point_type
 
typedef cgv::math::control_point_container< color_type >::control_point_type color_control_point_type
 
typedef cgv::math::control_point_container< opacity_type >::control_point_type opacity_control_point_type
 

Protected Member Functions

void construct_interpolators ()
 

Protected Attributes

cgv::math::control_point_container< rgbcolor_points
 
cgv::math::control_point_container< float > opacity_points
 
std::shared_ptr< cgv::math::interpolator< rgb > > color_interpolator_ptr = nullptr
 
std::shared_ptr< cgv::math::interpolator< float > > opacity_interpolator_ptr = nullptr
 
unsigned resolution = 256u
 resolution of the sampled color map; mostly used when generating textures from color maps
 
bool use_interpolation = true
 whether to use interpolation between the samples or just take the nearest one
 

Detailed Description

Definition at line 13 of file color_map.h.

Member Typedef Documentation

◆ color_control_point_type

typedef cgv::math::control_point_container<color_type>::control_point_type cgv::render::color_map::color_control_point_type
protected

Definition at line 18 of file color_map.h.

◆ color_type

Definition at line 15 of file color_map.h.

◆ opacity_control_point_type

typedef cgv::math::control_point_container<opacity_type>::control_point_type cgv::render::color_map::opacity_control_point_type
protected

Definition at line 19 of file color_map.h.

◆ opacity_type

typedef float cgv::render::color_map::opacity_type
protected

Definition at line 16 of file color_map.h.

◆ sample_point_type

typedef std::pair<opacity_type, color_type> cgv::render::color_map::sample_point_type
protected

Definition at line 17 of file color_map.h.

Constructor & Destructor Documentation

◆ color_map() [1/6]

cgv::render::color_map::color_map ( )
inline

Definition at line 43 of file color_map.h.

◆ color_map() [2/6]

cgv::render::color_map::color_map ( const std::initializer_list< color_control_point_type >  color_points)
inline

Definition at line 47 of file color_map.h.

◆ color_map() [3/6]

cgv::render::color_map::color_map ( const std::initializer_list< color_type colors)
inline

Definition at line 51 of file color_map.h.

◆ color_map() [4/6]

cgv::render::color_map::color_map ( const std::initializer_list< opacity_control_point_type >  opacity_points)
inline

Definition at line 68 of file color_map.h.

◆ color_map() [5/6]

cgv::render::color_map::color_map ( const std::initializer_list< opacity_type >  opacities)
inline

Definition at line 72 of file color_map.h.

◆ color_map() [6/6]

cgv::render::color_map::color_map ( const std::initializer_list< std::pair< float, sample_point_type > >  control_points)
inline

Definition at line 89 of file color_map.h.

◆ ~color_map()

virtual cgv::render::color_map::~color_map ( )
inlinevirtual

Definition at line 103 of file color_map.h.

Member Function Documentation

◆ add_color_point()

void cgv::render::color_map::add_color_point ( float  t,
rgb  color 
)
inline

Definition at line 162 of file color_map.h.

◆ add_opacity_point()

void cgv::render::color_map::add_opacity_point ( float  t,
float  opacity 
)
inline

Definition at line 167 of file color_map.h.

◆ apply_gamma()

void cgv::render::color_map::apply_gamma ( float  gamma)
inline

Definition at line 153 of file color_map.h.

◆ clear()

void cgv::render::color_map::clear ( )
inline

Definition at line 109 of file color_map.h.

◆ clear_color_points()

void cgv::render::color_map::clear_color_points ( )
inline

Definition at line 114 of file color_map.h.

◆ clear_opacity_points()

void cgv::render::color_map::clear_opacity_points ( )
inline

Definition at line 118 of file color_map.h.

◆ construct_interpolators()

void cgv::render::color_map::construct_interpolators ( )
inlineprotected

Definition at line 32 of file color_map.h.

◆ empty()

bool cgv::render::color_map::empty ( ) const
inline

Definition at line 122 of file color_map.h.

◆ enable_interpolation()

void cgv::render::color_map::enable_interpolation ( bool  enabled)
inline

Definition at line 134 of file color_map.h.

◆ flip()

void cgv::render::color_map::flip ( )
inline

Definition at line 139 of file color_map.h.

◆ get_resolution()

unsigned cgv::render::color_map::get_resolution ( ) const
inline

Definition at line 126 of file color_map.h.

◆ has_texture_support()

virtual bool cgv::render::color_map::has_texture_support ( ) const
inlinevirtual

Definition at line 105 of file color_map.h.

◆ interpolate() [1/2]

rgba cgv::render::color_map::interpolate ( float  t) const
inline

Definition at line 191 of file color_map.h.

◆ interpolate() [2/2]

std::vector< rgba > cgv::render::color_map::interpolate ( size_t  n) const
inline

Definition at line 198 of file color_map.h.

◆ interpolate_color() [1/2]

rgb cgv::render::color_map::interpolate_color ( float  t) const
inline

Definition at line 175 of file color_map.h.

◆ interpolate_color() [2/2]

std::vector< rgb > cgv::render::color_map::interpolate_color ( size_t  n) const
inline

Definition at line 179 of file color_map.h.

◆ interpolate_opacity() [1/2]

float cgv::render::color_map::interpolate_opacity ( float  t) const
inline

Definition at line 183 of file color_map.h.

◆ interpolate_opacity() [2/2]

std::vector< float > cgv::render::color_map::interpolate_opacity ( size_t  n) const
inline

Definition at line 187 of file color_map.h.

◆ is_interpolation_enabled()

bool cgv::render::color_map::is_interpolation_enabled ( ) const
inline

Definition at line 132 of file color_map.h.

◆ ref_color_points()

const std::vector< color_control_point_type > & cgv::render::color_map::ref_color_points ( ) const
inline

Definition at line 172 of file color_map.h.

◆ ref_opacity_points()

const std::vector< opacity_control_point_type > & cgv::render::color_map::ref_opacity_points ( ) const
inline

Definition at line 173 of file color_map.h.

◆ set_resolution()

void cgv::render::color_map::set_resolution ( unsigned  resolution)
inline

Definition at line 128 of file color_map.h.

Member Data Documentation

◆ color_interpolator_ptr

std::shared_ptr<cgv::math::interpolator<rgb> > cgv::render::color_map::color_interpolator_ptr = nullptr
protected

Definition at line 24 of file color_map.h.

◆ color_points

cgv::math::control_point_container<rgb> cgv::render::color_map::color_points
protected

Definition at line 21 of file color_map.h.

◆ opacity_interpolator_ptr

std::shared_ptr<cgv::math::interpolator<float> > cgv::render::color_map::opacity_interpolator_ptr = nullptr
protected

Definition at line 25 of file color_map.h.

◆ opacity_points

cgv::math::control_point_container<float> cgv::render::color_map::opacity_points
protected

Definition at line 22 of file color_map.h.

◆ resolution

unsigned cgv::render::color_map::resolution = 256u
protected

resolution of the sampled color map; mostly used when generating textures from color maps

Definition at line 28 of file color_map.h.

◆ use_interpolation

bool cgv::render::color_map::use_interpolation = true
protected

whether to use interpolation between the samples or just take the nearest one

Definition at line 30 of file color_map.h.


The documentation for this class was generated from the following file: