WPGBitmap.h

Go to the documentation of this file.
00001 /* libwpg
00002  * Copyright (C) 2007 Ariya Hidayat (ariya@kde.org)
00003  * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the
00017  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA  02111-1301 USA
00019  *
00020  * For further information visit http://libwpg.sourceforge.net
00021  */
00022 
00023 /* "This product is not manufactured, approved, or supported by
00024  * Corel Corporation or Corel Corporation Limited."
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(const WPGBitmap&);
00045 
00046         WPGBitmap& operator=(const WPGBitmap&);
00047 
00048         void copyFrom(const WPGBitmap&);
00049 
00050         ~WPGBitmap();
00051 
00052         // return width in pixel
00053         int width() const;
00054 
00055         // return height in pixel
00056         int height() const;
00057 
00058         WPGColor pixel(int x, int y) const;
00059 
00060         void setPixel(int x, int y, const WPGColor& color);
00061         
00062         void generateBase64DIB(WPGString& bmp) const;
00063 
00064         static void base64Encode(WPGString& base64, const char *data, const int len);
00065 
00066 private:
00067         class Private;
00068         Private* const d;
00069         static void writeU16(char *buffer, unsigned &position, const int value);
00070         static void writeU32(char *buffer, unsigned &position, const int value);
00071         static void writeU8(char *buffer, unsigned &position, const int value);
00072 };
00073 
00074 } // namespace libwpg
00075 
00076 #endif // __WPGBITMAP_H__

Generated on Sun Jan 4 18:43:37 2009 for libwpg by doxygen 1.4.6