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
qmacheifhandler.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 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#include "qmacheifhandler.h"
5#include <QVariant>
6
8
13
17
19{
20 bool bCanRead = false;
21 char buf[12];
22 if (iod && iod->peek(buf, 12) == 12) {
23 bCanRead = (!qstrncmp(buf + 4, "ftyp", 4) &&
24 (!qstrncmp(buf + 8, "heic", 4) ||
25 !qstrncmp(buf + 8, "heix", 4) ||
26 !qstrncmp(buf + 8, "mif1", 4)));
27 }
28 return bCanRead;
29}
30
32{
33 if (canRead(device())) {
34 setFormat("heic");
35 return true;
36 }
37 return false;
38}
39
41{
42 return d->readImage(image);
43}
44
46{
47 return d->writeImage(image, QStringLiteral("public.heic"));
48}
49
51{
52 return d->imageProperty(option);
53}
54
56{
57 d->setOption(option, value);
58}
59
61{
62 return option == Quality
63 || option == Size
65}
66
\inmodule QtCore \reentrant
Definition qiodevice.h:34
qint64 peek(char *data, qint64 maxlen)
ImageOption
This enum describes the different options supported by QImageIOHandler.
QIODevice * device() const
Returns the device currently assigned to the QImageIOHandler.
void setFormat(const QByteArray &format)
Sets the format of the QImageIOHandler to format.
\inmodule QtGui
Definition qimage.h:37
bool read(QImage *image) override
Read an image from the device, and stores it in image.
QVariant option(ImageOption option) const override
Returns the value assigned to option as a QVariant.
bool canRead() const override
Returns true if an image can be read from the device (i.e., the image format is supported,...
~QMacHeifHandler() override
bool supportsOption(ImageOption option) const override
Returns true if the QImageIOHandler supports the option option; otherwise returns false.
bool write(const QImage &image) override
Writes the image image to the assigned device.
void setOption(ImageOption option, const QVariant &value) override
Sets the option option with the value value.
\inmodule QtCore
Definition qvariant.h:65
#define this
Definition dialogs.cpp:9
Combined button and popup list for selecting options.
Definition image.cpp:4
int qstrncmp(const char *str1, const char *str2, size_t len)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLenum option
#define QStringLiteral(str)