kdeui Library API Documentation

kpixmapio.h

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