cgv
Loading...
Searching...
No Matches
cgv::media::color_storage< C > Class Template Reference

template implementation of color storage model More...

#include <color_storage.h>

Inheritance diagram for cgv::media::color_storage< C >:
cgv::media::abst_color_storage

Public Member Functions

 color_storage ()
 construct empty color storage
 
 color_storage (const color_storage< C > &csm)
 construct from color storage of same type
 
template<typename C1 >
 color_storage (const color_storage< C1 > &csm)
 construct from color storage of different type
 
 color_storage (const abst_color_storage &acsm)
 construct from abstract color storage of unknown type
 
abst_color_storageclone () const
 clone the color storage
 
size_t get_nr_colors () const
 return number colors stored in color storage
 
void resize (size_t nr_colors)
 resize to the given number of colors
 
const void * get_data_ptr () const
 return a const void pointer to the color data
 
const void * get_data_vector_ptr () const
 return a const void pointer to the color data vector
 
void * ref_data_ptr ()
 return a void pointer to the color data
 
void * ref_data_vector_ptr ()
 return a void pointer to the color data vector
 
void set_color (size_t i, const void *col_ptr)
 set i-th color to color of type stored in storage
 
void set_color (size_t i, const rgb &col)
 set i-th color from color of type rgb
 
void set_color (size_t i, const rgba &col)
 set i-th color from color of type rgba
 
void set_color (size_t i, const rgb8 &col)
 set i-th color from color of type rgb8
 
void set_color (size_t i, const rgba8 &col)
 set i-th color from color of type rgba8
 
void put_color (size_t i, void *col_ptr) const
 set color of type stored in storage to i-th color
 
void put_color (size_t i, rgb &col) const
 set color of type rgb to i-th color
 
void put_color (size_t i, rgba &col) const
 set color of type rgba to i-th color
 
void put_color (size_t i, rgb8 &col) const
 set color of type rgb8 to i-th color
 
void put_color (size_t i, rgba8 &col) const
 set color of type rgba8 to i-th color
 
- Public Member Functions inherited from cgv::media::abst_color_storage
 abst_color_storage (ColorType _color_type)
 construct from color type enumerate
 
virtual ~abst_color_storage ()
 virtual destructor ensures that std::vector defined in template class color_storage is destructed too
 
ColorType get_color_type () const
 return color type of color storage
 
size_t get_color_size () const
 return size of a single color in byte
 

Public Attributes

std::vector< C > colors
 

Additional Inherited Members

- Protected Attributes inherited from cgv::media::abst_color_storage
ColorType color_type
 

Detailed Description

template<typename C>
class cgv::media::color_storage< C >

template implementation of color storage model

Definition at line 79 of file color_storage.h.

Constructor & Destructor Documentation

◆ color_storage() [1/4]

template<typename C >
cgv::media::color_storage< C >::color_storage ( )
inline

construct empty color storage

Definition at line 84 of file color_storage.h.

Referenced by cgv::media::color_storage< C >::clone().

◆ color_storage() [2/4]

template<typename C >
cgv::media::color_storage< C >::color_storage ( const color_storage< C > &  csm)
inline

construct from color storage of same type

Definition at line 86 of file color_storage.h.

◆ color_storage() [3/4]

template<typename C >
template<typename C1 >
cgv::media::color_storage< C >::color_storage ( const color_storage< C1 > &  csm)
inline

construct from color storage of different type

Definition at line 90 of file color_storage.h.

◆ color_storage() [4/4]

template<typename C >
cgv::media::color_storage< C >::color_storage ( const abst_color_storage< C > &  acsm)
inline

construct from abstract color storage of unknown type

Definition at line 95 of file color_storage.h.

References cgv::media::abst_color_storage::get_color_type().

Member Function Documentation

◆ clone()

template<typename C >
abst_color_storage * cgv::media::color_storage< C >::clone ( ) const
inlinevirtual

clone the color storage

Implements cgv::media::abst_color_storage.

Definition at line 104 of file color_storage.h.

References cgv::media::color_storage< C >::color_storage().

◆ get_data_ptr()

template<typename C >
const void * cgv::media::color_storage< C >::get_data_ptr ( ) const
inlinevirtual

return a const void pointer to the color data

Implements cgv::media::abst_color_storage.

Definition at line 110 of file color_storage.h.

◆ get_data_vector_ptr()

