MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QML Camera Element

The Camera element allows you to add camera viewfinder to a scene. More...

Inherits Item

Camera instantiates the C++ class QDeclarativeCamera

This element was introduced in Mobility 1.1.

Properties

Signals

Detailed Description

This element is part of the QtMultimediaKit 1.1 module.

 import Qt 4.7
 import QtMultimediaKit 1.1

 Camera {
     focus : visible // to receive focus and capture key events when visible

     flashMode: Camera.FlashRedEyeReduction
     whiteBalanceMode: Camera.WhiteBalanceFlash
     exposureCompensation: -1.0

     onImageCaptured : {
         photoPreview.source = preview  // Show the preview in an Image element
     }

 }

You can use the Camera element to capture images from a camera, and manipulate the capture and processing settings that get applied to the image.

Note: On Symbian, your process requires the UserEnvironment capability to use this element.

Property Documentation

read-onlyaperture : real

The lens aperture as an F number (the ratio of the focal length to effective aperture diameter).

This property group was introduced in Mobility 1.1.


cameraState : enumeration

The current state of the camera object.

Value Description
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.
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.

ActiveState In the active state as soon as camera is started the viewfinder displays video frames and the camera is ready for capture.

This property group was introduced in Mobility 1.1.


captureResolution : size

The resolution to capture the image at. If empty, the system will pick a good size.

This property group was introduced in Mobility 1.1.


read-onlycapturedImagePath : string

The path to the captured image.

This property group was introduced in Mobility 1.1.


digitalZoom : real

The current digital zoom factor.

This property group was introduced in Mobility 1.1.


read-onlyerrorString : string

A description of the current error, if any.

This property group was introduced in Mobility 1.1.


exposureCompensation : real

Adjustment for the automatically calculated exposure. The value is in EV units.

This property group was introduced in Mobility 1.1.


exposureMode : enumeration

Value Description
ExposureManual Manual mode.
ExposureAuto Automatic mode.
ExposureNight Night mode.
ExposureBacklight Backlight exposure mode.
ExposureSpotlight Spotlight exposure mode.
ExposureSports Spots exposure mode.
ExposureSnow Snow exposure mode.
ExposureBeach Beach exposure mode.
ExposureLargeAperture Use larger aperture with small depth of field.
ExposureSmallAperture Use smaller aperture.
ExposurePortrait Portrait exposure mode.
ExposureModeVendor The base value for device specific exposure modes.

This property group was introduced in Mobility 1.1.


flashMode : enumeration

Value Description
FlashOff Flash is Off.
FlashOn Flash is On.
FlashAuto Automatic flash.
FlashRedEyeReduction Red eye reduction flash.
FlashFill Use flash to fillin shadows.
FlashTorch Constant light source, useful for focusing and video capture.
FlashSlowSyncFrontCurtain Use the flash in conjunction with a slow shutter speed. This mode allows better exposure of distant objects and/or motion blur effect.
FlashSlowSyncRearCurtain The similar mode to FlashSlowSyncFrontCurtain but flash is fired at the end of exposure.
FlashManual Flash power is manually set.

This property group was introduced in Mobility 1.1.


isoSensitivity : real

The sensor's ISO sensitivity.

This property group was introduced in Mobility 1.1.


read-onlylockStatus : enumeration

The overall status for all the requested camera locks.

Value Description
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.
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.
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.

This property group was introduced in Mobility 1.1.


manualWhiteBalance : int

The color temperature used when in manual white balance mode (WhiteBalanceManual).

This property group was introduced in Mobility 1.1.

See also whiteBalanceMode.


read-onlymaximumDigitalZoom : real

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

This property group was introduced in Mobility 1.1.


read-onlymaximumOpticalZoom : real

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

This property group was introduced in Mobility 1.1.


opticalZoom : real

The current optical zoom factor.

This property group was introduced in Mobility 1.1.


read-onlyshutterSpeed : real

The camera's shutter speed, in seconds.

This property group was introduced in Mobility 1.1.


whiteBalanceMode : enumeration

Value Description
WhiteBalanceManual Manual white balance. In this mode the manual white balance property value is used.
WhiteBalanceAuto Auto white balance mode.
WhiteBalanceSunlight Sunlight white balance mode.
WhiteBalanceCloudy Cloudy white balance mode.
WhiteBalanceShade Shade white balance mode.
WhiteBalanceTungsten Tungsten white balance mode.
WhiteBalanceFluorescent Fluorescent white balance mode.
WhiteBalanceIncandescent Incandescent white balance mode.
WhiteBalanceFlash Flash white balance mode.
WhiteBalanceSunset Sunset white balance mode.
WhiteBalanceVendor Vendor defined white balance mode.

This property group was introduced in Mobility 1.1.

See also manualWhiteBalance.


Signal Documentation

Camera::apertureChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::cameraStateChanged ( Camera::State )

This documentation was introduced in Mobility 1.1.


Camera::captureResolutionChanged ( Item )

This documentation was introduced in Mobility 1.1.


Camera::digitalZoomChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::errorChanged ()

This documentation was introduced in Mobility 1.1.


Camera::exposureCompensationChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::exposureModeChanged ( Camera::ExposureMode )

This documentation was introduced in Mobility 1.1.


Camera::flashModeChanged ( int mode )

The flash mode is now mode.

This documentation was introduced in Mobility 1.1.

See also QDeclarativeCamera::FlashMode.


Camera::imageCaptured ( string )

This documentation was introduced in Mobility 1.1.


Camera::imageSaved ( string )

This documentation was introduced in Mobility 1.1.


Camera::isoSensitivityChanged ( int )

This documentation was introduced in Mobility 1.1.


Camera::lockStatusChanged ()

This documentation was introduced in Mobility 1.1.


Camera::manualWhiteBalanceChanged ( int )

This documentation was introduced in Mobility 1.1.


Camera::maximumDigitalZoomChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::maximumOpticalZoomChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::onCaptureFailed ( message )

This handler is called when an error occurs during capture. A descriptive message is available in message.

This documentation was introduced in Mobility 1.1.


Camera::onError ( error, errorString )

This handler is called when an error occurs. The enumeration value error is one of the values defined below, and a descriptive string value is available in errorString.

Value Description
NoError No errors have occurred.
CameraError An error has occurred.
InvalidRequestError System resource doesn't support requested functionality.
ServiceMissingError No camera service available.
NotSupportedFeatureError The feature is not supported.

This documentation was introduced in Mobility 1.1.


Camera::onImageCaptured ( preview )

This handler is called when an image has been captured but not yet saved to the filesystem. The preview parameter can be used as the URL supplied to an Image element.

This documentation was introduced in Mobility 1.1.

See also onImageSaved.


Camera::onImageSaved ( path )

This handler is called after the image has been written to the filesystem. The path is a local file path, not a URL.

This documentation was introduced in Mobility 1.1.

See also onImageCaptured.


Camera::opticalZoomChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::shutterSpeedChanged ( real )

This documentation was introduced in Mobility 1.1.


Camera::stateChanged ( Camera::State )

This documentation was introduced in Mobility 1.1.


Camera::whiteBalanceModeChanged ( Camera::WhiteBalanceMode )

This documentation was introduced in Mobility 1.1.