![]() |
Qt 6.x
The Qt SDK
|
The QCamera class provides interface for system camera devices. More...
#include <qcamera.h>
Public Slots | |
void | setActive (bool active) |
Turns the camera on if active is {true}, or off if it's {false}. | |
void | start () |
\qmlmethod void Camera::start() | |
void | stop () |
\qmlmethod void Camera::stop() | |
void | zoomTo (float zoom, float rate) |
\qmlmethod void QtMultimedia::Camera::zoomTo(factor, rate) | |
void | setFlashMode (FlashMode mode) |
void | setTorchMode (TorchMode mode) |
void | setExposureMode (ExposureMode mode) |
void | setExposureCompensation (float ev) |
void | setManualIsoSensitivity (int iso) |
void | setAutoIsoSensitivity () |
Turn on auto sensitivity. | |
void | setManualExposureTime (float seconds) |
void | setAutoExposureTime () |
Use automatically calculated exposure time. | |
void | setWhiteBalanceMode (WhiteBalanceMode mode) |
Sets the white balance to mode. | |
void | setColorTemperature (int colorTemperature) |
Sets manual white balance to colorTemperature. | |
![]() | |
void | deleteLater () |
\threadsafe | |
Signals | |
void | activeChanged (bool) |
void | errorChanged () |
void | errorOccurred (QCamera::Error error, const QString &errorString) |
\qmlsignal void Camera::errorOccurred(Camera::Error error, string errorString) | |
void | cameraDeviceChanged () |
void | cameraFormatChanged () |
void | supportedFeaturesChanged () |
void | focusModeChanged () |
Signals when the focusMode changes. | |
void | zoomFactorChanged (float) |
void | minimumZoomFactorChanged (float) |
void | maximumZoomFactorChanged (float) |
void | focusDistanceChanged (float) |
void | focusPointChanged () |
void | customFocusPointChanged () |
void | flashReady (bool) |
Signal the flash ready status has changed. | |
void | flashModeChanged () |
void | torchModeChanged () |
void | exposureTimeChanged (float speed) |
Signals that a camera's exposure speed has changed. | |
void | manualExposureTimeChanged (float speed) |
void | isoSensitivityChanged (int) |
Signal emitted when sensitivity changes to value. | |
void | manualIsoSensitivityChanged (int) |
void | exposureCompensationChanged (float) |
Signal emitted when the exposure compensation changes to value. | |
void | exposureModeChanged () |
void | whiteBalanceModeChanged () QT6_ONLY(const) |
void | colorTemperatureChanged () QT6_ONLY(const) |
void | brightnessChanged () |
void | contrastChanged () |
void | saturationChanged () |
void | hueChanged () |
![]() | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
QCamera (QObject *parent=nullptr) | |
Construct a QCamera with a parent. | |
QCamera (const QCameraDevice &cameraDevice, QObject *parent=nullptr) | |
QCamera (QCameraDevice::Position position, QObject *parent=nullptr) | |
~QCamera () | |
Destroys the camera object. | |
bool | isAvailable () const |
Returns true if the camera can be used. | |
bool | isActive () const |
Returns true if the camera is currently active. | |
QMediaCaptureSession * | captureSession () const |
Returns the capture session this camera is connected to, or a nullptr if the camera is not connected to a capture session. | |
QCameraDevice | cameraDevice () const |
void | setCameraDevice (const QCameraDevice &cameraDevice) |
Connects the camera object to the physical camera device described by cameraDevice. | |
QCameraFormat | cameraFormat () const |
void | setCameraFormat (const QCameraFormat &format) |
Tells the camera to use the format described by format. | |
Error | error () const |
QString | errorString () const |
Features | supportedFeatures () const |
FocusMode | focusMode () const |
void | setFocusMode (FocusMode mode) |
Q_INVOKABLE bool | isFocusModeSupported (FocusMode mode) const |
\qmlmethod bool Camera::isFocusModeSupported(FocusMode mode) | |
QPointF | focusPoint () const |
QPointF | customFocusPoint () const |
void | setCustomFocusPoint (const QPointF &point) |
void | setFocusDistance (float d) |
float | focusDistance () const |
float | minimumZoomFactor () const |
float | maximumZoomFactor () const |
float | zoomFactor () const |
void | setZoomFactor (float factor) |
Zooms to a zoom factor factor at a rate of 1 factor per second. | |
FlashMode | flashMode () const |
Q_INVOKABLE bool | isFlashModeSupported (FlashMode mode) const |
\qmlmethod bool QtMultimedia::Camera::isFlashModeSupported(FlashMode mode) | |
Q_INVOKABLE bool | isFlashReady () const |
\qmlmethod bool QtMultimedia::Camera::isFlashReady() | |
TorchMode | torchMode () const |
Q_INVOKABLE bool | isTorchModeSupported (TorchMode mode) const |
\qmlmethod bool QtMultimedia::Camera::isTorchModeSupported(TorchMode mode) | |
ExposureMode | exposureMode () const |
Q_INVOKABLE bool | isExposureModeSupported (ExposureMode mode) const |
\qmlmethod bool QtMultimedia::Camera::isExposureModeSupported(ExposureMode mode) | |
float | exposureCompensation () const |
int | isoSensitivity () const |
int | manualIsoSensitivity () const |
float | exposureTime () const |
Returns the current exposure time in seconds. | |
float | manualExposureTime () const |
Returns the manual exposure time in seconds, or -1 if the camera is using automatic exposure times. | |
int | minimumIsoSensitivity () const |
Returns the minimum ISO sensitivity supported by the camera. | |
int | maximumIsoSensitivity () const |
Returns the maximum ISO sensitivity supported by the camera. | |
float | minimumExposureTime () const |
The minimal exposure time in seconds. | |
float | maximumExposureTime () const |
The maximal exposure time in seconds. | |
WhiteBalanceMode | whiteBalanceMode () const |
Q_INVOKABLE bool | isWhiteBalanceModeSupported (WhiteBalanceMode mode) const |
\qmlmethod bool QtMultimedia::Camera::isWhiteBalanceModeSupported(WhiteBalanceMode mode) | |
int | colorTemperature () const |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
template<typename T > | |
T | findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
Properties | |
bool | active |
\qmlproperty bool QtMultimedia::Camera::active | |
QCameraDevice | cameraDevice |
\qmlproperty cameraDevice QtMultimedia::Camera::cameraDevice | |
Error | error |
\qmlproperty enumeration QtMultimedia::Camera::error | |
QString | errorString |
\qmlproperty string QtMultimedia::Camera::errorString | |
QCameraFormat | cameraFormat |
\qmlproperty cameraFormat QtMultimedia::Camera::cameraFormat | |
FocusMode | focusMode |
\qmlproperty enumeration Camera::focusMode | |
QPointF | focusPoint |
\qmlproperty point QtMultimedia::Camera::focusPoint Returns the point currently used by the auto focus system to focus onto. | |
QPointF | customFocusPoint |
\qmlproperty point QtMultimedia::Camera::customFocusPoint | |
float | focusDistance |
\qmlproperty float QtMultimedia::Camera::focusDistance | |
float | minimumZoomFactor |
\qmlproperty real QtMultimedia::Camera::minimumZoomFactor | |
float | maximumZoomFactor |
\qmlproperty real QtMultimedia::Camera::maximumZoomFactor | |
float | zoomFactor |
\qmlproperty real QtMultimedia::Camera::zoomFactor | |
float | exposureTime |
\qmlproperty float QtMultimedia::Camera::exposureTime Returns the Camera's exposure time in seconds. | |
int | manualExposureTime |
\qmlproperty real QtMultimedia::Camera::manualExposureTime | |
int | isoSensitivity |
\qmlproperty int QtMultimedia::Camera::isoSensitivity | |
int | manualIsoSensitivity |
\qmlproperty int QtMultimedia::Camera::manualIsoSensitivity | |
float | exposureCompensation |
\qmlproperty real QtMultimedia::Camera::exposureCompensation | |
QCamera::ExposureMode | exposureMode |
\qmlproperty ExposureMode QtMultimedia::Camera::exposureMode | |
bool | flashReady |
\qmlproperty bool QtMultimedia::Camera::flashReady | |
QCamera::FlashMode | flashMode |
\qmlproperty enumeration QtMultimedia::Camera::flashMode | |
QCamera::TorchMode | torchMode |
\qmlproperty Camera::TorchMode Camera::torchMode | |
WhiteBalanceMode | whiteBalanceMode |
\qmlproperty WhiteBalanceMode QtMultimedia::Camera::whiteBalanceMode | |
int | colorTemperature |
\qmlmethod QtMultimedia::Camera::colorTemperature | |
Features | supportedFeatures |
\qmlproperty Features QtMultimedia::Camera::supportedFeatures Returns the features supported by this camera. | |
![]() | |
QString | objectName |
the name of this object | |
Friends | |
class | QMediaCaptureSession |
Additional Inherited Members | |
![]() | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
![]() | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
The QCamera class provides interface for system camera devices.
\inmodule QtMultimedia
QCamera can be used within a QMediaCaptureSession for video recording and image taking.
You can use QCameraDevice to list available cameras and choose which one to use.
On hardware that supports it, QCamera lets you adjust the focus and zoom. This also includes functionality such as a "Macro" mode for close up work (e.g. reading barcodes, or recognizing letters), or "touch to focus" - indicating an interesting area of the image for the hardware to attempt to focus on.
The \l minimumZoomFactor() and \l maximumZoomFactor() methods provide the range of supported zoom factors. The \l zoomTo() method allows changing the zoom factor.
After capturing the raw data for a camera frame, the camera hardware and software performs various image processing tasks to produce the final image. This includes compensating for ambient light color, reducing noise, as well as making some other adjustments to the image.
You can control many of these processing steps through the Camera properties. For example, you can set the white balance (or color temperature) used for processing images:
For more information on image processing of camera frames, see \l {camera_image_processing}{Camera Image Processing}.
See the \l{Camera Overview}{camera overview} for more information.
enum QCamera::Error |
\value ExposureAuto Automatic mode.
\value ExposureManual Manual mode. \value ExposurePortrait Portrait exposure mode. \value ExposureNight Night mode. \value ExposureSports Spots exposure mode. \value ExposureSnow Snow exposure mode. \value ExposureBeach Beach exposure mode. \value ExposureAction Action mode. Since 5.5 \value ExposureLandscape Landscape mode. Since 5.5 \value ExposureNightPortrait Night portrait mode. Since 5.5 \value ExposureTheatre Theatre mode. Since 5.5 \value ExposureSunset Sunset mode. Since 5.5 \value ExposureSteadyPhoto Steady photo mode. Since 5.5 \value ExposureFireworks Fireworks mode. Since 5.5 \value ExposureParty Party mode. Since 5.5 \value ExposureCandlelight Candlelight mode. Since 5.5 \value ExposureBarcode Barcode mode. Since 5.5
|
strong |
Describes a set of features supported by the camera.
The returned value can be a combination of:
\value ColorTemperature The Camera supports setting a custom \l{colorTemperature}. \value ExposureCompensation The Camera supports setting a custom \l{exposureCompensation}. \value IsoSensitivity The Camera supports setting a custom \l{isoSensitivity}. \value ManualExposureTime The Camera supports setting a \l{QCamera::manualExposureTime}{manual exposure Time}. \value CustomFocusPoint The Camera supports setting a \l{QCamera::customFocusPoint}{custom focus point}. \value FocusDistance The Camera supports setting the \l{focusDistance} property.
Enumerator | |
---|---|
ColorTemperature | |
ExposureCompensation | |
IsoSensitivity | |
ManualExposureTime | |
CustomFocusPoint | |
FocusDistance |
enum QCamera::FlashMode |
enum QCamera::FocusMode |
\value FocusModeAuto Continuous auto focus mode.
\value FocusModeAutoNear Continuous auto focus mode on near objects. \value FocusModeAutoFar Continuous auto focus mode on objects far away. \value FocusModeHyperfocal Focus to hyperfocal distance, with the maximum depth of field achieved. All objects at distances from half of this distance out to infinity will be acceptably sharp. \value FocusModeInfinity Focus strictly to infinity. \value FocusModeManual Manual or fixed focus mode.
Enumerator | |
---|---|
FocusModeAuto | |
FocusModeAutoNear | |
FocusModeAutoFar | |
FocusModeHyperfocal | |
FocusModeInfinity | |
FocusModeManual |
enum QCamera::TorchMode |
\value WhiteBalanceAuto Auto white balance mode.
\value WhiteBalanceManual Manual white balance. In this mode the white balance should be set with setColorTemperature() \value WhiteBalanceSunlight Sunlight white balance mode. \value WhiteBalanceCloudy Cloudy white balance mode. \value WhiteBalanceShade Shade white balance mode. \value WhiteBalanceTungsten Tungsten (incandescent) white balance mode. \value WhiteBalanceFluorescent Fluorescent white balance mode. \value WhiteBalanceFlash Flash white balance mode. \value WhiteBalanceSunset Sunset white balance mode.
Enumerator | |
---|---|
WhiteBalanceAuto | |
WhiteBalanceManual | |
WhiteBalanceSunlight | |
WhiteBalanceCloudy | |
WhiteBalanceShade | |
WhiteBalanceTungsten | |
WhiteBalanceFluorescent | |
WhiteBalanceFlash | |
WhiteBalanceSunset |
Construct a QCamera with a parent.
Selects the default camera on the system if more than one camera is available.
Definition at line 193 of file qcamera.cpp.
|
explicit |
Construct a QCamera from a camera description cameraDevice and parent.
Definition at line 204 of file qcamera.cpp.
References cameraDevice, and d.
|
explicit |
Construct a QCamera which uses a hardware camera located a the specified position.
For example on a mobile phone it can be used to easily choose between front-facing and back-facing cameras.
If no camera is available at the specified position or if position is QCameraDevice::UnspecifiedPosition, the default camera is used.
Definition at line 223 of file qcamera.cpp.
References d, device, position(), and QMediaDevices::videoInputs.
QCamera::~QCamera | ( | ) |
|
signal |
|
signal |
QCameraDevice QCamera::cameraDevice | ( | ) | const |
Definition at line 433 of file qcamera.cpp.
References d.
|
signal |
QCameraFormat QCamera::cameraFormat | ( | ) | const |
Definition at line 483 of file qcamera.cpp.
References d.
|
signal |
QMediaCaptureSession * QCamera::captureSession | ( | ) | const |
Returns the capture session this camera is connected to, or a nullptr if the camera is not connected to a capture session.
use QMediaCaptureSession::setCamera() to connect the camera to a session.
Definition at line 399 of file qcamera.cpp.
References d.
Referenced by QMediaCaptureSession::setCamera().
int QCamera::colorTemperature | ( | ) | const |
Definition at line 1299 of file qcamera.cpp.
References d.
|
signal |
Referenced by QPlatformCamera::colorTemperatureChanged().
|
signal |
QPointF QCamera::customFocusPoint | ( | ) | const |
Definition at line 641 of file qcamera.cpp.
References d.
|
signal |
Referenced by QPlatformCamera::customFocusPointChanged().
QCamera::Error QCamera::error | ( | ) | const |
Definition at line 302 of file qcamera.cpp.
|
signal |
|
signal |
\qmlsignal void Camera::errorOccurred(Camera::Error error, string errorString)
This signal is emitted when error state changes to error. A description of the error is provided as errorString.
This signal is emitted when error state changes to error. A description of the error is provided as errorString.
QString QCamera::errorString | ( | ) | const |
Definition at line 318 of file qcamera.cpp.
float QCamera::exposureCompensation | ( | ) | const |
Definition at line 978 of file qcamera.cpp.
References d.
|
signal |
Signal emitted when the exposure compensation changes to value.
Referenced by QPlatformCamera::exposureCompensationChanged().
QCamera::ExposureMode QCamera::exposureMode | ( | ) | const |
Definition at line 934 of file qcamera.cpp.
References d, and ExposureAuto.
|
signal |
float QCamera::exposureTime | ( | ) | const |
Returns the current exposure time in seconds.
Definition at line 1115 of file qcamera.cpp.
References d.
|
signal |
Signals that a camera's exposure speed has changed.
Referenced by QPlatformCamera::exposureTimeChanged().
QCamera::FlashMode QCamera::flashMode | ( | ) | const |
Definition at line 828 of file qcamera.cpp.
|
signal |
|
signal |
Signal the flash ready status has changed.
float QCamera::focusDistance | ( | ) | const |
Definition at line 682 of file qcamera.cpp.
References focusMode, and FocusModeManual.
|
signal |
QCamera::FocusMode QCamera::focusMode | ( | ) | const |
Definition at line 565 of file qcamera.cpp.
References d, and FocusModeAuto.
|
signal |
Signals when the focusMode changes.
Referenced by QPlatformCamera::focusModeChanged(), and setFocusMode().
QPointF QCamera::focusPoint | ( | ) | const |
Definition at line 610 of file qcamera.cpp.
References d.
|
signal |
|
signal |
bool QCamera::isActive | ( | ) | const |
Returns true if the camera is currently active.
Definition at line 272 of file qcamera.cpp.
References d.
Referenced by QImageCapture::isReadyForCapture().
bool QCamera::isAvailable | ( | ) | const |
bool QCamera::isExposureModeSupported | ( | QCamera::ExposureMode | mode | ) | const |
\qmlmethod bool QtMultimedia::Camera::isExposureModeSupported(ExposureMode mode)
Returns true if the exposure mode is supported.
Returns true if the exposure mode is supported.
Definition at line 956 of file qcamera.cpp.
References d.
bool QCamera::isFlashModeSupported | ( | QCamera::FlashMode | mode | ) | const |
\qmlmethod bool QtMultimedia::Camera::isFlashModeSupported(FlashMode mode)
Returns true if the flash mode is supported.
Returns true if the flash mode is supported.
Definition at line 850 of file qcamera.cpp.
bool QCamera::isFlashReady | ( | ) | const |
\qmlmethod bool QtMultimedia::Camera::isFlashReady()
Returns true if flash is charged.
Returns true if flash is charged.
Definition at line 865 of file qcamera.cpp.
References d.
bool QCamera::isFocusModeSupported | ( | FocusMode | mode | ) | const |
\qmlmethod bool Camera::isFocusModeSupported(FocusMode mode)
Returns true if the focus mode is supported by the camera.
Returns true if the focus mode is supported by the camera.
Definition at line 594 of file qcamera.cpp.
References d.
int QCamera::isoSensitivity | ( | ) | const |
Definition at line 1006 of file qcamera.cpp.
References d.
|
signal |
Signal emitted when sensitivity changes to value.
Referenced by QPlatformCamera::isoSensitivityChanged().
bool QCamera::isTorchModeSupported | ( | QCamera::TorchMode | mode | ) | const |
\qmlmethod bool QtMultimedia::Camera::isTorchModeSupported(TorchMode mode)
Returns true if the torch mode is supported.
Returns true if the torch mode is supported.
Definition at line 915 of file qcamera.cpp.
bool QCamera::isWhiteBalanceModeSupported | ( | QCamera::WhiteBalanceMode | mode | ) | const |
\qmlmethod bool QtMultimedia::Camera::isWhiteBalanceModeSupported(WhiteBalanceMode mode)
Returns true if the white balance mode is supported.
Returns true if the white balance mode is supported.
Definition at line 1275 of file qcamera.cpp.
References d.
Referenced by setColorTemperature().
float QCamera::manualExposureTime | ( | ) | const |
Returns the manual exposure time in seconds, or -1 if the camera is using automatic exposure times.
Definition at line 1147 of file qcamera.cpp.
References d.
|
signal |
int QCamera::manualIsoSensitivity | ( | ) | const |
Definition at line 1037 of file qcamera.cpp.
References d.
|
signal |
float QCamera::maximumExposureTime | ( | ) | const |
int QCamera::maximumIsoSensitivity | ( | ) | const |
Returns the maximum ISO sensitivity supported by the camera.
Definition at line 1067 of file qcamera.cpp.
References d.
float QCamera::maximumZoomFactor | ( | ) | const |
Definition at line 706 of file qcamera.cpp.
References d.
|
signal |
Referenced by QPlatformCamera::maximumZoomFactorChanged().
float QCamera::minimumExposureTime | ( | ) | const |
int QCamera::minimumIsoSensitivity | ( | ) | const |
Returns the minimum ISO sensitivity supported by the camera.
Definition at line 1058 of file qcamera.cpp.
References d.
float QCamera::minimumZoomFactor | ( | ) | const |
Definition at line 728 of file qcamera.cpp.
References d.
|
signal |
Referenced by QPlatformCamera::minimumZoomFactorChanged().
|
signal |
|
slot |
Turns the camera on if active is {true}, or off if it's
{false}.
Definition at line 281 of file qcamera.cpp.
|
slot |
Use automatically calculated exposure time.
Definition at line 1156 of file qcamera.cpp.
References d.
|
slot |
void QCamera::setCameraDevice | ( | const QCameraDevice & | cameraDevice | ) |
Connects the camera object to the physical camera device described by cameraDevice.
Using a default constructed QCameraDevice object as cameraDevice will connect the camera to the system default camera device.
Definition at line 444 of file qcamera.cpp.
References cameraDevice, cameraDeviceChanged(), d, QMediaDevices::defaultVideoInput, emit, and setCameraFormat().
void QCamera::setCameraFormat | ( | const QCameraFormat & | format | ) |
Tells the camera to use the format described by format.
This can be used to define a specific resolution and frame rate to be used for recording and image capture.
Definition at line 498 of file qcamera.cpp.
References cameraFormatChanged(), d, and emit.
Referenced by setCameraDevice().
|
slot |
Sets manual white balance to colorTemperature.
This is used when whiteBalanceMode() is set to WhiteBalanceManual
. The units are Kelvin.
Setting a color temperature will only have an effect if WhiteBalanceManual is supported. In this case, setting a temperature greater 0 will automatically set the white balance mode to WhiteBalanceManual. Setting the temperature to 0 will reset the white balance mode to WhiteBalanceAuto.
Definition at line 1315 of file qcamera.cpp.
References colorTemperature, d, isWhiteBalanceModeSupported(), WhiteBalanceAuto, and WhiteBalanceManual.
Definition at line 647 of file qcamera.cpp.
References d.
Referenced by camerafocus().
|
slot |
Definition at line 984 of file qcamera.cpp.
References d.
|
slot |
Definition at line 940 of file qcamera.cpp.
References d.
|
slot |
Definition at line 834 of file qcamera.cpp.
References d.
Referenced by QAndroidCamera::setTorchMode().
void QCamera::setFocusDistance | ( | float | d | ) |
Definition at line 675 of file qcamera.cpp.
References d, focusMode, and FocusModeManual.
void QCamera::setFocusMode | ( | QCamera::FocusMode | mode | ) |
Definition at line 576 of file qcamera.cpp.
References d, emit, and focusModeChanged().
|
slot |
Definition at line 1136 of file qcamera.cpp.
References d.
|
slot |
Definition at line 1028 of file qcamera.cpp.
References d.
|
slot |
Definition at line 899 of file qcamera.cpp.
References d.
|
slot |
Sets the white balance to mode.
Definition at line 1254 of file qcamera.cpp.
References d, and WhiteBalanceManual.
Referenced by cameraimageprocessing().
void QCamera::setZoomFactor | ( | float | factor | ) |
Zooms to a zoom factor factor at a rate of 1 factor per second.
Definition at line 756 of file qcamera.cpp.
References zoomTo().
Referenced by camerafocus().
|
inlineslot |
\qmlmethod void Camera::start()
Starts the camera.
Same as setting the active property to true.
If the camera can't be started for some reason, the errorOccurred() signal is emitted.
Starts the camera.
Same as setActive(true).
If the camera can't be started for some reason, the errorOccurred() signal is emitted.
Definition at line 204 of file qcamera.h.
Referenced by camera_blah(), overview_movie(), overview_still(), overview_surface(), and overview_viewfinder().
|
inlineslot |
\qmlmethod void Camera::stop()
Stops the camera. Same as setting the active property to false.
Stops the camera. Same as setActive(false).
QCamera::Features QCamera::supportedFeatures | ( | ) | const |
Definition at line 356 of file qcamera.cpp.
References d.
|
signal |
Referenced by QPlatformCamera::supportedFeaturesChanged().
QCamera::TorchMode QCamera::torchMode | ( | ) | const |
Definition at line 893 of file qcamera.cpp.
|
signal |
QCamera::WhiteBalanceMode QCamera::whiteBalanceMode | ( | ) | const |
Definition at line 1245 of file qcamera.cpp.
References d, and WhiteBalanceAuto.
|
signal |
Referenced by QPlatformCamera::whiteBalanceModeChanged().
float QCamera::zoomFactor | ( | ) | const |
Definition at line 748 of file qcamera.cpp.
References d.
|
signal |
|
slot |
\qmlmethod void QtMultimedia::Camera::zoomTo(factor, rate)
Zooms to a zoom factor factor using rate.
The rate is specified in powers of two per second. At a rate of 1 it would take 2 seconds to go from a zoom factor of 1 to 4.
Zooms to a zoom factor factor using rate.
The rate is specified in powers of two per second. At a rate of 1 it would take 2 seconds to go from a zoom factor of 1 to 4.
Definition at line 782 of file qcamera.cpp.
References d, Q_ASSERT, and qBound().
Referenced by setZoomFactor().
|
friend |
|
readwrite |
\qmlproperty bool QtMultimedia::Camera::active
Describes whether the camera is currently active.
Describes whether the camera is currently active.
Definition at line 270 of file qcamera.h.
Referenced by setActive().
|
readwrite |
\qmlproperty cameraDevice QtMultimedia::Camera::cameraDevice
Gets or sets the currently active camera device.
Returns the QCameraDevice object associated with this camera.
Definition at line 270 of file qcamera.h.
Referenced by QCamera(), QWindowsCamera::QWindowsCamera(), camera_info(), and setCameraDevice().
|
readwrite |
\qmlproperty cameraFormat QtMultimedia::Camera::cameraFormat
Gets or sets the currently active camera format.
Returns the camera format currently used by the camera.
|
readwrite |
\qmlmethod QtMultimedia::Camera::colorTemperature
Gets or sets the current color temperature.
Setting a color temperature will only have an effect if WhiteBalanceManual is supported. In this case, setting a temperature greater 0 will automatically set the white balance mode to WhiteBalanceManual. Setting the temperature to 0 will reset the white balance mode to WhiteBalanceAuto.
Returns the current color temperature if the current white balance mode is WhiteBalanceManual
. For other modes the return value is undefined.
Definition at line 270 of file qcamera.h.
Referenced by setColorTemperature().
|
readwrite |
\qmlproperty point QtMultimedia::Camera::customFocusPoint
This property holds the position of custom focus point, in relative frame coordinates. This means that QPointF(0,0) points to the top-left corner of the frame, and QPointF(0.5,0.5) points to the center of the frame.
Custom focus point is used only in FocusPointCustom
focus mode.
You can check whether custom focus points are supported by querying supportedFeatures() with the Feature.CustomFocusPoint flag.
This property represents the position of the custom focus point, in relative frame coordinates: QPointF(0,0) points to the left top frame point, QPointF(0.5,0.5) points to the frame center.
The custom focus point property is used only in FocusPointCustom
focus mode.
You can check whether custom focus points are supported by querying supportedFeatures() with the Feature.CustomFocusPoint flag.
|
read |
\qmlproperty enumeration QtMultimedia::Camera::error
Returns the error state of the camera.
Returns the error state of the camera.
|
read |
|
readwrite |
\qmlproperty real QtMultimedia::Camera::exposureCompensation
Gets or sets the exposure compensation in EV units.
Exposure compensation property allows to adjust the automatically calculated exposure.
Exposure compensation in EV units.
Exposure compensation property allows to adjust the automatically calculated exposure.
|
readwrite |
\qmlproperty ExposureMode QtMultimedia::Camera::exposureMode
The exposure mode being used.
The exposure mode being used.
|
read |
\qmlproperty float QtMultimedia::Camera::exposureTime Returns the Camera's exposure time in seconds.
Camera's exposure time in seconds.
|
readwrite |
\qmlproperty enumeration QtMultimedia::Camera::flashMode
Gets or sets a certain flash mode if the camera has a flash.
\value Camera.FlashOff Flash is Off. \value Camera.FlashOn Flash is On. \value Camera.FlashAuto Automatic flash.
The flash mode being used.
Enables a certain flash mode if the camera has a flash.
|
read |
\qmlproperty bool QtMultimedia::Camera::flashReady
Indicates if the flash is charged and ready to use.
Indicates if the flash is charged and ready to use.
Definition at line 270 of file qcamera.h.
Referenced by QPlatformCamera::flashReadyChanged().
|
readwrite |
\qmlproperty float QtMultimedia::Camera::focusDistance
This property return an approximate focus distance of the camera. The value reported is between 0 and 1, 0 being the closest possible focus distance, 1 being as far away as possible. Note that 1 is often, but not always infinity.
Setting the focus distance will be ignored unless the focus mode is set to \l {focusMode}{FocusModeManual}.
This property return an approximate focus distance of the camera. The value reported is between 0 and 1, 0 being the closest possible focus distance, 1 being as far away as possible. Note that 1 is often, but not always infinity.
Setting the focus distance will be ignored unless the focus mode is set to \l FocusModeManual.
|
readwrite |
\qmlproperty enumeration Camera::focusMode
This property holds the current camera focus mode.
\value Camera.FocusModeAuto Continuous auto focus mode. \value Camera.FocusModeAutoNear Continuous auto focus, preferring objects near to the camera. \value Camera.FocusModeAutoFar Continuous auto focus, preferring objects far away from the camera. \value Camera.FocusModeHyperfocal Focus to hyperfocal distance, with the maximum depth of field achieved. All objects at distances from half of this distance out to infinity will be acceptably sharp. \value Camera.FocusModeInfinity Focus strictly to infinity. \value Camera.FocusModeManual Manual or fixed focus mode.
If a certain focus mode is not supported, setting it will have no effect.
the current camera focus mode.
Sets up different focus modes for the camera. All auto focus modes will focus continuously. Locking the focus is possible by setting the focus mode to \l FocusModeManual. This will keep the current focus and stop any automatic focusing.
Definition at line 270 of file qcamera.h.
Referenced by focusDistance(), and setFocusDistance().
|
read |
|
read |
\qmlproperty int QtMultimedia::Camera::isoSensitivity
Describes the ISO sensitivity currently used by the camera.
The sensor ISO sensitivity.
Describes the ISO sensitivity currently used by the camera.
|
readwrite |
|
readwrite |
\qmlproperty int QtMultimedia::Camera::manualIsoSensitivity
Describes a manually set ISO sensitivity
Setting this property to -1 (the default), implies that the camera automatically adjusts the ISO sensitivity.
Describes a manually set ISO sensitivity
Setting this property to -1 (the default), implies that the camera automatically adjusts the ISO sensitivity.
|
read |
\qmlproperty real QtMultimedia::Camera::maximumZoomFactor
This property holds the maximum zoom factor supported.
This will be 1.0
on cameras that do not support zooming.
Returns the maximum zoom factor.
This will be 1.0
on cameras that do not support zooming.
|
read |
\qmlproperty real QtMultimedia::Camera::minimumZoomFactor
This property holds the minimum zoom factor supported.
This will be 1.0
on cameras that do not support zooming.
Returns the minimum zoom factor.
This will be 1.0
on cameras that do not support zooming.
|
read |
\qmlproperty Features QtMultimedia::Camera::supportedFeatures Returns the features supported by this camera.
Returns the features supported by this camera.
|
readwrite |
\qmlproperty Camera::TorchMode Camera::torchMode
Gets or sets the torch mode being used.
A torch is a continuous source of light. It can be used during video recording in low light conditions. Enabling torch mode will usually override any currently set flash mode.
The torch mode being used.
A torch is a continuous source of light. It can be used during video recording in low light conditions. Enabling torch mode will usually override any currently set flash mode.
|
readwrite |
\qmlproperty WhiteBalanceMode QtMultimedia::Camera::whiteBalanceMode
Gets or sets the white balance mode being used.
Returns the white balance mode being used.
|
readwrite |
\qmlproperty real QtMultimedia::Camera::zoomFactor
Gets or sets the current zoom factor. Values will be clamped between \l minimumZoomFactor and \l maximumZoomFactor.
The current zoom factor.
Gets or sets the current zoom factor. Values will be clamped between \l minimumZoomFactor and \l maximumZoomFactor.