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
qbmphandler_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
// Qt-Security score:critical reason:data-parser
4
5
#
ifndef
QBMPHANDLER_P_H
6
#
define
QBMPHANDLER_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtGui
/
private
/
qtguiglobal_p
.
h
>
20
#
include
"QtGui/qimageiohandler.h"
21
22
#
ifndef
QT_NO_IMAGEFORMAT_BMP
23
24
QT_BEGIN_NAMESPACE
25
26
struct
BMP_FILEHDR {
// BMP file header
27
char
bfType[2];
// "BM"
28
qint32 bfSize;
// size of file
29
qint16 bfReserved1;
30
qint16 bfReserved2;
31
qint32 bfOffBits;
// pointer to the pixmap bits
32
};
33
34
struct
BMP_INFOHDR
{
// BMP information header
35
qint32
biSize
;
// size of this struct
36
qint32
biWidth
;
// pixmap width
37
qint32
biHeight
;
// pixmap height
38
qint16
biPlanes
;
// should be 1
39
qint16
biBitCount
;
// number of bits per pixel
40
qint32
biCompression
;
// compression method
41
qint32
biSizeImage
;
// size of image
42
qint32
biXPelsPerMeter
;
// horizontal resolution
43
qint32
biYPelsPerMeter
;
// vertical resolution
44
qint32
biClrUsed
;
// number of colors used
45
qint32
biClrImportant
;
// number of important colors
46
// V4:
47
quint32
biRedMask
;
48
quint32
biGreenMask
;
49
quint32
biBlueMask
;
50
quint32
biAlphaMask
;
51
qint32
biCSType
;
52
qint32
biEndpoints
[9];
53
qint32
biGammaRed
;
54
qint32
biGammaGreen
;
55
qint32
biGammaBlue
;
56
// V5:
57
qint32
biIntent
;
58
qint32
biProfileData
;
59
qint32
biProfileSize
;
60
qint32
biReserved
;
61
};
62
63
// BMP-Handler, which is also able to read and write the DIB
64
// (Device-Independent-Bitmap) format used internally in the Windows operating
65
// system for OLE/clipboard operations. DIB is a subset of BMP (without file
66
// header). The Windows platform plugin accesses the DIB-functionality.
67
68
class
QBmpHandler
:
public
QImageIOHandler
69
{
70
public
:
71
enum
InternalFormat
{
72
DibFormat
,
73
BmpFormat
74
};
75
76
explicit
QBmpHandler
(
InternalFormat
fmt =
BmpFormat
);
77
bool
canRead
()
const
override
;
78
bool
read
(QImage *image)
override
;
79
bool
write
(
const
QImage &image)
override
;
80
81
static
bool
canRead
(QIODevice *device);
82
83
QVariant
option
(ImageOption option)
const
override
;
84
void
setOption
(ImageOption option,
const
QVariant &value)
override
;
85
bool
supportsOption
(ImageOption option)
const
override
;
86
87
private
:
88
bool
readHeader();
89
inline
QByteArray formatName()
const
;
90
91
enum
State {
92
Ready,
93
ReadHeader,
94
Error
95
};
96
97
const
InternalFormat
m_format;
98
99
State state;
100
BMP_FILEHDR fileHeader;
101
BMP_INFOHDR
infoHeader;
102
qint64 startpos;
103
};
104
105
QT_END_NAMESPACE
106
107
#
endif
// QT_NO_IMAGEFORMAT_BMP
108
109
#
endif
// QBMPHANDLER_P_H
QBmpHandler
Definition
qbmphandler_p.h:69
QBmpHandler::supportsOption
bool supportsOption(ImageOption option) const override
Returns true if the QImageIOHandler supports the option option; otherwise returns false.
Definition
qbmphandler.cpp:876
QBmpHandler::option
QVariant option(ImageOption option) const override
Returns the value assigned to option as a QVariant.
Definition
qbmphandler.cpp:882
QBmpHandler::QBmpHandler
QBmpHandler(InternalFormat fmt=BmpFormat)
Definition
qbmphandler.cpp:689
QBmpHandler::canRead
bool canRead() const override
Returns true if an image can be read from the device (i.e., the image format is supported,...
Definition
qbmphandler.cpp:722
QBmpHandler::canRead
static bool canRead(QIODevice *device)
Definition
qbmphandler.cpp:735
QBmpHandler::InternalFormat
InternalFormat
Definition
qbmphandler_p.h:71
QBmpHandler::DibFormat
@ DibFormat
Definition
qbmphandler_p.h:72
QBmpHandler::BmpFormat
@ BmpFormat
Definition
qbmphandler_p.h:73
QBmpHandler::write
bool write(const QImage &image) override
Writes the image image to the assigned device.
Definition
qbmphandler.cpp:804
QBmpHandler::setOption
void setOption(ImageOption option, const QVariant &value) override
Sets the option option with the value value.
Definition
qbmphandler.cpp:917
QBmpHandler::read
bool read(QImage *image) override
Read an image from the device, and stores it in image.
Definition
qbmphandler.cpp:749
BMP_INFOHDR
Definition
qbmphandler_p.h:34
BMP_INFOHDR::biPlanes
qint16 biPlanes
Definition
qbmphandler_p.h:38
BMP_INFOHDR::biSizeImage
qint32 biSizeImage
Definition
qbmphandler_p.h:41
BMP_INFOHDR::biClrImportant
qint32 biClrImportant
Definition
qbmphandler_p.h:45
BMP_INFOHDR::biCompression
qint32 biCompression
Definition
qbmphandler_p.h:40
BMP_INFOHDR::biGammaGreen
qint32 biGammaGreen
Definition
qbmphandler_p.h:54
BMP_INFOHDR::biGammaRed
qint32 biGammaRed
Definition
qbmphandler_p.h:53
BMP_INFOHDR::biBitCount
qint16 biBitCount
Definition
qbmphandler_p.h:39
BMP_INFOHDR::biCSType
qint32 biCSType
Definition
qbmphandler_p.h:51
BMP_INFOHDR::biSize
qint32 biSize
Definition
qbmphandler_p.h:35
BMP_INFOHDR::biReserved
qint32 biReserved
Definition
qbmphandler_p.h:60
BMP_INFOHDR::biGreenMask
quint32 biGreenMask
Definition
qbmphandler_p.h:48
BMP_INFOHDR::biIntent
qint32 biIntent
Definition
qbmphandler_p.h:57
BMP_INFOHDR::biClrUsed
qint32 biClrUsed
Definition
qbmphandler_p.h:44
BMP_INFOHDR::biYPelsPerMeter
qint32 biYPelsPerMeter
Definition
qbmphandler_p.h:43
BMP_INFOHDR::biXPelsPerMeter
qint32 biXPelsPerMeter
Definition
qbmphandler_p.h:42
BMP_INFOHDR::biHeight
qint32 biHeight
Definition
qbmphandler_p.h:37
BMP_INFOHDR::biGammaBlue
qint32 biGammaBlue
Definition
qbmphandler_p.h:55
BMP_INFOHDR::biWidth
qint32 biWidth
Definition
qbmphandler_p.h:36
BMP_INFOHDR::biAlphaMask
quint32 biAlphaMask
Definition
qbmphandler_p.h:50
BMP_INFOHDR::biRedMask
quint32 biRedMask
Definition
qbmphandler_p.h:47
BMP_INFOHDR::biProfileData
qint32 biProfileData
Definition
qbmphandler_p.h:58
BMP_INFOHDR::biProfileSize
qint32 biProfileSize
Definition
qbmphandler_p.h:59
BMP_INFOHDR::biBlueMask
quint32 biBlueMask
Definition
qbmphandler_p.h:49
BMP_INFOHDR::biEndpoints
qint32 biEndpoints[9]
Definition
qbmphandler_p.h:52
qtbase
src
gui
image
qbmphandler_p.h
Generated on
for Qt by
1.18.0