45 virtual void resize(
size_t nr_colors) = 0;
56 virtual void set_color(
size_t i,
const void* col_ptr) = 0;
66 virtual void put_color(
size_t i,
void* col_ptr)
const = 0;
82 std::vector<C> colors;
87 colors(csm.colors) { }
89 template <
typename C1>
91 for (
const auto& col : csm.colors)
92 colors.push_back(col);
97 case CT_RGB: new (this) color_storage<C>(static_cast<const color_storage<rgb>&>(acsm)); break;
98 case CT_RGBA: new (this) color_storage<C>(static_cast<const color_storage<rgba>&>(acsm)); break;
99 case CT_RGB8: new (this) color_storage<C>(static_cast<const color_storage<rgb8>&>(acsm)); break;
100 case CT_RGBA8: new (this) color_storage<C>(static_cast<const color_storage<rgba8>&>(acsm)); break;
109 void resize(
size_t nr_colors) { colors.resize(nr_colors); }
115 void set_color(
size_t i,
const void* col_ptr) { colors[i] = *
reinterpret_cast<const C*
>(col_ptr); }
120 void put_color(
size_t i,
void* col_ptr)
const { *
reinterpret_cast<C*
>(col_ptr) = colors[i]; }
129#include <cgv/config/lib_end.h>
this header is dependency free
cgv::media::color< cgv::type::uint8_type, cgv::media::RGB, cgv::media::OPACITY > rgba8
declare rgba color type with 8 bit components
cgv::media::color< float, cgv::media::RGB, cgv::media::OPACITY > rgba
declare rgba color type with 32 bit components
cgv::media::color< float, cgv::media::RGB > rgb
declare rgb color type with 32 bit components
cgv::media::color< cgv::type::uint8_type, cgv::media::RGB > rgb8
declare rgb color type with 8 bit components