44 #include <QtGui/private/qdrawhelper_p.h> 45 #if !defined(QT_NO_EGL) 46 #include <QtGui/private/qegl_p.h> 51 #include <QImageReader> 52 #include <QtGui/private/qimage_p.h> 53 #include <QtGui/private/qnativeimagehandleprovider_p.h> 54 #include <QtGui/private/qfont_p.h> 70 #if defined(Q_OS_SYMBIAN) 71 nativeImageHandleProvider = 0;
72 nativeImageHandle = 0;
74 #if !defined(QT_NO_EGL) 84 #if !defined(QT_NO_EGL) 93 if (
vgImage != VG_INVALID_HANDLE)
98 if (
vgImage != VG_INVALID_HANDLE)
107 #if defined(Q_OS_SYMBIAN) 108 releaseNativeImageHandle();
114 if (
vgImage != VG_INVALID_HANDLE) {
116 #if !defined(QT_NO_EGL) 133 #if defined(Q_OS_SYMBIAN) 134 releaseNativeImageHandle();
137 #if !defined(QT_NO_EGL) 153 return (
w > 0 &&
h > 0);
163 if (
w == wid &&
h == ht) {
188 Qt::ImageConversionFlags flags)
198 Qt::ImageConversionFlags flags)
210 Qt::ImageConversionFlags flags)
228 if (d == 1 || d == 16 || d == 24 || (d == 32 && !image->
hasAlphaChannel()))
251 if (convertedImage.
isNull())
252 qWarning(
"QVGPixmapData: Failed to convert image data (out of memory? try increasing heap size)");
347 return VG_INVALID_HANDLE;
349 #if !defined(QT_NO_EGL) 360 #if defined(Q_OS_SYMBIAN) 361 if (
recreate && nativeImageHandleProvider && !nativeImageHandle) {
362 createFromNativeImageHandleProvider();
366 if (
vgImage == VG_INVALID_HANDLE) {
371 if (
vgImage == VG_INVALID_HANDLE) {
372 return VG_INVALID_HANDLE;
397 #if !defined(QT_SHIVAVG) 400 return VG_INVALID_HANDLE;
410 (VG_sARGB_8888_PRE,
w,
h, VG_IMAGE_QUALITY_FASTER,
this);
413 (VG_sARGB_8888_PRE,
w,
h, VG_IMAGE_QUALITY_FASTER);
418 return VG_INVALID_HANDLE;
420 VGfloat matrix[20] = {
421 1.0f, 0.0f, 0.0f, 0.0f,
422 0.0f, 1.0f, 0.0f, 0.0f,
423 0.0f, 0.0f, 1.0f, 0.0f,
424 0.0f, 0.0f, 0.0f, opacity,
425 0.0f, 0.0f, 0.0f, 0.0f
453 #if defined(Q_OS_SYMBIAN) 456 skipHibernate &= !nativeImageHandleProvider;
495 qWarning(
"QVGPixmapData::metric(): Invalid metric");
532 #if defined(Q_OS_SYMBIAN) 535 nativeImageHandleProvider = 0;
565 return VG_INVALID_HANDLE;
571 return VG_INVALID_HANDLE;
virtual void useImage(QVGPixmapData *data)
The QColor class provides colors based on RGB, HSV or CMYK values.
void destroyImageAndContext()
Format
The following image formats are available in Qt.
VGImageFormat qt_vg_image_to_vg_format(QImage::Format format)
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
#define QT_END_NAMESPACE
This macro expands to.
QImage toImage() const
This will always perform a copy of the pixel data.
void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags)
void forceToImage(bool allowReadback=true)
virtual void ensureReadback(bool readOnly) const
void beginDataAccess() const
Q_GUI_EXPORT int qt_defaultDpiY()
void createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace)
bool open(OpenMode openMode)
Reimplemented Function
bool isNull() const
Returns true if it is a null image, otherwise returns false.
QVGPixmapData(PixelType type)
The QByteArray class provides an array of bytes.
Q_GUI_EXPORT int qt_defaultDpiX()
void setAlphaChannel(const QPixmap &alphaChannel)
Q_OPENVG_EXPORT QEglContext * qt_vg_create_context(QPaintDevice *device, int devType)
QImage::Format sourceFormat() const
int width() const
Returns the width of the rectangle.
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false...
long ASN1_INTEGER_get ASN1_INTEGER * a
The QBuffer class provides a QIODevice interface for a QByteArray.
int height() const
Returns the height of the rectangle.
The QString class provides a Unicode character string.
Q_DECL_CONSTEXPR T qAbs(const T &t)
void endDataAccess(bool readOnly=false) const
bool fromFile(const QString &filename, const char *format, Qt::ImageConversionFlags flags)
virtual VGImage createImageForPixmap(VGImageFormat format, VGint width, VGint height, VGbitfield allowedQuality, QVGPixmapData *data)
void copy(const QPixmapData *data, const QRect &rect)
QImage::Format idealFormat(QImage *image, Qt::ImageConversionFlags flags) const
void fill(uint pixelValue)
void fill(const QColor &color)
PixelType pixelType() const
static int qt_vg_pixmap_serial
virtual QPixmap alphaChannel() const
virtual QImage toImage() const =0
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual VGImage toVGImage()
Q_OPENVG_EXPORT void qt_vg_destroy_context(QEglContext *context, int devType)
Q_STATIC_INLINE_FUNCTION uint PREMUL(uint x)
Q_OPENVG_EXPORT EGLSurface qt_vg_shared_surface(void)
static QByteArray fromRawData(const char *, int size)
Constructs a QByteArray that uses the first size bytes of the data array.
bool hasAlphaChannel() const
void detach()
If multiple images share common data, this image makes a copy of the data and detaches itself from th...
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap &pixmap)
int depth() const
Returns the depth of the image.
uchar * bits()
Access to pixel data via bits() or constBits() should be guarded by begin/endDataAccess().
QPaintEngine * paintEngine() const
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
QImage::Format format() const
friend void qt_vg_register_pixmap(QVGPixmapData *pd)
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
The QImageReader class provides a format independent interface for reading images from files or other...
void fromImage(const QImage &image, Qt::ImageConversionFlags flags)
Q_GUI_EXPORT_INLINE int qGray(int r, int g, int b)
static QVGImagePool * instance()
int width() const
Returns the width of the image.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
bool checkForAlphaPixels() const
bool makeCurrent(EGLSurface surface)
bool hasAlphaChannel() const
The QRect class defines a rectangle in the plane using integer precision.
int height() const
Returns the height of the image.
bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags)
bool paintingActive() const
void resize(int width, int height)
The QPixmap class is an off-screen image representation that can be used as a paint device...
int metric(QPaintDevice::PaintDeviceMetric metric) const
virtual void detachImage(QVGPixmapData *data)
The QSize class defines the size of a two-dimensional object using integer point precision.
bool convertInPlace(QImage::Format newFormat, Qt::ImageConversionFlags)
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
void setSerialNumber(int serNo)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QImage & imageRef()
Returns a reference to the image that is potentially using some native buffer internally.
QImage read()
Reads an image from the device.
QRgb color(int i) const
Returns the color in the color table at index i.
virtual void detachImageFromPool()
virtual void releaseImage(QVGPixmapData *data, VGImage image)
Q_DECL_CONSTEXPR int qRound(qreal d)
virtual void reclaimImages()
friend void qt_vg_unregister_pixmap(QVGPixmapData *pd)
void copyFrom(QVolatileImage *source, const QRect &rect)
const uchar * constBits() const
QPaintEngine * paintEngine()
To be called from the PixmapData's paintEngine().
QPixmapData * pixmapData() const
QPixmapData * createCompatiblePixmapData() const
void setAlphaChannel(const QPixmap &alphaChannel)