summaryrefslogtreecommitdiffstats
path: root/tools/qmeegographicssystemhelper/qmeegolivepixmap.h
diff options
context:
space:
mode:
authorMichael Dominic K <mdk@codethink.co.uk>2010-10-07 16:51:50 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-10-07 17:01:56 (GMT)
commitdf61814c228e6f2badf378e25b69daf9941c646b (patch)
tree3382a9f0ca78e0fc68a6317a969962e5a36fa6e2 /tools/qmeegographicssystemhelper/qmeegolivepixmap.h
parente7db6cd0bddb7203c5460e97e2b8164bbaf420b8 (diff)
downloadQt-df61814c228e6f2badf378e25b69daf9941c646b.zip
Qt-df61814c228e6f2badf378e25b69daf9941c646b.tar.gz
Qt-df61814c228e6f2badf378e25b69daf9941c646b.tar.bz2
Live texture updates to meegographicssystem helper.
Merge-request: 848 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'tools/qmeegographicssystemhelper/qmeegolivepixmap.h')
-rw-r--r--tools/qmeegographicssystemhelper/qmeegolivepixmap.h35
1 files changed, 22 insertions, 13 deletions
diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h
index 2fa9db2..12fe994 100644
--- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h
+++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h
@@ -43,7 +43,6 @@
#define QMEEGOLIVEPIXMAP_H
#include <QPixmap>
-#include "qmeegoliveimage.h"
class QMeeGoLivePixmapPrivate;
class QSharedMemory;
@@ -56,13 +55,17 @@ class QImage;
class QMeeGoLivePixmap : public QPixmap
{
public:
- //! Creates new pixmap from the given QMeeGoLiveImage.
- /*!
- The created QMeeGoLivePixmap will be attached to the given QMeeGoLiveImage.
- Updates to the QMeeGoLiveImage will be represented on this newly created
- QMeeGoLivePixmap.
+ enum Format {
+ Format_RGB16, //! 16bit, 5-6-5 RGB format.
+ Format_ARGB32_Premultiplied //! 32bit, AARRGGBB format. The typical Qt format.
+ };
+
+ //! Creates and returns a new live pixmap with the given parameters.
+ /*!
+ The new pixmap is created with the given width w and the given height h.
+ The format specifies the color format used by the pixmap.
*/
- static QMeeGoLivePixmap* fromLiveImage(QMeeGoLiveImage *liveImage);
+ static QMeeGoLivePixmap* livePixmapWithSize(int w, int h, Format format);
//! Creates a new QMeeGoLivePixmap from the specified handle.
/*!
@@ -75,24 +78,30 @@ public:
The handle can be used to share QMeeGoLivePixmap cross-process.
*/
Qt::HANDLE handle();
+
+ //! Locks the access to the pixmap.
+ /*!
+ The returned image can be used for direct access.
+ */
+ QImage* lock();
+
+ //! Unlocks the access to the pixmap.
+ /*!
+ */
+ void release(QImage *img);
//! Destroys the QMeeGoLivePixmap.
/*!
- All QMeeGoLivePixmaps attached to a given QMeeGoLiveImage have to be destroyed
- before the QMeeGoLiveImage itself is destroyed.
*/
virtual ~QMeeGoLivePixmap();
private:
- QMeeGoLivePixmap(QPixmapData *p);
+ QMeeGoLivePixmap(QPixmapData *p, Qt::HANDLE h);
Q_DISABLE_COPY(QMeeGoLivePixmap)
Q_DECLARE_PRIVATE(QMeeGoLivePixmap)
protected:
QScopedPointer<QMeeGoLivePixmapPrivate> d_ptr; //! Private bits.
-
- friend class QMeeGoLiveImage;
- friend class QMeeGoLiveImagePrivate;
};
#endif