A palette of colors, for palettized images. More...
#include <color_palette.hpp>
Public Types | |
typedef Color | color_type |
The type of the colors stored in the palette. | |
Public Member Functions | |
color_palette (unsigned int n) | |
Constructor. | |
unsigned int | size () const |
Get the number of colors in the palette. | |
color_type & | operator[] (unsigned int i) |
Get a color from the palette. | |
const color_type & | operator[] (unsigned int i) const |
Get the value of a color from the palette. | |
const color_type & | operator() (unsigned int i) const |
Get the value of a color from the palette. | |
Private Attributes | |
std::vector< color_type > | m_palette |
The colors in the palette. |
A palette of colors, for palettized images.
Definition at line 42 of file color_palette.hpp.
typedef Color claw::graphic::color_palette< Color >::color_type |
The type of the colors stored in the palette.
Definition at line 46 of file color_palette.hpp.
claw::graphic::color_palette< Color >::color_palette | ( | unsigned int | n | ) | [inline] |
Constructor.
n | The size of the palette. |
Definition at line 38 of file color_palette.tpp.
00039 : m_palette(n) 00040 { 00041 00042 } // color_palette::color_palette()
const claw::graphic::color_palette< Color >::color_type & claw::graphic::color_palette< Color >::operator() | ( | unsigned int | i | ) | const [inline] |
Get the value of a color from the palette.
i | The index of the color. |
Definition at line 92 of file color_palette.tpp.
References claw::graphic::color_palette< Color >::m_palette.
const claw::graphic::color_palette< Color >::color_type & claw::graphic::color_palette< Color >::operator[] | ( | unsigned int | i | ) | const [inline] |
Get the value of a color from the palette.
i | The index of the color. |
Definition at line 77 of file color_palette.tpp.
References claw::graphic::color_palette< Color >::m_palette.
claw::graphic::color_palette< Color >::color_type & claw::graphic::color_palette< Color >::operator[] | ( | unsigned int | i | ) | [inline] |
Get a color from the palette.
i | The index of the color. |
Definition at line 62 of file color_palette.tpp.
References claw::graphic::color_palette< Color >::m_palette.
unsigned int claw::graphic::color_palette< Color >::size | ( | ) | const [inline] |
Get the number of colors in the palette.
Definition at line 49 of file color_palette.tpp.
References claw::graphic::color_palette< Color >::m_palette.
Referenced by claw::graphic::bitmap::reader::load_4bpp_rgb(), claw::graphic::bitmap::reader::load_4bpp_rle(), claw::graphic::bitmap::reader::load_8bpp_rgb(), claw::graphic::bitmap::reader::load_8bpp_rle(), claw::graphic::bitmap::reader::load_palette(), and claw::graphic::targa::reader::load_palette_content().
00050 { 00051 return m_palette.size(); 00052 } // color_palette::size()
std::vector<color_type> claw::graphic::color_palette< Color >::m_palette [private] |
The colors in the palette.
Definition at line 60 of file color_palette.hpp.
Referenced by claw::graphic::color_palette< Color >::operator()(), claw::graphic::color_palette< Color >::operator[](), and claw::graphic::color_palette< Color >::size().