libwpg: WPGBitmap.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

# 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(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         // return width in pixel
    00055         int width() const;
    00056
    00057         // return height in pixel
    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 } // namespace libwpg
    00077
    00078 #endif // __WPGBITMAP_H__