The QPlatformImageCapture class provides a control interface for image capture services. 更多...
头: | #include <QPlatformImageCapture> |
CMake: |
find_package(Qt6 COMPONENTS Multimedia REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia) |
qmake: | QT += multimedia |
继承: | QObject |
This class is deprecated. We strongly advise against using it in new code.
virtual int | capture (const QString & fileName ) = 0 |
virtual QImageEncoderSettings | imageSettings () const = 0 |
virtual bool | isReadyForCapture () const = 0 |
virtual void | setImageSettings (const QImageEncoderSettings & settings ) = 0 |
void | error (int id , int error , const QString & errorString ) |
void | imageAvailable (int requestId , const QVideoFrame & buffer ) |
void | imageCaptured (int requestId , const QImage & preview ) |
void | imageExposed (int requestId ) |
void | imageMetadataAvailable (int id , const QMediaMetaData &) |
void | imageSaved (int requestId , const QString & fileName ) |
void | readyForCaptureChanged (bool ready ) |
QPlatformImageCapture (QImageCapture * parent = nullptr) |
[protected]
QPlatformImageCapture::
QPlatformImageCapture
(
QImageCapture
*
parent
= nullptr)
Constructs a new image capture control object with the given parent
[signal]
void
QPlatformImageCapture::
error
(
int
id
,
int
error
, const
QString
&
errorString
)
Signals the capture request id failed with error code and message errorString .
另请参阅 QImageCapture::Error .
[signal]
void
QPlatformImageCapture::
imageAvailable
(
int
requestId
, const
QVideoFrame
&
buffer
)
Signals that a captured buffer 采用 requestId 可用。
[signal]
void
QPlatformImageCapture::
imageCaptured
(
int
requestId
, const
QImage
&
preview
)
Signals that an image with it requestId has been captured and a preview 可用。
[signal]
void
QPlatformImageCapture::
imageExposed
(
int
requestId
)
Signals that an image with it requestId has just been exposed. This signal can be used for the shutter sound or other indicaton.
[signal]
void
QPlatformImageCapture::
imageMetadataAvailable
(
int
id
, const
QMediaMetaData
&)
Signals that a metadata for an image with request id 可用。
This signal should be emitted between imageExposed and imageSaved signals.
[signal]
void
QPlatformImageCapture::
imageSaved
(
int
requestId
, const
QString
&
fileName
)
Signals that a captured image with a requestId has been saved to fileName .
[signal]
void
QPlatformImageCapture::
readyForCaptureChanged
(
bool
ready
)
Signals that a capture control's ready state has changed.
[pure virtual]
int
QPlatformImageCapture::
capture
(const
QString
&
fileName
)
Initiates the capture of an image to fileName 。 fileName can be relative or empty, in this case the service should use the system specific place and file naming scheme.
The Camera service should save all the capture parameters like exposure settings or image processing parameters, so changes to camera parameters after capture() is called do not affect previous capture requests.
Returns the capture request id number, which is used later with imageExposed (), imageCaptured () 和 imageSaved () 信号。
[pure virtual]
QImageEncoderSettings
QPlatformImageCapture::
imageSettings
() const
返回目前使用的图像编码器设定。
The returned value may be different than passed to setImageSettings () if the settings contains defaulted or undefined parameters.
另请参阅 setImageSettings ().
[pure virtual]
bool
QPlatformImageCapture::
isReadyForCapture
() const
Identifies if a capture control is ready to perform a capture immediately (all the resources necessary for image capture are allocated, hardware initialized, flash is charged, etc).
Returns true if the camera is ready for capture; and false if it is not.
It's permissible to call capture () while the camera status is QCamera::ActiveStatus regardless of isReadyForCapture property value. If camera is not ready to capture image immediately, the capture request is queued with all the related camera settings to be executed as soon as possible.
[pure virtual]
void
QPlatformImageCapture::
setImageSettings
(const
QImageEncoderSettings
&
settings
)
设置选中的图像编码器 settings .
另请参阅 imageSettings ().