00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __WPGBITMAP_H__
00028 #define __WPGBITMAP_H__
00029
00030 #include "WPGRect.h"
00031 #include "WPGColor.h"
00032 #include "WPGString.h"
00033
00034 namespace libwpg
00035 {
00036
00037 class WPGBitmap
00038 {
00039 public:
00040 WPGRect rect;
00041
00042 WPGBitmap(int width, int height);
00043
00044 WPGBitmap(int width, int height, bool verticalFlip, bool horizontalFlip);
00045
00046 WPGBitmap(const WPGBitmap&);
00047
00048 WPGBitmap& operator=(const WPGBitmap&);
00049
00050 void copyFrom(const WPGBitmap&);
00051
00052 ~WPGBitmap();
00053
00054
00055 int width() const;
00056
00057
00058 int height() const;
00059
00060 WPGColor pixel(int x, int y) const;
00061
00062 void setPixel(int x, int y, const WPGColor& color);
00063
00064 void generateBase64DIB(WPGString& bmp) const;
00065
00066 static void base64Encode(WPGString& base64, const char *data, const int len);
00067
00068 private:
00069 class Private;
00070 Private* const d;
00071 static void writeU16(char *buffer, unsigned &position, const int value);
00072 static void writeU32(char *buffer, unsigned &position, const int value);
00073 static void writeU8(char *buffer, unsigned &position, const int value);
00074 };
00075
00076 }
00077
00078 #endif // __WPGBITMAP_H__