QtMobility Reference Documentation

Contents

QDeclarativeCamera Class Reference

The QDeclarativeCamera class provides a camera item that you can add to a QDeclarativeView. More...

 #include <QDeclarativeCamera>

Inherits QDeclarativeItem.

Public Types

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 }

Properties

Public Functions

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

Reimplemented Public Functions

virtual void paint ( QPainter *, const QStyleOptionGraphicsItem *, QWidget * )

Public Slots

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 ()

Signals

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

Reimplemented Protected Functions

virtual void geometryChanged ( const QRectF & geometry, const QRectF & )
virtual void keyPressEvent ( QKeyEvent * event )
virtual void keyReleaseEvent ( QKeyEvent * event )

Additional Inherited Members

Detailed Description

The QDeclarativeCamera class provides a camera item that you can add to a QDeclarativeView.

Member Type Documentation

enum QDeclarativeCamera::Error

ConstantValueDescription
QDeclarativeCamera::NoErrorQCamera::NoErrorNo errors have occurred.
QDeclarativeCamera::CameraErrorQCamera::CameraErrorAn error has occurred.
QDeclarativeCamera::InvalidRequestErrorQCamera::InvalidRequestErrorSystem resource doesn't support requested functionality.
QDeclarativeCamera::ServiceMissingErrorQCamera::ServiceMissingErrorNo camera service available.
QDeclarativeCamera::NotSupportedFeatureErrorQCamera::NotSupportedFeatureErrorThe feature is not supported.

enum QDeclarativeCamera::ExposureMode

ConstantValueDescription
QDeclarativeCamera::ExposureManual1Manual mode.
QDeclarativeCamera::ExposureAuto0Automatic mode.
QDeclarativeCamera::ExposureNight3Night mode.
QDeclarativeCamera::ExposureBacklight4Backlight exposure mode.
QDeclarativeCamera::ExposureSpotlight5Spotlight exposure mode.
QDeclarativeCamera::ExposureSports6Spots exposure mode.
QDeclarativeCamera::ExposureSnow7Snow exposure mode.
QDeclarativeCamera::ExposureBeach8Beach exposure mode.
QDeclarativeCamera::ExposureLargeAperture9Use larger aperture with small depth of field.
QDeclarativeCamera::ExposureSmallAperture10Use smaller aperture.
QDeclarativeCamera::ExposurePortrait2Portrait exposure mode.
QDeclarativeCamera::ExposureModeVendor1000The base value for device specific exposure modes.

enum QDeclarativeCamera::FlashMode

ConstantValueDescription
QDeclarativeCamera::FlashOff0x2Flash is Off.
QDeclarativeCamera::FlashOn0x4Flash is On.
QDeclarativeCamera::FlashAuto0x1Automatic flash.
QDeclarativeCamera::FlashRedEyeReduction0x8Red eye reduction flash.
QDeclarativeCamera::FlashFill0x10Use flash to fillin shadows.
QDeclarativeCamera::FlashTorch0x20Constant light source, useful for focusing and video capture.
QDeclarativeCamera::FlashSlowSyncFrontCurtain0x40Use the flash in conjunction with a slow shutter speed. This mode allows better exposure of distant objects and/or motion blur effect.
QDeclarativeCamera::FlashSlowSyncRearCurtain0x80The similar mode to FlashSlowSyncFrontCurtain but flash is fired at the end of exposure.
QDeclarativeCamera::FlashManual0x100Flash power is manually set.

enum QDeclarativeCamera::LockStatus

ConstantValueDescription
QDeclarativeCamera::UnlockedQCamera::UnlockedThe 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::SearchingQCamera::SearchingThe 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::LockedQCamera::LockedThe 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.

enum QDeclarativeCamera::State

ConstantValueDescription
QDeclarativeCamera::UnloadedStateQCamera::UnloadedStateThe 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::LoadedStateQCamera::LoadedStateThe 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::ActiveStateQCamera::ActiveStateIn 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.

enum QDeclarativeCamera::WhiteBalanceMode

ConstantValueDescription
QDeclarativeCamera::WhiteBalanceManual1Manual white balance. In this mode the manual white balance property value is used.
QDeclarativeCamera::WhiteBalanceAuto0Auto white balance mode.
QDeclarativeCamera::WhiteBalanceSunlight2Sunlight white balance mode.
QDeclarativeCamera::WhiteBalanceCloudy3Cloudy white balance mode.
QDeclarativeCamera::WhiteBalanceShade4Shade white balance mode.
QDeclarativeCamera::WhiteBalanceTungsten5Tungsten white balance mode.
QDeclarativeCamera::WhiteBalanceFluorescent6Fluorescent white balance mode.
QDeclarativeCamera::WhiteBalanceIncandescent7Incandescent white balance mode.
QDeclarativeCamera::WhiteBalanceFlash8Flash white balance mode.
QDeclarativeCamera::WhiteBalanceSunset9Sunset white balance mode.
QDeclarativeCamera::WhiteBalanceVendor1000Vendor defined white balance mode.

Property Documentation

aperture : const qreal

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 )

cameraState : State

Access functions:

State cameraState () const
void setCameraState ( State state )

Notifier signal:

void cameraStateChanged ( QDeclarativeCamera::State )

