Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qimagepixmapcleanuphooks_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QIMAGEPIXMAP_CLEANUPHOOKS_P_H
5#define QIMAGEPIXMAP_CLEANUPHOOKS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/private/qtguiglobal_p.h>
19#include <QtGui/qpixmap.h>
20
22
24typedef void (*_qt_pixmap_cleanup_hook_pmd)(QPlatformPixmap*);
25
26
27class QImagePixmapCleanupHooks;
28
29class Q_GUI_EXPORT QImagePixmapCleanupHooks
30{
31public:
32 static QImagePixmapCleanupHooks *instance();
33
34 static void enableCleanupHooks(const QImage &image);
35 static void enableCleanupHooks(const QPixmap &pixmap);
36 static void enableCleanupHooks(QPlatformPixmap *handle);
37
38 static bool isImageCached(const QImage &image);
39 static bool isPixmapCached(const QPixmap &pixmap);
40
41 // Gets called when a pixmap data is about to be modified:
42 void addPlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd);
43
44 // Gets called when a pixmap data is about to be destroyed:
45 void addPlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd);
46
47 // Gets called when an image is about to be modified or destroyed:
48 void addImageHook(_qt_image_cleanup_hook_64);
49
50 void removePlatformPixmapModificationHook(_qt_pixmap_cleanup_hook_pmd);
51 void removePlatformPixmapDestructionHook(_qt_pixmap_cleanup_hook_pmd);
52 void removeImageHook(_qt_image_cleanup_hook_64);
53
54 static void executePlatformPixmapModificationHooks(QPlatformPixmap*);
55 static void executePlatformPixmapDestructionHooks(QPlatformPixmap*);
56 static void executeImageHooks(qint64 key);
57
58private:
59 QList<_qt_image_cleanup_hook_64> imageHooks;
60 QList<_qt_pixmap_cleanup_hook_pmd> pixmapModificationHooks;
61 QList<_qt_pixmap_cleanup_hook_pmd> pixmapDestructionHooks;
62};
63
64QT_END_NAMESPACE
65
66#endif // QIMAGEPIXMAP_CLEANUPHOOKS_P_H
The QColorTransform class is a transformation between color spaces.
QColorTransform(QColorTransform &&colorTransform)=default
friend bool operator!=(const QColorTransform &ct1, const QColorTransform &ct2)
QColorTransform & operator=(const QColorTransform &other) noexcept
QColorTransform() noexcept=default
Q_GUI_EXPORT ~QColorTransform()
friend bool operator==(const QColorTransform &ct1, const QColorTransform &ct2)
\inmodule QtCore\reentrant
Definition qdatastream.h:50
QString errorString() const
Returns a human readable description of the last error that occurred.
void setDevice(QIODevice *device)
Sets QImageReader's device to device.
int quality() const
Returns the quality setting of the image format.
QString fileName() const
If the currently assigned device is a QFile, or if setFileName() has been called, this function retur...
QImageIOHandler::Transformations transformation() const
QIODevice * device() const
Returns the device currently assigned to QImageReader, or \nullptr if no device has been assigned.
QByteArray subType() const
bool supportsOption(QImageIOHandler::ImageOption option) const
Returns true if the reader supports option; otherwise returns false.
QList< QByteArray > supportedSubTypes() const
QByteArray format() const
Returns the format QImageReader uses for reading images.
void setQuality(int quality)
Sets the quality setting of the image format to quality.
ImageReaderError error() const
Returns the type of error that occurred last.
The QImageWriter class provides a format independent interface for writing images to files or other d...
QImageWriter(const QString &fileName, const QByteArray &format=QByteArray())
Constructs a QImageWriter objects that will write to a file with the name fileName,...
QImageWriter()
Constructs an empty QImageWriter object.
void setCompression(int compression)
This is an image format specific function that set the compression of an image.
bool write(const QImage &image)
Writes the image image to the assigned device or file name.
bool canWrite() const
Returns true if QImageWriter can write the image; i.e., the image format is supported and the assigne...
void setTransformation(QImageIOHandler::Transformations orientation)
QImageWriter(QIODevice *device, const QByteArray &format)
Constructs a QImageWriter object using the device device and image format format.
static QList< QByteArray > supportedMimeTypes()
Returns the list of MIME types supported by QImageWriter.
void setSubType(const QByteArray &type)
void setFileName(const QString &fileName)
Sets the file name of QImageWriter to fileName.
bool optimizedWrite() const
bool progressiveScanWrite() const
static QList< QByteArray > imageFormatsForMimeType(const QByteArray &mimeType)
void setOptimizedWrite(bool optimize)
static QList< QByteArray > supportedImageFormats()
Returns the list of image formats supported by QImageWriter.
int compression() const
Returns the compression of the image.
void setFormat(const QByteArray &format)
Sets the format QImageWriter will use when writing images, to format.
void setProgressiveScanWrite(bool progressive)
void setText(const QString &key, const QString &text)
Sets the image text associated with the key key to text.
Definition qmap.h:189
The QTransform class specifies 2D transformations of a coordinate system.
Definition qtransform.h:20
\keyword 16-bit Floating Point Support\inmodule QtCore \inheaderfile QFloat16
Definition qfloat16.h:48
QRgbaFloat< float > QRgbaFloat32
QRgbaFloat< qfloat16 > QRgbaFloat16
Q_TRACE_METADATA(qtcore, "ENUM { AUTO, RANGE User ... MaxUser } QEvent::Type;")
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2568
#define IWX_MSB(b)
Definition qimage.cpp:4424
static QImage rotated90(const QImage &src)
Definition qimage.cpp:4775
static void copyMetadata(QImage *dst, const QImage &src)
Definition qimage.cpp:1182
static void copyMetadata(QImageData *dst, const QImageData *src)
Definition qimage.cpp:1173
static int next_qimage_serial_number()
Definition qimage.cpp:87
#define QIMAGE_SANITYCHECK_MEMORY(image)
Definition qimage.cpp:65
static void copyPhysicalMetadata(QImageData *dst, const QImageData *src)
Definition qimage.cpp:1166
#define IWX_LSB(b)
Definition qimage.cpp:4433
static QImage rotated270(const QImage &src)
Definition qimage.cpp:4819
QMap< QString, QString > qt_getImageText(const QImage &image, const QString &description)
Definition qimage.cpp:6529
Q_GUI_EXPORT void qt_imageTransform(QImage &src, QImageIOHandler::Transformations orient)
Definition qimage.cpp:6516
#define PIX(x, y)
static QImage rotated180(const QImage &src)
Definition qimage.cpp:4801
static Qt::Orientations toOrientations(QImageIOHandler::Transformations orient)
Definition qimage.cpp:6506
QMap< QString, QString > qt_getImageTextFromDescription(const QString &description)
Definition qimage.cpp:6540
void(* _qt_pixmap_cleanup_hook_pmd)(QPlatformPixmap *)
QT_BEGIN_NAMESPACE typedef void(* _qt_image_cleanup_hook_64)(qint64)
QTransform operator*(const QTransform &a, qreal n)
Definition qtransform.h:348
Q_DECLARE_TYPEINFO(QTransform, Q_RELOCATABLE_TYPE)
QTransform operator/(const QTransform &a, qreal n)
Definition qtransform.h:350
QPoint operator*(const QPoint &p, const QTransform &m)
Definition qtransform.h:333
QTransform operator+(const QTransform &a, qreal n)
Definition qtransform.h:352
QTransform operator-(const QTransform &a, qreal n)
Definition qtransform.h:354
QT_WARNING_POP bool qFuzzyCompare(const QTransform &t1, const QTransform &t2) noexcept
Definition qtransform.h:307