diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-07-15 17:55:41 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-07-19 08:35:06 +0200 |
commit | 5abf4f55b1bd1180ea2dbfb867a48364bc89af80 (patch) | |
tree | 4cfc6d00e56c791d244953df956281d4572c1dbb /src/gui/image/qbmphandler_p.h | |
parent | bc0a0281d535079745ed1544a063571b86ca718e (diff) |
Images: Implement internal DIB image plugin.
For use for clipboard/DnD operations on Windows by its
Lighthouse plugin (to prevent having to export qt_read_dib(),
qt_write_dib()).
Change-Id: I79e69bf7cecb16cc47ea29de6805fc52e4df1007
Reviewed-on: http://codereview.qt.nokia.com/1714
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
Diffstat (limited to 'src/gui/image/qbmphandler_p.h')
-rw-r--r-- | src/gui/image/qbmphandler_p.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/image/qbmphandler_p.h b/src/gui/image/qbmphandler_p.h index 070d904b77..373f8fbaaf 100644 --- a/src/gui/image/qbmphandler_p.h +++ b/src/gui/image/qbmphandler_p.h @@ -81,10 +81,20 @@ struct BMP_INFOHDR { // BMP information header qint32 biClrImportant; // number of important colors }; +// BMP-Handler, which is also able to read and write the DIB +// (Device-Independent-Bitmap) format used internally in the Windows operating +// system for OLE/clipboard operations. DIB is a subset of BMP (without file +// header). The Windows-Lighthouse plugin accesses the DIB-functionality. + class QBmpHandler : public QImageIOHandler { public: - QBmpHandler(); + enum InternalFormat { + DibFormat, + BmpFormat + }; + + explicit QBmpHandler(InternalFormat fmt = BmpFormat); bool canRead() const; bool read(QImage *image); bool write(const QImage &image); @@ -99,11 +109,16 @@ public: private: bool readHeader(); + inline QByteArray formatName() const; + enum State { Ready, ReadHeader, Error }; + + const InternalFormat m_format; + State state; BMP_FILEHDR fileHeader; BMP_INFOHDR infoHeader; |