Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwebphandler_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 QWEBPHANDLER_P_H
5#define QWEBPHANDLER_P_H
6
7#include <QtGui/qcolor.h>
8#include <QtGui/qcolorspace.h>
9#include <QtGui/qimage.h>
10#include <QtGui/qimageiohandler.h>
11#include <QtCore/qbytearray.h>
12#include <QtCore/qsize.h>
13
14#include "webp/decode.h"
15#include "webp/demux.h"
16
18{
19public:
22
23public:
24 bool canRead() const override;
25 bool read(QImage *image) override;
26
27 static bool canRead(QIODevice *device);
28
29 bool write(const QImage &image) override;
30 QVariant option(ImageOption option) const override;
31 void setOption(ImageOption option, const QVariant &value) override;
32 bool supportsOption(ImageOption option) const override;
33
34 int imageCount() const override;
35 int currentImageNumber() const override;
36 QRect currentImageRect() const override;
37 int loopCount() const override;
38 int nextImageDelay() const override;
39
40private:
41 bool ensureScanned() const;
42 bool ensureDemuxer();
43
44private:
45 enum ScanState {
46 ScanError = -1,
47 ScanNotScanned = 0,
48 ScanSuccess = 1,
49 };
50
51 int m_quality;
52 mutable ScanState m_scanState;
53 WebPBitstreamFeatures m_features;
54 uint32_t m_formatFlags;
55 int m_loop;
56 int m_frameCount;
57 QColor m_bgColor;
58 QByteArray m_rawData;
59 WebPData m_webpData;
60 WebPDemuxer *m_demuxer;
61 WebPIterator m_iter;
62 QColorSpace m_colorSpace;
63 QImage *m_composited; // For animation frames composition
64};
65
66#endif // WEBPHANDLER_H
\inmodule QtCore
Definition qbytearray.h:57
The QColorSpace class provides a color space abstraction.
Definition qcolorspace.h:21
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore \reentrant
Definition qiodevice.h:34
The QImageIOHandler class defines the common image I/O interface for all image formats in Qt.
ImageOption
This enum describes the different options supported by QImageIOHandler.
QIODevice * device() const
Returns the device currently assigned to the QImageIOHandler.
\inmodule QtGui
Definition qimage.h:37
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qvariant.h:65
bool write(const QImage &image) override
Writes the image image to the assigned device.
bool supportsOption(ImageOption option) const override
Returns true if the QImageIOHandler supports the option option; otherwise returns false.
bool read(QImage *image) override
Read an image from the device, and stores it in image.
QRect currentImageRect() const override
Returns the rect of the current image.
int currentImageNumber() const override
For image formats that support animation, this function returns the sequence number of the current im...
int imageCount() const override
For image formats that support animation, this function returns the number of images in the animation...
bool canRead() const override
Returns true if an image can be read from the device (i.e., the image format is supported,...
int loopCount() const override
For image formats that support animation, this function returns the number of times the animation sho...
int nextImageDelay() const override
For image formats that support animation, this function returns the number of milliseconds to wait un...
void setOption(ImageOption option, const QVariant &value) override
Sets the option option with the value value.
Definition image.cpp:4
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint GLenum option