Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// Copyright (C) 2016 Petroules Corporation.
3
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
// Qt-Security score:significant reason:default
5
6
7
#
include
<
qimageiohandler
.
h
>
8
#
include
<
qstringlist
.
h
>
9
10
#
ifndef
QT_NO_IMAGEFORMATPLUGIN
11
12
#
include
"qjp2handler_p.h"
13
14
#
include
<
qiodevice
.
h
>
15
#
include
<
qbytearray
.
h
>
16
17
QT_BEGIN_NAMESPACE
18
19
class
QJp2Plugin
:
public
QImageIOPlugin
20
{
21
Q_OBJECT
22
Q_PLUGIN_METADATA(IID
"org.qt-project.Qt.QImageIOHandlerFactoryInterface"
FILE
"jp2.json"
)
23
24
public
:
25
Capabilities
capabilities
(
QIODevice
*
device
,
const
QByteArray
&
format
)
const
override
;
26
QImageIOHandler
*
create
(QIODevice *device,
const
QByteArray
&format = QByteArray())
const
override
;
27
};
28
29
QImageIOPlugin::Capabilities
QJp2Plugin
::capabilities(QIODevice *device,
const
QByteArray
&format)
const
30
{
31
if
(format ==
"jp2"
|| format ==
"j2k"
)
32
return
Capabilities(CanRead | CanWrite);
33
Capabilities cap;
34
if
(!format.isEmpty())
35
return
cap;
36
if
(!device->isOpen())
37
return
cap;
38
39
if
(device->isReadable() &&
QJp2Handler
::
canRead
(
device
,
0
)
)
40
cap |= CanRead;
41
if
(device->isWritable())
42
cap |= CanWrite;
43
return
cap;
44
}
45
46
QImageIOHandler
*
QJp2Plugin
::
create
(QIODevice *device,
const
QByteArray
&format)
const
47
{
48
QJp2Handler
*handler =
new
QJp2Handler
(
)
;
49
handler->setDevice(device);
50
handler->setFormat(format);
51
return
handler;
52
}
53
54
QT_END_NAMESPACE
55
56
#
include
"main.moc"
57
58
#
endif
// !QT_NO_IMAGEFORMATPLUGIN
QByteArray::FromBase64Result
\inmodule QtCore
Definition
qbytearray.h:824
QJp2Handler
The QJp2Handler class provides support for reading and writing JPEG 2000 image files with the Qt plug...
Definition
qjp2handler_p.h:22
QJp2Handler::QJp2Handler
QJp2Handler()
Constructs an instance of QJp2Handler.
Definition
qjp2handler.cpp:150
QJp2Handler::canRead
static bool canRead(QIODevice *iod, QByteArray *subType)
Verifies if some values (magic bytes) are set as expected in the header of the file.
Definition
qjp2handler.cpp:173
QJp2Plugin
Definition
main.cpp:20
QJp2Plugin::create
QImageIOHandler * create(QIODevice *device, const QByteArray &format=QByteArray()) const override
Creates and returns a QImageIOHandler subclass, with device and format set.
Definition
main.cpp:46
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtimageformats
src
plugins
imageformats
jp2
main.cpp
Generated on
for Qt by
1.18.0