kdeui Library API Documentation

kpixmapio.h

00001 /* vi: ts=8 sts=4 sw=4
00002  *
00003  *
00004  * This file is part of the KDE project, module kdeui.
00005  * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
00006  *
00007  * You can Freely distribute this program under the GNU Library General
00008  * Public License. See the file "COPYING.LIB" for the exact licensing terms.
00009  */
00010 
00011 #ifndef __KPixmapIO_h_Included__
00012 #define __KPixmapIO_h_Included__
00013 
00014 class QPixmap;
00015 class QImage;
00016 class QPoint;
00017 class QRect;
00018 class KPixmapIOPrivate;
00085 class KPixmapIO
00086 {
00087 public:
00088     KPixmapIO();
00089     ~KPixmapIO();
00090 
00096     QPixmap convertToPixmap(const QImage &image);
00097 
00103     QImage convertToImage(const QPixmap &pixmap);
00104 
00112     void putImage(QPixmap *dst, int dx, int dy, const QImage *src);
00113 
00118     void putImage(QPixmap *dst, const QPoint &offset, const QImage *src);
00119 
00129     QImage getImage(const QPixmap *src, int sx, int sy, int sw, int sh);
00130 
00135     QImage getImage(const QPixmap *src, const QRect &rect);
00136 
00140     enum ShmPolicies {
00141     ShmDontKeep,
00142     ShmKeepAndGrow
00143     };
00144 
00150     void setShmPolicy(int policy);
00151 
00157     void preAllocShm(int size);
00158 
00159 private:
00160     /*
00161      * Supported XImage byte orders. The notation ARGB means bytes
00162      * containing A:R:G:B succeed in memory.
00163      */
00164     enum ByteOrders {
00165     bo32_ARGB, bo32_BGRA, bo24_RGB, bo24_BGR,
00166     bo16_RGB_565, bo16_BGR_565, bo16_RGB_555,
00167     bo16_BGR_555, bo8
00168     };
00169 
00170     bool m_bShm;
00171     bool initXImage(int w, int h);
00172     void doneXImage();
00173     bool createXImage(int w, int h);
00174     void destroyXImage();
00175     bool createShmSegment(int size);
00176     void destroyShmSegment();
00177     void convertToXImage(const QImage &);
00178     QImage convertFromXImage();
00179 private:
00180     KPixmapIOPrivate* d;
00181 };
00182 
00183 #endif // __KPixmapIO_h_Included__
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Nov 27 13:43:11 2004 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003