ColorMap Class Reference

#include <ColorMap.hpp>

Collaboration diagram for ColorMap:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class represents a 2d pixel map of colors.

Definition at line 45 of file ColorMap.hpp.

Public Member Functions

 ColorMap ()
 Default constructor.
 ColorMap (const ColorMap &o)
 Copy constructor.
 ColorMap (const InterpolatedColorMap &o)
 Convert constructor.
 ColorMap (const Palette &p, double dir=90, int num=256)
 Convert constructor.
 ColorMap (int icols, int irows, const Color &base=Color::BLACK)
 Constructor.
 ~ColorMap ()
 Destructor.
ColorMapoperator= (ColorMap o)
 Copy operator.
void setColor (int row, int col, const Color &color)
 Set the color at a row and column.
Color get (int row, int col) const
 Get the color at a row and column.
int getCols () const
 Get the cols of the map.
int getRows () const
 Get the rows of the map.

Protected Member Functions

void init (int icols, int irows)
 Initialization helper.
void reset ()
 Reset helper.

Protected Attributes

int cols
 Width of the map.
int rows
 Height of the map.
Color ** c
 Color array.


Constructor & Destructor Documentation

ColorMap  )  [inline]
 

Default constructor.

Definition at line 49 of file ColorMap.hpp.

ColorMap const ColorMap o  ) 
 

Copy constructor.

ColorMap const InterpolatedColorMap o  ) 
 

Convert constructor.

ColorMap const Palette p,
double  dir = 90,
int  num = 256
[inline]
 

Convert constructor.

Definition at line 65 of file ColorMap.hpp.

References Palette::getColor().

ColorMap int  icols,
int  irows,
const Color base = Color::BLACK
 

Constructor.

Parameters:
icols Width of the map
irows Height of the map
base Base color for the map to be initialized to

~ColorMap  )  [inline]
 

Destructor.

Definition at line 88 of file ColorMap.hpp.


Member Function Documentation

Color get int  row,
int  col
const [inline]
 

Get the color at a row and column.

Definition at line 112 of file ColorMap.hpp.

Referenced by PSImageBase::bitmap(), and PNG::data().

int getCols  )  const [inline]
 

Get the cols of the map.

Definition at line 115 of file ColorMap.hpp.

Referenced by PSImageBase::bitmap(), PNG::cost_constant(), and PNG::data().

int getRows  )  const [inline]
 

Get the rows of the map.

Definition at line 118 of file ColorMap.hpp.

Referenced by PSImageBase::bitmap(), PNG::cost_constant(), and PNG::data().

void init int  icols,
int  irows
[protected]
 

Initialization helper.

ColorMap& operator= ColorMap  o  ) 
 

Copy operator.

This is in replacement for operators like:

  • ColorMap& operator=(const ColorMap& o);
  • ColorMap& operator=(const InterpolatedColorMap& ic);

As this is what happens:

 InterpolatedColorMap ic(...);  
 ...; //init ic
 ColorMap c;
 c = ic; // c.operator=(ColorMap(ic));
 ColorMap c2 = ic // c2(ic);

void reset  )  [protected]
 

Reset helper.

void setColor int  row,
int  col,
const Color color
[inline]
 

Set the color at a row and column.

Definition at line 109 of file ColorMap.hpp.


Member Data Documentation

Color** c [protected]
 

Color array.

Definition at line 134 of file ColorMap.hpp.

int cols [protected]
 

Width of the map.

Definition at line 128 of file ColorMap.hpp.

int rows [protected]
 

Height of the map.

Definition at line 131 of file ColorMap.hpp.


The documentation for this class was generated from the following file:
Generated on Tue Feb 7 03:31:24 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1