#include <cbitmap.h>

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 > ¶ms) |
| 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 |
| CPixelFormat * | m_pixelformat |
| uint32_t | m_rowsize |
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.
| CBitmap::CBitmap | ( | ) | [inline] |
Default ctor.
| - |
| none |
| CBitmap::~CBitmap | ( | ) | [virtual] |
Default dtor.
| - |
| none |
| virtual void CBitmap::read | ( | std::ifstream & | in | ) | [pure virtual] |
Reads Windows Bitmap from filestream. On error an exception is thrown.
| in | filestream to read data from |
| CFile::FileError | ||
| bad_alloc |
Implements CFile.
Implemented in CPixmap, and CWindowsBitmap.
| virtual void CBitmap::write | ( | std::ofstream & | out | ) | [pure virtual] |
Writes Windows Bitmap to filestream.
| out | filestream to read data from |
| FileError | ||
| bad_alloc |
Implements CFile.
Implemented in CPixmap, and CWindowsBitmap.
| uint8_t* CBitmap::getPixelData | ( | ) | [inline] |
Returns pointer to pixelbuffer.
| - |
| none |
| std::map<uint32_t, CPixelFormat::RGBPIXEL *>& CBitmap::getColorTable | ( | ) | [inline] |
Returns reference to colortable.
| - |
| none |
| uint32_t CBitmap::getRowSize | ( | ) | [inline] |
Returns number of bytes of one row.
| - |
| none |
| virtual const uint32_t CBitmap::getPixelDataSize | ( | ) | [pure virtual] |
Return size of pixelbuffer.
| - |
| none |
Implemented in CPixmap, and CWindowsBitmap.
| virtual const uint32_t CBitmap::getHeight | ( | ) | [pure virtual] |
Return height of bitmap in pixel.
| - |
| none |
Implemented in CPixmap, and CWindowsBitmap.
| virtual const uint32_t CBitmap::getWidth | ( | ) | [pure virtual] |
Return width of bitmap in pixel.
| - |
| none |
Implemented in CPixmap, and CWindowsBitmap.
| virtual const bool CBitmap::isMirrored | ( | ) | [pure virtual] |
Windows Bitmaps can be stored upside down.
| - |
| 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).
| - |
| 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.
| func | function name | |
| params | function parameters as list |
| ParserError |
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.
| params | function parameters as list |
| FileError |
| void CBitmap::invert | ( | std::list< std::string > | params | ) | [protected] |
Invert image.
| params | function parameters as list |
| FileError |
| void CBitmap::brightness | ( | std::list< std::string > | params | ) | [protected] |
Increase/decrease brightness of image.
| params | function parameters as list |
| FileError |
| void CBitmap::mirror_y | ( | std::list< std::string > | params | ) | [protected] |
Mirror image around the y-axis.
| params | function parameters as list |
| FileError |
| void CBitmap::mirror_x | ( | std::list< std::string > | params | ) | [protected] |
Mirror image around the x-axis.
| params | function parameters as list |
| FileError |
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
1.5.3