kpixmapio.h
/* vi: ts=8 sts=4 sw=4
*
*
* This file is part of the KDE project, module kdeui.
* Copyright (C) 2000 Geert Jansen <jansen@kde.org>
*
* You can Freely distribute this program under the GNU Library General
* Public License. See the file "COPYING.LIB" for the exact licensing terms.
*/
#ifndef __KPixmapIO_h_Included__
#define __KPixmapIO_h_Included__
#include <kdelibs_export.h>
class QPixmap;
class QImage;
class QPoint;
class QRect;
struct KPixmapIOPrivate;
class KDEUI_EXPORT KPixmapIO
{
public:
KPixmapIO();
~KPixmapIO();
QPixmap convertToPixmap(const QImage &image);
QImage convertToImage(const QPixmap &pixmap);
void putImage(QPixmap *dst, int dx, int dy, const QImage *src);
void putImage(QPixmap *dst, const QPoint &offset, const QImage *src);
QImage getImage(const QPixmap *src, int sx, int sy, int sw, int sh);
QImage getImage(const QPixmap *src, const QRect &rect);
enum ShmPolicies {
ShmDontKeep,
ShmKeepAndGrow
};
void setShmPolicy(int policy);
void preAllocShm(int size);
private:
/*
* Supported XImage byte orders. The notation ARGB means bytes
* containing A:R:G:B succeed in memory.
*/
enum ByteOrders {
bo32_ARGB, bo32_BGRA, bo24_RGB, bo24_BGR,
bo16_RGB_565, bo16_BGR_565, bo16_RGB_555,
bo16_BGR_555, bo8
};
bool m_bShm;
bool initXImage(int w, int h);
void doneXImage();
bool createXImage(int w, int h);
void destroyXImage();
bool createShmSegment(int size);
void destroyShmSegment();
void convertToXImage(const QImage &);
QImage convertFromXImage();
private:
KPixmapIOPrivate* d;
};
#endif // __KPixmapIO_h_Included__
KPixmapIO::ShmPolicies
ShmPolicies
Shared memory allocation policies.
Definition: kpixmapio.h:142
KPixmapIO
Fast QImage to/from QPixmap conversion.
Definition: kpixmapio.h:87

KDE Home | KDE Accessibility Home | Description of Access Keys