The QDeclarativeCamera class provides a camera item that you can add to a QDeclarativeView. More...
#include <QDeclarativeCamera>
Inherits QDeclarativeItem.
enum | Error { NoError, CameraError, InvalidRequestError, ServiceMissingError, NotSupportedFeatureError } |
enum | ExposureMode { ExposureManual, ExposureAuto, ExposureNight, ExposureBacklight, ..., ExposureModeVendor } |
enum | FlashMode { FlashOff, FlashOn, FlashAuto, FlashRedEyeReduction, ..., FlashManual } |
enum | LockStatus { Unlocked, Searching, Locked } |
enum | State { UnloadedState, LoadedState, ActiveState } |
enum | WhiteBalanceMode { WhiteBalanceManual, WhiteBalanceAuto, WhiteBalanceSunlight, WhiteBalanceCloudy, ..., WhiteBalanceVendor } |
|
|
QDeclarativeCamera ( QDeclarativeItem * parent = 0 ) | |
~QDeclarativeCamera () | |
qreal | aperture () const |
State | cameraState () const |
QSize | captureResolution () const |
QString | capturedImagePath () const |
QImage | capturedImagePreview () const |
qreal | digitalZoom () const |
Error | error () const |
QString | errorString () const |
qreal | exposureCompensation () const |
ExposureMode | exposureMode () const |
int | flashMode () const |
int | isoSensitivity () const |
LockStatus | lockStatus () const |
int | manualWhiteBalance () const |
qreal | maximumDigitalZoom () const |
qreal | maximumOpticalZoom () const |
qreal | opticalZoom () const |
qreal | shutterSpeed () const |
WhiteBalanceMode | whiteBalanceMode () const |
virtual void | paint ( QPainter *, const QStyleOptionGraphicsItem *, QWidget * ) |
void | captureImage () |
void | searchAndLock () |
void | setCameraState ( State state ) |
void | setCaptureResolution ( const QSize & size ) |
void | setDigitalZoom ( qreal ) |
void | setExposureCompensation ( qreal ev ) |
void | setExposureMode ( QDeclarativeCamera::ExposureMode ) |
void | setFlashMode ( int ) |
void | setManualIsoSensitivity ( int iso ) |
void | setManualWhiteBalance ( int colorTemp ) const |
void | setOpticalZoom ( qreal ) |
void | setWhiteBalanceMode ( QDeclarativeCamera::WhiteBalanceMode mode ) const |
void | start () |
void | stop () |
void | unlock () |
void | apertureChanged ( qreal ) |
void | cameraStateChanged ( QDeclarativeCamera::State ) |
void | captureFailed ( const QString & message ) |
void | captureResolutionChanged ( const QSize & ) |
void | digitalZoomChanged ( qreal ) |
void | error ( QDeclarativeCamera::Error error, const QString & errorString ) |
void | errorChanged () |
void | exposureCompensationChanged ( qreal ) |
void | exposureModeChanged ( QDeclarativeCamera::ExposureMode ) |
void | flashModeChanged ( int ) |
void | imageCaptured ( const QString & preview ) |
void | imageSaved ( const QString & path ) |
void | isoSensitivityChanged ( int ) |
void | lockStatusChanged () |
void | manualWhiteBalanceChanged ( int ) const |
void | maximumDigitalZoomChanged ( qreal ) |
void | maximumOpticalZoomChanged ( qreal ) |
void | opticalZoomChanged ( qreal ) |
void | shutterSpeedChanged ( qreal ) |
void | whiteBalanceModeChanged ( QDeclarativeCamera::WhiteBalanceMode ) const |
virtual void | geometryChanged ( const QRectF & geometry, const QRectF & ) |
virtual void | keyPressEvent ( QKeyEvent * event ) |
virtual void | keyReleaseEvent ( QKeyEvent * event ) |
The QDeclarativeCamera class provides a camera item that you can add to a QDeclarativeView.
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::NoError | QCamera::NoError | No errors have occurred. |
QDeclarativeCamera::CameraError | QCamera::CameraError | An error has occurred. |
QDeclarativeCamera::InvalidRequestError | QCamera::InvalidRequestError | System resource doesn't support requested functionality. |
QDeclarativeCamera::ServiceMissingError | QCamera::ServiceMissingError | No camera service available. |
QDeclarativeCamera::NotSupportedFeatureError | QCamera::NotSupportedFeatureError | The feature is not supported. |
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::ExposureManual | 1 | Manual mode. |
QDeclarativeCamera::ExposureAuto | 0 | Automatic mode. |
QDeclarativeCamera::ExposureNight | 3 | Night mode. |
QDeclarativeCamera::ExposureBacklight | 4 | Backlight exposure mode. |
QDeclarativeCamera::ExposureSpotlight | 5 | Spotlight exposure mode. |
QDeclarativeCamera::ExposureSports | 6 | Spots exposure mode. |
QDeclarativeCamera::ExposureSnow | 7 | Snow exposure mode. |
QDeclarativeCamera::ExposureBeach | 8 | Beach exposure mode. |
QDeclarativeCamera::ExposureLargeAperture | 9 | Use larger aperture with small depth of field. |
QDeclarativeCamera::ExposureSmallAperture | 10 | Use smaller aperture. |
QDeclarativeCamera::ExposurePortrait | 2 | Portrait exposure mode. |
QDeclarativeCamera::ExposureModeVendor | 1000 | The base value for device specific exposure modes. |
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::FlashOff | 0x2 | Flash is Off. |
QDeclarativeCamera::FlashOn | 0x4 | Flash is On. |
QDeclarativeCamera::FlashAuto | 0x1 | Automatic flash. |
QDeclarativeCamera::FlashRedEyeReduction | 0x8 | Red eye reduction flash. |
QDeclarativeCamera::FlashFill | 0x10 | Use flash to fillin shadows. |
QDeclarativeCamera::FlashTorch | 0x20 | Constant light source, useful for focusing and video capture. |
QDeclarativeCamera::FlashSlowSyncFrontCurtain | 0x40 | Use the flash in conjunction with a slow shutter speed. This mode allows better exposure of distant objects and/or motion blur effect. |
QDeclarativeCamera::FlashSlowSyncRearCurtain | 0x80 | The similar mode to FlashSlowSyncFrontCurtain but flash is fired at the end of exposure. |
QDeclarativeCamera::FlashManual | 0x100 | Flash power is manually set. |
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::Unlocked | QCamera::Unlocked | The application is not interested in camera settings value. The camera may keep this parameter without changes, this is common with camera focus, or adjust exposure and white balance constantly to keep the viewfinder image nice. |
QDeclarativeCamera::Searching | QCamera::Searching | The application has requested the camera focus, exposure or white balance lock with searchAndLock(). This state indicates the camera is focusing or calculating exposure and white balance. |
QDeclarativeCamera::Locked | QCamera::Locked | The camera focus, exposure or white balance is locked. The camera is ready to capture, application may check the exposure parameters. |
The locked state usually means the requested parameter stays the same, except in the cases when the parameter is requested to be constantly updated. For example in continuous focusing mode, the focus is considered locked as long and the object is in focus, even while the actual focusing distance may be constantly changing.
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::UnloadedState | QCamera::UnloadedState | The initial camera state, with camera not loaded, the camera capabilities except of supported capture modes are unknown. While the supported settings are unknown in this state, it's allowed to set the camera capture settings like codec, resolution, or frame rate. |
QDeclarativeCamera::LoadedState | QCamera::LoadedState | The camera is loaded and ready to be configured. In the Idle state it's allowed to query camera capabilities, set capture resolution, codecs, etc. The viewfinder is not active in the loaded state. |
QDeclarativeCamera::ActiveState | QCamera::ActiveState | In the active state as soon as camera is started the viewfinder displays video frames and the camera is ready for capture. |
The default camera state is ActiveState.
Constant | Value | Description |
---|---|---|
QDeclarativeCamera::WhiteBalanceManual | 1 | Manual white balance. In this mode the manual white balance property value is used. |
QDeclarativeCamera::WhiteBalanceAuto | 0 | Auto white balance mode. |
QDeclarativeCamera::WhiteBalanceSunlight | 2 | Sunlight white balance mode. |
QDeclarativeCamera::WhiteBalanceCloudy | 3 | Cloudy white balance mode. |
QDeclarativeCamera::WhiteBalanceShade | 4 | Shade white balance mode. |
QDeclarativeCamera::WhiteBalanceTungsten | 5 | Tungsten white balance mode. |
QDeclarativeCamera::WhiteBalanceFluorescent | 6 | Fluorescent white balance mode. |
QDeclarativeCamera::WhiteBalanceIncandescent | 7 | Incandescent white balance mode. |
QDeclarativeCamera::WhiteBalanceFlash | 8 | Flash white balance mode. |
QDeclarativeCamera::WhiteBalanceSunset | 9 | Sunset white balance mode. |
QDeclarativeCamera::WhiteBalanceVendor | 1000 | Vendor defined white balance mode. |
The lens aperture as an F number (the ratio of the focal length to effective aperture diameter).
Access functions:
qreal | aperture () const |
Notifier signal:
void | apertureChanged ( qreal ) |
Access functions:
State | cameraState () const |
void | setCameraState ( State state ) |
Notifier signal:
void | cameraStateChanged ( QDeclarativeCamera::State ) |
The resolution to capture the image at. If empty, the system will pick a good size.
Access functions:
QSize | captureResolution () const |
void | setCaptureResolution ( const QSize & size ) |
Notifier signal:
void | captureResolutionChanged ( const QSize & ) |
Access functions:
QString | capturedImagePath () const |
Notifier signal:
void | imageSaved ( const QString & path ) |
The current digital zoom factor.
Access functions:
qreal | digitalZoom () const |
void | setDigitalZoom ( qreal ) |
Notifier signal:
void | digitalZoomChanged ( qreal ) |
Access functions:
QString | errorString () const |
Notifier signal:
void | errorChanged () |
Adjustment for the automatically calculated exposure. The value is in EV units.
Access functions:
qreal | exposureCompensation () const |
void | setExposureCompensation ( qreal ev ) |
Notifier signal:
void | exposureCompensationChanged ( qreal ) |
Camera exposure modes.
Access functions:
ExposureMode | exposureMode () const |
void | setExposureMode ( QDeclarativeCamera::ExposureMode ) |
Notifier signal:
void | exposureModeChanged ( QDeclarativeCamera::ExposureMode ) |
Access functions:
int | flashMode () const |
void | setFlashMode ( int ) |
Notifier signal:
void | flashModeChanged ( int ) |
Access functions:
int | isoSensitivity () const |
void | setManualIsoSensitivity ( int iso ) |
Notifier signal:
void | isoSensitivityChanged ( int ) |
Access functions:
LockStatus | lockStatus () const |
Notifier signal:
void | lockStatusChanged () |
Access functions:
int | manualWhiteBalance () const |
void | setManualWhiteBalance ( int colorTemp ) const |
Notifier signal:
void | manualWhiteBalanceChanged ( int ) const |
The maximum digital zoom factor, or 1.0 if digital zoom is not supported.
Access functions:
qreal | maximumDigitalZoom () const |
Notifier signal:
void | maximumDigitalZoomChanged ( qreal ) |
The maximum optical zoom factor, or 1.0 if optical zoom is not supported.
Access functions:
qreal | maximumOpticalZoom () const |
Notifier signal:
void | maximumOpticalZoomChanged ( qreal ) |
The current optical zoom factor.
Access functions:
qreal | opticalZoom () const |
void | setOpticalZoom ( qreal ) |
Notifier signal:
void | opticalZoomChanged ( qreal ) |
The camera's shutter speed, in seconds.
Access functions:
qreal | shutterSpeed () const |
Notifier signal:
void | shutterSpeedChanged ( qreal ) |
Access functions:
WhiteBalanceMode | whiteBalanceMode () const |
void | setWhiteBalanceMode ( QDeclarativeCamera::WhiteBalanceMode mode ) const |
Notifier signal:
void | whiteBalanceModeChanged ( QDeclarativeCamera::WhiteBalanceMode ) const |
See also WhiteBalanceMode.