captureResolution : QSize

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 & )

capturedImagePath : const QString

Access functions:

QString capturedImagePath () const

Notifier signal:

void imageSaved ( const QString & path )

digitalZoom : qreal

The current digital zoom factor.

Access functions:

qreal digitalZoom () const
void setDigitalZoom ( qreal )

Notifier signal:

void digitalZoomChanged ( qreal )

errorString : const QString

Access functions:

QString errorString () const

Notifier signal:

void errorChanged ()

exposureCompensation : qreal

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 )

exposureMode : ExposureMode

Camera exposure modes.

Access functions:

ExposureMode exposureMode () const
void setExposureMode ( QDeclarativeCamera::ExposureMode )

Notifier signal:

void exposureModeChanged ( QDeclarativeCamera::ExposureMode )

flashMode : int

Access functions:

int flashMode () const
void setFlashMode ( int )

Notifier signal:

void flashModeChanged ( int )

iso : int

Access functions:

int isoSensitivity () const
void setManualIsoSensitivity ( int iso )

Notifier signal:

void isoSensitivityChanged ( int )

lockStatus : const LockStatus

Access functions:

LockStatus lockStatus () const

Notifier signal:

void lockStatusChanged ()

manualWhiteBalance : int

Access functions:

int manualWhiteBalance () const
void setManualWhiteBalance ( int colorTemp ) const

Notifier signal:

void manualWhiteBalanceChanged ( int ) const

maximumDigitalZoom : const qreal

The maximum digital zoom factor, or 1.0 if digital zoom is not supported.

Access functions:

qreal maximumDigitalZoom () const

Notifier signal:

void maximumDigitalZoomChanged ( qreal )

maximumOpticalZoom : const 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 )

opticalZoom : qreal

The current optical zoom factor.

Access functions:

qreal opticalZoom () const
void setOpticalZoom ( qreal )

Notifier signal:

void opticalZoomChanged ( qreal )

shutterSpeed : const qreal

The camera's shutter speed, in seconds.

Access functions:

qreal shutterSpeed () const

Notifier signal:

void shutterSpeedChanged ( qreal )

whiteBalanceMode : WhiteBalanceMode

Access functions:

WhiteBalanceMode whiteBalanceMode () const
void setWhiteBalanceMode ( QDeclarativeCamera::WhiteBalanceMode mode ) const

Notifier signal:

void whiteBalanceModeChanged ( QDeclarativeCamera::WhiteBalanceMode ) const

See also WhiteBalanceMode.

Member Function Documentation

QDeclarativeCamera::QDeclarativeCamera ( QDeclarativeItem * parent = 0 )

QDeclarativeCamera::~QDeclarativeCamera ()

void QDeclarativeCamera::apertureChanged ( qreal ) [signal]

void QDeclarativeCamera::cameraStateChanged ( QDeclarativeCamera::State ) [signal]

void QDeclarativeCamera::captureFailed ( const QString & message ) [signal]

void QDeclarativeCamera::captureImage () [slot]

void QDeclarativeCamera::captureResolutionChanged ( const QSize & ) [signal]

QImage QDeclarativeCamera::capturedImagePreview () const

void QDeclarativeCamera::digitalZoomChanged ( qreal ) [signal]

Error QDeclarativeCamera::error () const

void QDeclarativeCamera::error ( QDeclarativeCamera::Error error, const QString & errorString ) [signal]

void QDeclarativeCamera::errorChanged () [signal]

void QDeclarativeCamera::exposureCompensationChanged ( qreal ) [signal]

void QDeclarativeCamera::exposureModeChanged ( QDeclarativeCamera::ExposureMode ) [signal]

void QDeclarativeCamera::flashModeChanged ( int ) [signal]

void QDeclarativeCamera::geometryChanged ( const QRectF & geometry, const QRectF & ) [virtual protected]

void QDeclarativeCamera::imageCaptured ( const QString & preview ) [signal]

void QDeclarativeCamera::imageSaved ( const QString & path ) [signal]

void QDeclarativeCamera::isoSensitivityChanged ( int ) [signal]

void QDeclarativeCamera::keyPressEvent ( QKeyEvent * event ) [virtual protected]

void QDeclarativeCamera::keyReleaseEvent ( QKeyEvent * event ) [virtual protected]

void QDeclarativeCamera::lockStatusChanged () [signal]

void QDeclarativeCamera::manualWhiteBalanceChanged ( int ) const [signal]

void QDeclarativeCamera::maximumDigitalZoomChanged ( qreal ) [signal]

void QDeclarativeCamera::maximumOpticalZoomChanged ( qreal ) [signal]

void QDeclarativeCamera::opticalZoomChanged ( qreal ) [signal]

void QDeclarativeCamera::paint ( QPainter *, const QStyleOptionGraphicsItem *, QWidget * ) [virtual]

void QDeclarativeCamera::searchAndLock () [slot]

void QDeclarativeCamera::shutterSpeedChanged ( qreal ) [signal]

void QDeclarativeCamera::start () [slot]

void QDeclarativeCamera::stop () [slot]

void QDeclarativeCamera::unlock () [slot]

void QDeclarativeCamera::whiteBalanceModeChanged ( QDeclarativeCamera::WhiteBalanceMode ) const [signal]