template<typename C >
const void * cgv::media::color_storage< C >::get_data_vector_ptr ( ) const
inlinevirtual

return a const void pointer to the color data vector

Implements cgv::media::abst_color_storage.

Definition at line 111 of file color_storage.h.

◆ get_nr_colors()

template<typename C >
size_t cgv::media::color_storage< C >::get_nr_colors ( ) const
inlinevirtual

return number colors stored in color storage

Implements cgv::media::abst_color_storage.

Definition at line 108 of file color_storage.h.

◆ put_color() [1/5]

template<typename C >
void cgv::media::color_storage< C >::put_color ( size_t  i,
rgb col 
) const
inlinevirtual

set color of type rgb to i-th color

Implements cgv::media::abst_color_storage.

Definition at line 121 of file color_storage.h.

◆ put_color() [2/5]

template<typename C >
void cgv::media::color_storage< C >::put_color ( size_t  i,
rgb8 col 
) const
inlinevirtual

set color of type rgb8 to i-th color

Implements cgv::media::abst_color_storage.

Definition at line 123 of file color_storage.h.

◆ put_color() [3/5]

template<typename C >
void cgv::media::color_storage< C >::put_color ( size_t  i,
rgba col 
) const
inlinevirtual

set color of type rgba to i-th color

Implements cgv::media::abst_color_storage.

Definition at line 122 of file color_storage.h.

◆ put_color() [4/5]

template<typename C >
void cgv::media::color_storage< C >::put_color ( size_t  i,
rgba8 col 
) const
inlinevirtual

set color of type rgba8 to i-th color

Implements cgv::media::abst_color_storage.

Definition at line 124 of file color_storage.h.

◆ put_color() [5/5]

template<typename C >
void cgv::media::color_storage< C >::put_color ( size_t  i,
void *  col_ptr 
) const
inlinevirtual

set color of type stored in storage to i-th color

Implements cgv::media::abst_color_storage.

Definition at line 120 of file color_storage.h.

◆ ref_data_ptr()

template<typename C >
void * cgv::media::color_storage< C >::ref_data_ptr ( )
inlinevirtual

return a void pointer to the color data

Implements cgv::media::abst_color_storage.

Definition at line 112 of file color_storage.h.

◆ ref_data_vector_ptr()

template<typename C >
void * cgv::media::color_storage< C >::ref_data_vector_ptr ( )
inlinevirtual

return a void pointer to the color data vector

Implements cgv::media::abst_color_storage.

Definition at line 113 of file color_storage.h.

◆ resize()

template<typename C >
void cgv::media::color_storage< C >::resize ( size_t  nr_colors)
inlinevirtual

resize to the given number of colors

Implements cgv::media::abst_color_storage.

Definition at line 109 of file color_storage.h.

◆ set_color() [1/5]

template<typename C >
void cgv::media::color_storage< C >::set_color ( size_t  i,
const rgb col 
)
inlinevirtual

set i-th color from color of type rgb

Implements cgv::media::abst_color_storage.

Definition at line 116 of file color_storage.h.

◆ set_color() [2/5]

template<typename C >
void cgv::media::color_storage< C >::set_color ( size_t  i,
const rgb8 col 
)
inlinevirtual

set i-th color from color of type rgb8

Implements cgv::media::abst_color_storage.

Definition at line 118 of file color_storage.h.

◆ set_color() [3/5]

template<typename C >
void cgv::media::color_storage< C >::set_color ( size_t  i,
const rgba col 
)
inlinevirtual

set i-th color from color of type rgba

Implements cgv::media::abst_color_storage.

Definition at line 117 of file color_storage.h.

◆ set_color() [4/5]

template<typename C >
void cgv::media::color_storage< C >::set_color ( size_t  i,
const rgba8 col 
)
inlinevirtual

set i-th color from color of type rgba8

Implements cgv::media::abst_color_storage.

Definition at line 119 of file color_storage.h.

◆ set_color() [5/5]

template<typename C >
void cgv::media::color_storage< C >::set_color ( size_t  i,
const void *  col_ptr 
)
inlinevirtual

set i-th color to color of type stored in storage

Implements cgv::media::abst_color_storage.

Definition at line 115 of file color_storage.h.

Member Data Documentation

◆ colors

template<typename C >
std::vector<C> cgv::media::color_storage< C >::colors

Definition at line 82 of file color_storage.h.


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