CopperSpice API
1.9.1
|
Used for recording media content from a camera device. More...
Public Typedefs | |
using | CaptureDestinations = QFlags< CaptureDestination > |
Public Types | |
enum | CaptureDestination |
enum | DriveMode |
enum | Error |
Public Signals | |
void | bufferFormatChanged (QVideoFrame::PixelFormat format) |
void | captureDestinationChanged (QCameraImageCapture::CaptureDestinations destination) |
void | error (int id, QCameraImageCapture::Error error, const QString &errorString) |
void | imageAvailable (int id, const QVideoFrame &buffer) |
void | imageCaptured (int id, const QImage &preview) |
void | imageExposed (int id) |
void | imageMetadataAvailable (int id, const QString &key, const QVariant &value) |
void | imageSaved (int id, const QString &fileName) |
void | readyForCaptureChanged (bool ready) |
Public Signals inherited from QObject | |
void | destroyed (QObject *obj=nullptr) |
void | objectNameChanged (const QString &objectName) |
Public Slots | |
void | cancelCapture () |
int | capture (const QString &fileName=QString ()) |
Public Slots inherited from QObject | |
void | deleteLater () |
Public Methods | |
QCameraImageCapture (QMediaObject *mediaObject, QObject *parent=nullptr) | |
~QCameraImageCapture () | |
QMultimedia::AvailabilityStatus | availability () const |
QVideoFrame::PixelFormat | bufferFormat () const |
CaptureDestinations | captureDestination () const |
QImageEncoderSettings | encodingSettings () const |
Error | error () const |
QString | errorString () const |
QString | imageCodecDescription (const QString &codecName) const |
bool | isAvailable () const |
bool | isCaptureDestinationSupported (CaptureDestinations destination) const |
bool | isReadyForCapture () const |
QMediaObject * | mediaObject () const override |
void | setBufferFormat (const QVideoFrame::PixelFormat format) |
void | setCaptureDestination (CaptureDestinations destination) |
void | setEncodingSettings (const QImageEncoderSettings &settings) |
QList< QVideoFrame::PixelFormat > | supportedBufferFormats () const |
QStringList | supportedImageCodecs () const |
QList< QSize > | supportedResolutions (const QImageEncoderSettings &settings=QImageEncoderSettings (), bool *continuous=nullptr) const |
Public Methods inherited from QObject | |
QObject (QObject *parent=nullptr) | |
~QObject () | |
bool | blockSignals (bool block) |
const QList< QObject * > & | children () const |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QString > | dynamicPropertyNames () const |
virtual bool | event (QEvent *event) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
template<typename T > | |
T | findChild (const QString &childName=QString ()) const |
template<class T > | |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
template<class T > | |
QList< T > | findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
bool | inherits (const QString &className) const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const |
bool | isWindowType () const |
void | killTimer (int id) |
const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const |
QObject * | parent () const |
template<class T = QVariant> | |
T | property (const QString &name) const |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const QString &name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
QThread * | thread () const |
Public Methods inherited from QMediaBindableInterface | |
virtual | ~QMediaBindableInterface () |
Protected Methods | |
bool | setMediaObject (QMediaObject *mediaObject) override |
Protected Methods inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signalMethod) const |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signalMethod) const |
bool | isSignalConnected (const QMetaMethod &signalMethod) const |
int | receivers (const QString &signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Properties | |
readyForCapture | |
Properties inherited from QObject | |
objectName | |
Additional Inherited Members | |
Static Public Methods inherited from QObject | |
static bool | connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ()) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...)) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod) |
static QMetaObject & | staticMetaObject () |
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
Related Functions inherited from QObject | |
T | qobject_cast (QObject *object) |
QObjectList | |
The QCameraImageCapture class is used for recording media content from a camera device. This class is used with the media recording functions of other media objects like QCamera.
Typedef for QFlags<CaptureDestination> which contains an OR combination of CaptureDestination values.
Refer to QCameraImageCapture::CaptureDestination for the enum documentation.
Values indicating where a captured image will be stored.
Constant | Value | Description |
---|---|---|
QCameraImageCapture::CaptureToFile | 0x01 | Capture the image to a file. |
QCameraImageCapture::CaptureToBuffer | 0x02 | Capture the image to a buffer for further processing. |
Value for the image capture sequencing mode.
Constant | Value | Description |
---|---|---|
QCameraImageCapture::SingleImageCapture | 0 | Drive mode is capturing a single picture. |
List of values describing a capture error.
Constant | Value | Description |
---|---|---|
QCameraImageCapture::NoError | 0 | No Errors. |
QCameraImageCapture::NotReadyError | 1 | The service is not ready for capture yet. |
QCameraImageCapture::ResourceError | 2 | Device is not ready or not available. |
QCameraImageCapture::OutOfSpaceError | 3 | No space left on device. |
QCameraImageCapture::NotSupportedFeatureError | 4 | Device does not support still image capture. |
QCameraImageCapture::FormatError | 5 | Current format is not supported. |
|
explicit |
Constructs a QCameraImageCapture object using mediaObject and parent.
Constructs a QCameraImageCapture using mediaObject and parent.
QCameraImageCapture::~QCameraImageCapture | ( | ) |
Destroys this image capture object.
QMultimedia::AvailabilityStatus QCameraImageCapture::availability | ( | ) | const |
Returns the availability of this object.
Returns the availability of this functionality.
QVideoFrame::PixelFormat QCameraImageCapture::bufferFormat | ( | ) | const |
Returns the buffer image capture format being used.
|
signal |
Signal emitted when the buffer format for the buffer image capture has changed.
|
slot |
Cancel incomplete capture requests. Already captured and queued for processing images may be discarded.
Capture the image and save it to fileName. This operation is asynchronous in majority of cases, followed by signals QCameraImageCapture::imageExposed(), QCameraImageCapture::imageCaptured(), QCameraImageCapture::imageSaved() or QCameraImageCapture::error().
If an empty file is passed, the camera backend chooses the default location and naming scheme for photos on the system, if only file name without full path is specified, the image will be saved to the default directory, with a full path reported with imageCaptured() and imageSaved() signals.
QCamera saves 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.
QCameraImageCapture::capture returns the capture Id parameter, used with imageExposed(), imageCaptured() and imageSaved() signals.
Capture the image and save it to the given fileName. This operation is asynchronous in majority of cases, followed by signals QCameraImageCapture::imageExposed(), QCameraImageCapture::imageCaptured(), QCameraImageCapture::imageSaved() or QCameraImageCapture::error().
If an empty file is passed, the camera backend chooses the default location and naming scheme for photos on the system, if only file name without full path is specified, the image will be saved to the default directory, with a full path reported with imageCaptured() and imageSaved() signals.
QCamera saves 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.
QCameraImageCapture::capture returns the capture Id parameter, used with imageExposed(), imageCaptured() and imageSaved() signals.
CaptureDestinations QCameraImageCapture::captureDestination | ( | ) | const |
Returns the image captureDdestination being used.
Returns the image capture destination being used.
|
signal |
Signal emitted when the capture destination has changed.
Signal emitted when the capture destination has changed.
QImageEncoderSettings QCameraImageCapture::encodingSettings | ( | ) | const |
Returns the image encoder settings being used.
Error QCameraImageCapture::error | ( | ) | const |
Returns the current error state.
|
signal |
This signal indicates the capture request with the given id has failed with an error and the errorString description.
Signals the capture request id failed with the given error code and message errorString.
QString QCameraImageCapture::errorString | ( | ) | const |
Returns a string describing the current error state.
|
signal |
This signal indicates the capture request with the given id is available in buffer.
Signal emitted when the frame with request id is available as buffer.
|
signal |
This signal indicates the capture request with the given id was captured however it has not yet been processed and saved. The preview image can be displayed.
This signal indicates that an image with a given requestId has been captured and a preview is available.
Returns a description of an image codecName.
|
signal |
This signal indicates the capture request with the given id has been exposed.
Signal emitted when the frame with request id was exposed.
|
signal |
This signal indicates the capture request with the given id will contain metadata consisting of a key and a value.
This signal is emitted between the imageExposed and imageSaved signals.
Signals the metadata for an image with the requested id is available. The key and value contain the metadata. This signal should be emitted between imageExposed and imageSaved signals.
|
signal |
This signal indicates the capture request with the given id was saved to fileName.
Signal emitted when the frame with request id was saved to fileName.
bool QCameraImageCapture::isAvailable | ( | ) | const |
Returns true if the image capture service is ready to use.
Returns true if the images capture service ready to use.
bool QCameraImageCapture::isCaptureDestinationSupported | ( | CaptureDestinations | destination | ) | const |
Returns true if the image capture destination is supported otherwise returns false.
bool QCameraImageCapture::isReadyForCapture | ( | ) | const |
Returns true if the image capture service is ready to capture an image.
|
overridevirtual |
Implements QMediaBindableInterface::mediaObject()
|
signal |
This signal indicates the readyForCapture property has changed to ready.
Signals a camera's ready for capture state has changed.
void QCameraImageCapture::setBufferFormat | ( | const QVideoFrame::PixelFormat | format | ) |
Sets the buffer image capture format to be used.
void QCameraImageCapture::setCaptureDestination | ( | CaptureDestinations | destination | ) |
Sets the capture destination to be used.
void QCameraImageCapture::setEncodingSettings | ( | const QImageEncoderSettings & | settings | ) |
Sets the image encoding to settings. If some parameters are not specified the encoder defaults will be used.
Sets the image encoding settings. If some parameters are not specified, or null settings are passed, the encoder choose the default encoding parameters.
|
overrideprotectedvirtual |
Implements QMediaBindableInterface::setMediaObject()
QList< QVideoFrame::PixelFormat > QCameraImageCapture::supportedBufferFormats | ( | ) | const |
Returns the list of supported buffer image capture formats.
QStringList QCameraImageCapture::supportedImageCodecs | ( | ) | const |
Returns a list of supported image codecs.
QList< QSize > QCameraImageCapture::supportedResolutions | ( | const QImageEncoderSettings & | settings = QImageEncoderSettings() , |
bool * | continuous = nullptr |
||
) | const |
Returns a list of supported image resolutions. If the settings parameter is not empty only compatible resolutions will be returned. If the encoder supports arbitrary resolutions within the supported range, continuous is set to true otherwise continuous is set to false.
Returns a list of resolutions images can be encoded at. If non null image settings parameter is passed, the returned list is reduced to resolution supported with partial settings like image codec or quality applied.
If the encoder supports arbitrary resolutions within the supported range, continuous is set to true otherwise continuous is set to false.
|
This property will be true when the service is ready to capture an image. Calling capture() while this property is false results in an error.
Properties | Class Methods |
---|---|
read | isReadyForCapture |
notify | readyForCaptureChanged |