Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Palette Class Reference

Holds a fixed size colour palette. More...

#include <Palette.h>

List of all members.

Public Methods

 Palette (int ncolours)
 Constructor.

 ~Palette (void)
 Destructor.

int inq_ncolours (void) const
rgbcolour_tinq_colours (void) const
float * inq_linear_colours (void) const
void resize (int)
 Resizes this Palette to contain the given number of colours.

void randomise (void)
 Randomly sets the colours in the palette, except the last colour which is set to black.

palette_t inq_type (void) const
void set_type (palette_t type)
rgbcolour_t inq_main_colour (void) const
void set_main_colour (rgbcolour_t col)
 Sets the last colour in the palette, which is used for pixels that have reached the maximum number of iterations without diverging.

double gamma_correct (double linear_col) const

Private Methods

void init (int ncolours)
 Initialises this Palette to the given size.

void randomise_bright (void)
 Fills the palette with randomly selected bright colours.

void randomise_pastel (void)
 Fills the palette with randomly selected pastel colours.

void randomise_monochrome (void)
 Fills the palette with randomly selected shades of gray.

void set_white (void)
 Sets the palette to all white, except the last entry which is set to the main colour.

void update_linear_colours (void)
 This is called whenever the colours in the palette are changed.


Private Attributes

palette_t m_type
 Palette type.

rgbcolour_t m_main_colour
 Specifies the last colour in the palette, which is used for pixels that have reached the maximum number of iterations without diverging.

int m_ncolours
 Number of colours in the palette.

rgbcolour_tm_colours
 The colours in the palette.

float * m_linear_colours
 The colours in the palette, transformed into a linear colour space for anti-aliasing.


Detailed Description

Holds a fixed size colour palette.


Constructor & Destructor Documentation

Palette::Palette int    ncolours
 

Constructor.

Palette::~Palette void   
 

Destructor.


Member Function Documentation

double Palette::gamma_correct double    linear_col const
 

Returns:
Returns the gamma corrected colour given the linear colour.

void Palette::init int    ncolours [private]
 

Initialises this Palette to the given size.

rgbcolour_t* Palette::inq_colours void    const [inline]
 

float* Palette::inq_linear_colours void    const [inline]
 

rgbcolour_t Palette::inq_main_colour void    const [inline]
 

int Palette::inq_ncolours void    const [inline]
 

palette_t Palette::inq_type void    const [inline]
 

void Palette::randomise void   
 

Randomly sets the colours in the palette, except the last colour which is set to black.

void Palette::randomise_bright void    [private]
 

Fills the palette with randomly selected bright colours.

void Palette::randomise_monochrome void    [private]
 

Fills the palette with randomly selected shades of gray.

void Palette::randomise_pastel void    [private]
 

Fills the palette with randomly selected pastel colours.

void Palette::resize int    ncolours
 

Resizes this Palette to contain the given number of colours.

void Palette::set_main_colour rgbcolour_t    col
 

Sets the last colour in the palette, which is used for pixels that have reached the maximum number of iterations without diverging.

void Palette::set_type palette_t    type [inline]
 

void Palette::set_white void    [private]
 

Sets the palette to all white, except the last entry which is set to the main colour.

void Palette::update_linear_colours void    [private]
 

This is called whenever the colours in the palette are changed.


Member Data Documentation

rgbcolour_t* Palette::m_colours [private]
 

The colours in the palette.

The last colour in the palette will be 'm_main_colour'. The size of this array is 'm_ncolours'.

float* Palette::m_linear_colours [private]
 

The colours in the palette, transformed into a linear colour space for anti-aliasing.

Each colour is stored as 3 floats, in the order red, green, blue. Each colour component is in the range [0,1] The size of this array is therefore 3 x 'm_ncolours'

rgbcolour_t Palette::m_main_colour [private]
 

Specifies the last colour in the palette, which is used for pixels that have reached the maximum number of iterations without diverging.

int Palette::m_ncolours [private]
 

Number of colours in the palette.

palette_t Palette::m_type [private]
 

Palette type.

This determines the types of colours that are randomly generated.


The documentation for this class was generated from the following files:
Generated on Sun Jul 21 11:52:18 2002 for FractalViewer by doxygen1.2.16