Claw  1.7.3
Public Types | Public Member Functions | List of all members
claw::graphic::color_palette< Color > Class Template Reference

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_typeoperator[] (unsigned int i)
 Get a color from the palette.
const color_typeoperator[] (unsigned int i) const
 Get the value of a color from the palette.
const color_typeoperator() (unsigned int i) const
 Get the value of a color from the palette.

Detailed Description

template<typename Color>
class claw::graphic::color_palette< Color >

A palette of colors, for palettized images.

Author
Julien Jorge

Definition at line 44 of file color_palette.hpp.

Constructor & Destructor Documentation

template<typename Color >
claw::graphic::color_palette< Color >::color_palette ( unsigned int  n)

Constructor.

Parameters
nThe size of the palette.

Definition at line 38 of file color_palette.tpp.

Member Function Documentation

template<typename Color >
const claw::graphic::color_palette< Color >::color_type & claw::graphic::color_palette< Color >::operator() ( unsigned int  i) const

Get the value of a color from the palette.

Parameters
iThe index of the color.
Precondition
i is a valid color index.

Definition at line 92 of file color_palette.tpp.

template<typename Color >
claw::graphic::color_palette< Color >::color_type & claw::graphic::color_palette< Color >::operator[] ( unsigned int  i)

Get a color from the palette.

Parameters
iThe index of the color.
Precondition
i is a valid color index.

Definition at line 62 of file color_palette.tpp.

template<typename Color >
const claw::graphic::color_palette< Color >::color_type & claw::graphic::color_palette< Color >::operator[] ( unsigned int  i) const

Get the value of a color from the palette.

Parameters
iThe index of the color.
Precondition
i is a valid color index.

Definition at line 77 of file color_palette.tpp.


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