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
qplatformimagecapture_p.h
Go to the documentation of this file.
1
// Copyright (C) 2021 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
QCAMERAIMAGECAPTURECONTROL_H
5
#
define
QCAMERAIMAGECAPTURECONTROL_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
<
QtMultimedia
/
qimagecapture
.
h
>
19
#
include
<
QtMultimedia
/
qmediametadata
.
h
>
20
#
include
<
QtCore
/
private
/
qglobal_p
.
h
>
21
22
QT_BEGIN_NAMESPACE
23
24
class
QImage;
25
class
QPlatformMediaCaptureSession;
26
27
class
QImageEncoderSettingsPrivate;
28
class
Q_MULTIMEDIA_EXPORT
QImageEncoderSettings
29
{
30
QImageCapture::FileFormat m_format = QImageCapture::UnspecifiedFormat;
31
QSize m_resolution;
32
QImageCapture::Quality m_quality = QImageCapture::NormalQuality;
33
34
public
:
35
bool
operator==(
const
QImageEncoderSettings &other) {
36
return
m_format == other.m_format &&
37
m_resolution == other.m_resolution &&
38
m_quality == other.m_quality;
39
}
40
bool
operator!=(
const
QImageEncoderSettings &other) {
return
!operator==(other); }
41
42
QImageCapture::FileFormat format()
const
{
return
m_format; }
43
void
setFormat(QImageCapture::FileFormat f) { m_format = f; }
44
45
QSize resolution()
const
{
return
m_resolution; }
46
void
setResolution(
const
QSize &s) { m_resolution = s; }
47
void
setResolution(
int
width,
int
height) { m_resolution = QSize(width, height); }
48
49
QImageCapture::Quality quality()
const
{
return
m_quality; }
50
void
setQuality(QImageCapture::Quality quality) { m_quality = quality; }
51
};
52
53
class
Q_MULTIMEDIA_EXPORT
QPlatformImageCapture
:
public
QObject
54
{
55
Q_OBJECT
56
57
public
:
58
virtual
bool
isReadyForCapture()
const
= 0;
59
60
virtual
int
capture(
const
QString &fileName) = 0;
61
virtual
int
captureToBuffer() = 0;
62
63
virtual
QImageEncoderSettings imageSettings()
const
= 0;
64
virtual
void
setImageSettings(
const
QImageEncoderSettings &settings) = 0;
65
66
virtual
void
setMetaData(
const
QMediaMetaData &m) { m_metaData = m; }
67
QMediaMetaData metaData()
const
{
return
m_metaData; }
68
69
QImageCapture *imageCapture() {
return
m_imageCapture; }
70
71
static
QString msgCameraNotReady();
72
static
QString msgImageCaptureNotSet();
73
74
Q_SIGNALS:
75
void
readyForCaptureChanged(
bool
ready);
76
77
void
imageExposed(
int
requestId);
78
void
imageCaptured(
int
requestId,
const
QImage &preview);
79
void
imageMetadataAvailable(
int
id,
const
QMediaMetaData &);
80
void
imageAvailable(
int
requestId,
const
QVideoFrame &buffer);
81
void
imageSaved(
int
requestId,
const
QString &fileName);
82
83
void
error(
int
id,
int
error,
const
QString &errorString);
84
85
protected
:
86
explicit
QPlatformImageCapture(QImageCapture *parent =
nullptr
);
87
private
:
88
QImageCapture *m_imageCapture =
nullptr
;
89
QMediaMetaData m_metaData;
90
};
91
92
QT_END_NAMESPACE
93
94
95
#
endif
// QCAMERAIMAGECAPTURECONTROL_H
QImageEncoderSettings
Definition
qplatformimagecapture_p.h:29
QPlatformImageCapture
Definition
qplatformimagecapture_p.h:54
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtmultimedia
src
multimedia
platform
qplatformimagecapture_p.h
Generated on
for Qt by
1.18.0