CBitmap Class Reference

Abstract implementation of CFile handling Bitmaps. More...

#include <cbitmap.h>

Inheritance diagram for CBitmap:

CFile CPixmap CWindowsBitmap

List of all members.

Public Member Functions

 CBitmap ()
 Default ctor.
virtual ~CBitmap ()
 Default dtor.
virtual void read (std::ifstream &in)=0
 Reads Windows Bitmap from filestream. On error an exception is thrown.
virtual void write (std::ofstream &out)=0
 Writes Windows Bitmap to filestream.
uint8_t * getPixelData ()
 Returns pointer to pixelbuffer.
std::map< uint32_t,
CPixelFormat::RGBPIXEL * > & 
getColorTable ()
 Returns reference to colortable.
uint32_t getRowSize ()
 Returns number of bytes of one row.
virtual const uint32_t getPixelDataSize ()=0
 Return size of pixelbuffer.
virtual const uint32_t getHeight ()=0
 Return height of bitmap in pixel.
virtual const uint32_t getWidth ()=0
 Return width of bitmap in pixel.
virtual const bool isMirrored ()=0
 Windows Bitmaps can be stored upside down.
virtual const bool hasColorTable ()=0
 Check if bitmap has a colortable (we don't support this yet for windows bitmaps).

Protected Member Functions

void callFunc (const std::string &func, const std::list< std::string > &params)
 Delegates the function and its parameters to the correct internal method.
void fillrect (std::list< std::string > params)
 Fills rectangle in image starting on position x, y width size width, height and color red, green, blue.
void invert (std::list< std::string > params)
 Invert image.
void brightness (std::list< std::string > params)
 Increase/decrease brightness of image.
void mirror_y (std::list< std::string > params)
 Mirror image around the y-axis.
void mirror_x (std::list< std::string > params)
 Mirror image around the x-axis.

Protected Attributes

uint8_t * m_pixeldata
std::map< uint32_t,
CPixelFormat::RGBPIXEL * > 
m_colortable
std::set
< CPixelFormat * > 
m_handlers
CPixelFormatm_pixelformat
uint32_t m_rowsize


Detailed Description

Abstract implementation of CFile handling Bitmaps.

Modulname:
cbitmap
Author:
Guenther Neuwirth (0626638), Manuel Mausz (0728348)
Date:
17.04.2009
Implementation of CFile handling Bitmaps.

In order to support operations on bitmaps with different color bitcounts different implementations of CPixelFormat are used. These classes are allowed to modify the bitmap headers and pixelbuffer directly.

On error CFile::FileError is thrown.


Constructor & Destructor Documentation

CBitmap::CBitmap (  )  [inline]

Default ctor.

Methodname:
CBitmap
Parameters:
- 
Returns:
-
Global variables used:
none
Exceptions:
none 
Conditions:
none

CBitmap::~CBitmap (  )  [virtual]

Default dtor.

Methodname:
~CBitmap
Parameters:
- 
Returns:
-
Global variables used:
none
Exceptions:
none 
Conditions:
none


Member Function Documentation

virtual void CBitmap::read ( std::ifstream &  in  )  [pure virtual]

Reads Windows Bitmap from filestream. On error an exception is thrown.

Methodname:
read
Parameters:
in filestream to read data from
Returns:
-
Global variables used:
none
Exceptions:
CFile::FileError 
bad_alloc 
Conditions:
none

Implements CFile.

Implemented in CPixmap, and CWindowsBitmap.

virtual void CBitmap::write ( std::ofstream &  out  )  [pure virtual]

Writes Windows Bitmap to filestream.

Methodname:
write
Parameters:
out filestream to read data from
Returns:
-
Global variables used:
none
Exceptions:
FileError 
bad_alloc 
Conditions:
none

Implements CFile.

Implemented in CPixmap, and CWindowsBitmap.

uint8_t* CBitmap::getPixelData (  )  [inline]

Returns pointer to pixelbuffer.

Methodname:
getPixelData
Parameters:
- 
Returns:
pointer to pixelbuffer
Global variables used:
none
Exceptions:
none 
Conditions:
none

std::map<uint32_t, CPixelFormat::RGBPIXEL *>& CBitmap::getColorTable (  )  [inline]

Returns reference to colortable.

Methodname:
getColorTable
Parameters:
- 
Returns:
reference to colortable
Global variables used:
none
Exceptions:
none 
Conditions:
none

uint32_t CBitmap::getRowSize (  )  [inline]

Returns number of bytes of one row.

Methodname:
getRowSize
Parameters:
- 
Returns:
number of bytes of one row
Global variables used:
none
Exceptions:
none 
Conditions:
none

virtual const uint32_t CBitmap::getPixelDataSize (  )  [pure virtual]

Return size of pixelbuffer.

Methodname:
getPixelDataSize
Parameters:
- 
Returns:
size of pixelbuffer
Global variables used:
none
Exceptions:
none 
Conditions:
none

Implemented in CPixmap, and CWindowsBitmap.

virtual const uint32_t CBitmap::getHeight (  )  [pure virtual]

Return height of bitmap in pixel.

Methodname:
getHeight
Parameters:
- 
Returns:
height of bitmap in pixel
Global variables used:
none
Exceptions:
none 
Conditions:
none

Implemented in CPixmap, and CWindowsBitmap.

virtual const uint32_t CBitmap::getWidth (  )  [pure virtual]

Return width of bitmap in pixel.

Methodname:
getWidth
Parameters:
- 
Returns:
width of bitmap in pixel
Global variables used:
none
Exceptions:
none 
Conditions:
none

Implemented in CPixmap, and CWindowsBitmap.

virtual const bool CBitmap::isMirrored (  )  [pure virtual]

Windows Bitmaps can be stored upside down.

Methodname:
isMirrored
Parameters:
- 
Returns:
true if bitmap is stored upside down. false otherwise
Global variables used:
none
Exceptions:
none 
Conditions:
none

Implemented in CPixmap, and CWindowsBitmap.

virtual const bool CBitmap::hasColorTable (  )  [pure virtual]

Check if bitmap has a colortable (we don't support this yet for windows bitmaps).

Methodname:
hasColorTable
Parameters:
- 
Returns:
true if bitmap has a colortable. false otherwise
Global variables used:
none
Exceptions:
none 
Conditions:
none

Implemented in CPixmap, and CWindowsBitmap.

void CBitmap::callFunc ( const std::string &  func,
const std::list< std::string > &  params 
) [protected, virtual]

Delegates the function and its parameters to the correct internal method.

Methodname:
callFunc
Parameters:
func function name
params function parameters as list
Returns:
-
Global variables used:
none
Exceptions:
ParserError 
Conditions:
none

Implements CFile.

void CBitmap::fillrect ( std::list< std::string >  params  )  [protected]

Fills rectangle in image starting on position x, y width size width, height and color red, green, blue.

Methodname:
fillrect
Parameters:
params function parameters as list
Returns:
-
Global variables used:
none
Exceptions:
FileError 
Conditions:
none
Scriptfile syntax: fillrect(x, y, width, height, red, green, blue)

void CBitmap::invert ( std::list< std::string >  params  )  [protected]

Invert image.

Methodname:
invert
Parameters:
params function parameters as list
Returns:
-
Global variables used:
none
Exceptions:
FileError 
Conditions:
none
Scriptfile syntax: invert()

void CBitmap::brightness ( std::list< std::string >  params  )  [protected]

Increase/decrease brightness of image.

Methodname:
brightness
Parameters:
params function parameters as list
Returns:
-
Global variables used:
none
Exceptions:
FileError 
Conditions:
none
Scriptfile syntax: brightness(factor)

void CBitmap::mirror_y ( std::list< std::string >  params  )  [protected]

Mirror image around the y-axis.

Methodname:
mirror_y
Parameters:
params function parameters as list
Returns:
-
Global variables used:
none
Exceptions:
FileError 
Conditions:
none
Scriptfile syntax: mirror_y()

void CBitmap::mirror_x ( std::list< std::string >  params  )  [protected]

Mirror image around the x-axis.

Methodname:
mirror_x
Parameters:
params function parameters as list
Returns:
-
Global variables used:
none
Exceptions:
FileError 
Conditions:
none
Scriptfile syntax: mirror_y()


Member Data Documentation

uint8_t* CBitmap::m_pixeldata [protected]

pointer to pixelbuffer

std::map<uint32_t, CPixelFormat::RGBPIXEL *> CBitmap::m_colortable [protected]

colortable map

std::set<CPixelFormat *> CBitmap::m_handlers [protected]

set of supported PixelFormat handlers

CPixelFormat* CBitmap::m_pixelformat [protected]

pointer to CPixelFormat implementation

uint32_t CBitmap::m_rowsize [protected]

number of bytes of one row in the image


The documentation for this class was generated from the following files:
Generated on Sat May 2 18:58:11 2009 for imgsynth2 by  doxygen 1.5.3