![]() |
Home · All Classes · All Functions · | ![]() |
The QCamera class provides interface for system camera devices. More...
#include <QCamera>
This class is under development and is subject to change.
Inherits QMediaObject.
enum | CaptureMode { CaptureDisabled, CaptureStillImage, CaptureVideo } |
flags | CaptureModes |
enum | Error { NoError, CameraError, NotReadyToCaptureError, InvalidRequestError, ServiceMissingError, NotSupportedFeatureError } |
enum | ExposureMode { ExposureManual, ExposureAuto, ExposureNight, ExposureBacklight, ..., ExposurePortrait } |
flags | ExposureModes |
enum | ExposureStatus { CorrectExposure, UnderExposure, OverExposure } |
enum | FlashMode { FlashOff, FlashOn, FlashAuto, FlashRedEyeReduction, FlashFill } |
flags | FlashModes |
enum | FocusMode { ManualFocus, AutoFocus, ContinuousFocus, InfinityFocus, HyperfocalFocus } |
flags | FocusModes |
enum | FocusStatus { FocusIntial, FocusRequested, FocusCanceled, FocusReached, FocusLost, FocusUnableToReach } |
enum | MeteringMode { MeteringAverage, MeteringSpot, MeteringMatrix } |
flags | MeteringModes |
enum | State { ActiveState, SuspendedState, StoppedState } |
enum | WhiteBalanceMode { WhiteBalanceManual, WhiteBalanceAuto, WhiteBalanceSunlight, WhiteBalanceCloudy, ..., WhiteBalanceSunset } |
flags | WhiteBalanceModes |
|
|
QCamera ( QObject * parent = 0, QMediaServiceProvider * provider = QMediaServiceProvider::defaultServiceProvider() ) | |
QCamera ( const QByteArray & device, QObject * parent = 0 ) | |
~QCamera () | |
qreal | aperture () const |
CaptureMode | captureMode () const |
qreal | digitalZoom () const |
Error | error () const |
QString | errorString () const |
qreal | exposureCompensation () const |
ExposureMode | exposureMode () const |
FlashMode | flashMode () const |
FocusMode | focusMode () const |
FocusStatus | focusStatus () const |
bool | isExposureLocked () const |
bool | isFlashReady () const |
bool | isMacroFocusingSupported () const |
int | isoSensitivity () const |
bool | macroFocusingEnabled () const |
int | manualWhiteBalance () const |
qreal | maximumDigitalZoom () const |
qreal | maximumOpticalZoom () const |
MeteringMode | meteringMode () const |
qreal | opticalZoom () const |
void | setAutoAperture () |
void | setAutoIsoSensitivity () |
void | setAutoShutterSpeed () |
void | setExposureCompensation ( qreal ev ) |
void | setExposureMode ( ExposureMode mode ) |
void | setFlashMode ( FlashMode mode ) |
void | setFocusMode ( FocusMode mode ) |
void | setMacroFocusingEnabled ( bool enabled ) |
void | setManualAperture ( qreal aperture ) |
void | setManualIsoSensitivity ( int iso ) |
void | setManualShutterSpeed ( qreal seconds ) |
void | setManualWhiteBalance ( int colorTemperature ) |
void | setMeteringMode ( MeteringMode mode ) |
void | setWhiteBalanceMode ( WhiteBalanceMode mode ) |
qreal | shutterSpeed () const |
State | state () const |
QList<qreal> | supportedApertures ( bool * continuous = 0 ) const |
CaptureModes | supportedCaptureModes () const |
ExposureModes | supportedExposureModes () const |
FlashModes | supportedFlashModes () const |
FocusModes | supportedFocusModes () const |
QList<int> | supportedIsoSensitivities ( bool * continuous = 0 ) const |
MeteringModes | supportedMeteringModes () const |
QList<qreal> | supportedShutterSpeeds ( bool * continuous = 0 ) const |
WhiteBalanceModes | supportedWhiteBalanceModes () const |
WhiteBalanceMode | whiteBalanceMode () const |
void | zoomTo ( qreal optical, qreal digital ) |
virtual QtMedia::AvailabilityError | availabilityError () const |
virtual bool | isAvailable () const |
void | cancelFocusing () |
void | lockExposure () |
void | setCaptureMode ( QCamera::CaptureMode mode ) |
void | start () |
void | startFocusing () |
void | stop () |
void | unlockExposure () |
void | apertureChanged ( qreal value ) |
void | apertureRangeChanged () |
void | captureModeChanged ( QCamera::CaptureMode ) |
void | digitalZoomChanged ( qreal ) |
void | error ( QCamera::Error value ) |
void | exposureLocked () |
void | flashReady ( bool ready ) |
void | focusReached () |
void | focusStatusChanged ( QCamera::FocusStatus status ) |
void | focusUnableToReach () |
void | isoSensitivityChanged ( int value ) |
void | opticalZoomChanged ( qreal ) |
void | shutterSpeedChanged ( qreal speed ) |
void | stateChanged ( QCamera::State state ) |
QList<QByteArray> | availableDevices () |
QString | deviceDescription ( const QByteArray & device ) |
The QCamera class provides interface for system camera devices.
QCamera can be used with QVideoWidget for viewfinder display and QMediaRecorder for video recording.
camera = new QCamera; viewFinder = new QVideoWidget(camera); viewFinder->show(); recorder = new QMediaRecorder(camera); imageCapture = new QStillImageCapture(camera); camera->start();
The Camera API of Qt Mobility is still in Technology Preview. It has not undergone the same level of review and testing as the rest of the APIs.
The API exposed by the classes in this component are not stable, and will undergo modification or removal prior to the final release of Qt Mobility.
The CaptureModes type is a typedef for QFlags<CaptureMode>. It stores an OR combination of CaptureMode values.
Constant | Value | Description |
---|---|---|
QCamera::NoError | 0 | No errors have occurred. |
QCamera::CameraError | 1 | An error has occurred. |
QCamera::NotReadyToCaptureError | 2 | System resource not available. |
QCamera::InvalidRequestError | 3 | System resource doesn't support functionality. |
QCamera::ServiceMissingError | 4 | No service available. |
QCamera::NotSupportedFeatureError | 5 | The feature is not supported. |
Constant | Value | Description |
---|---|---|
QCamera::ExposureManual | 0x1 | Manual mode. |
QCamera::ExposureAuto | 0x2 | Automatic mode. |
QCamera::ExposureNight | 0x4 | Night mode. |
QCamera::ExposureBacklight | 0x8 | Backlight exposure mode. |
QCamera::ExposureSpotlight | 0x10 | Spotlight exposure mode. |
QCamera::ExposureSports | 0x20 | Spots exposure mode. |
QCamera::ExposureSnow | 0x40 | Snow exposure mode. |
QCamera::ExposureBeach | 0x80 | Beach exposure mode. |
QCamera::ExposureLargeAperture | 0x100 | Use larger aperture with small depth of field. |
QCamera::ExposureSmallAperture | 0x200 | Use smaller aperture. |
QCamera::ExposurePortrait | 0x400 | Portrait exposure mode. |
The ExposureModes type is a typedef for QFlags<ExposureMode>. It stores an OR combination of ExposureMode values.
Constant | Value | Description |
---|---|---|
QCamera::CorrectExposure | 0 | The exposure is correct. |
QCamera::UnderExposure | 1 | The photo will be underexposed. |
QCamera::OverExposure | 2 | The photo will be overexposed. |
Constant | Value | Description |
---|---|---|
QCamera::FlashOff | 0x1 | Flash is Off. |
QCamera::FlashOn | 0x2 | Flash is On. |
QCamera::FlashAuto | 0x4 | Automatic flash. |
QCamera::FlashRedEyeReduction | 0x8 | Red eye reduction flash. |
QCamera::FlashFill | 0x10 | Use flash to fillin shadows. |
The FlashModes type is a typedef for QFlags<FlashMode>. It stores an OR combination of FlashMode values.
Constant | Value | Description |
---|---|---|
QCamera::ManualFocus | 0x1 | Manual focus mode. |
QCamera::AutoFocus | 0x8 | One-shot auto focus mode. |
QCamera::ContinuousFocus | 0x10 | Continuous auto focus mode. |
QCamera::InfinityFocus | 0x04 | Focus strictly to infinity. |
QCamera::HyperfocalFocus | 0x02 | Focus to hyperfocal distance, with with the maximum depth of field achieved. All objects at distances from half of this distance out to infinity will be acceptably sharp. |
The FocusModes type is a typedef for QFlags<FocusMode>. It stores an OR combination of FocusMode values.
Constant | Value | Description |
---|---|---|
QCamera::FocusIntial | ? | The initial focus state. |
QCamera::FocusRequested | 1 | Focus request is in progress. |
QCamera::FocusCanceled | 2 | The focus request was canceled. |
QCamera::FocusReached | 3 | Focus has been reached. |
QCamera::FocusLost | 4 | Focus has been lost. |
QCamera::FocusUnableToReach | 5 | Unable to achieve focus. |
When the QCamera::InfinityFocus or QCamera::HyperfocalFocus mode is requested, the focus status changes to QCamera::FocusRequested until the requested state is reached and stays in the QCamera::FocusReached status after.
In manual focusing mode the focus stays in the QCamera::FocusReached status, or, when supported by camera, QCamera::FocusLost and QCamera::FocusReached values could be used for manual focus notifications.
In autofocus mode, on focus request the status changes to QCamera::FocusRequested, and then depending on request results the focus status changes to QCamera::FocusReached, QCamera::FocusUnableToReach or QCamera::FocusCanceled.
In countinous autofocus mode, the status changes to QCamera::FocusRequested, and since the focus is reached is stays in QCamera::FocusReached and QCamera::FocusLost states until continous focusing is canceled with cancelAutofocus() or setFocusMode().
Constant | Value | Description |
---|---|---|
QCamera::MeteringAverage | 0x1 | Center weighted average metering mode. |
QCamera::MeteringSpot | 0x2 | Spot metering mode. |
QCamera::MeteringMatrix | 0x4 | Matrix metering mode. |
The MeteringModes type is a typedef for QFlags<MeteringMode>. It stores an OR combination of MeteringMode values.
Constant | Value | Description |
---|---|---|
QCamera::ActiveState | 0 | The camera has been started and can produce data. |
QCamera::SuspendedState | 1 | The camera is temporary not available, usually as a result of higher priority client requested the camera device. |
QCamera::StoppedState | 2 | The camera has been stopped. |
Constant | Value | Description |
---|---|---|
QCamera::WhiteBalanceManual | 0x1 | Manual white balance. In this mode the white balance should be set with setManualWhiteBalance() |
QCamera::WhiteBalanceAuto | 0x2 | Auto white balance mode. |
QCamera::WhiteBalanceSunlight | 0x4 | Sunlight white balance mode. |
QCamera::WhiteBalanceCloudy | 0x8 | Cloudy white balance mode. |
QCamera::WhiteBalanceShade | 0x10 | Shade white balance mode. |
QCamera::WhiteBalanceTungsten | 0x20 | Tungsten white balance mode. |
QCamera::WhiteBalanceFluorescent | 0x40 | Fluorescent white balance mode. |
QCamera::WhiteBalanceIncandescent | 0x80 | Incandescent white balance mode. |
QCamera::WhiteBalanceFlash | 0x100 | Flash white balance mode. |
QCamera::WhiteBalanceSunset | 0x200 | Sunset white balance mode. |
The WhiteBalanceModes type is a typedef for QFlags<WhiteBalanceMode>. It stores an OR combination of WhiteBalanceMode values.
This property holds lens aperture is specified as an F number, the ratio of the focal length to effective aperture diameter.
Access functions:
qreal | aperture () const |
void | setManualAperture ( qreal aperture ) |
Notifier signal:
void | apertureChanged ( qreal value ) |
Returns the type of media (video or still images), the camera is configured to capture.
Access functions:
CaptureMode | captureMode () const |
void | setCaptureMode ( QCamera::CaptureMode mode ) |
Notifier signal:
void | captureModeChanged ( QCamera::CaptureMode ) |
This property holds the sensor ISO sensitivity. Lower sensitivity, the noise is lower, but more light is needed.
Access functions:
int | isoSensitivity () const |
void | setManualIsoSensitivity ( int iso ) |
Notifier signal:
void | isoSensitivityChanged ( int value ) |
This property holds the effective length of time the shutter is open in seconds.
Access functions:
qreal | shutterSpeed () const |
void | setManualShutterSpeed ( qreal seconds ) |
Notifier signal:
void | shutterSpeedChanged ( qreal speed ) |
This property holds the current state of the camera object.
Access functions:
State | state () const |
Notifier signal:
void | stateChanged ( QCamera::State state ) |
Construct a QCamera from service provider and parent.
Construct a QCamera from device name device and parent.
Destroys the camera object.
Signal emitted when aperature changes to value.
Signal emitted when aperature range has changed.
Reimplemented from QMediaObject::availabilityError().
Returns the error state of the camera service.
Returns a list of camera device's available from the default service provider.
Cancels the single autofocus request or stops continuous focusing.
Does nothing in hyperfocal or infinity focus modes.
If supported by camera, startFocusing() turns off the manual focusing notifications, otherwise it does nothing in manual mode.
Returns the description of the device.
Returns the current digital zoom value.
See also QCamera::digitalZoomChanged(qreal) and QCamera::opticalZoom().
Returns the error state of the object.
Signal emitted when error state changes to value.
Returns a string describing a camera's error state.
Returns the exposure compensation.
See also setExposureCompensation().
Signal emitted when exposure locked.
Returns the exposure mode being used.
See also setExposureMode().
Returns the flash mode being used.
See also setFlashMode().
Signal emitted when flash status changed, flash is ready if ready true.
Returns the focus mode being used.
See also setFocusMode().
Signals the focus was reached. This signal is emited after focusStatus changes to QCamera::FocusReached state.
Returns the focus status
Signal emitted when focus status changed.
Signals the focus was unable to reach. This signal is emited after focusStatus changes to QCamera::FocusUnableToReach state.
Reimplemented from QMediaObject::isAvailable().
Returne true if the camera service is ready to use.
Return true if exposure locked.
Returns true if flash is charged.
Returns true if macro focusing is supported.
Signal emitted when sensitivity changes to value.
Lock the exposure.
Returns true if macro focusing enabled.
See also setMacroFocusingEnabled().
Returns the current color temperature if the manual white balance is active, otherwise the return value is undefined.
See also setManualWhiteBalance().
Returns the maximum digital zoom
Returns the maximum optical zoom
Returns the metering mode being used.
See also setMeteringMode().
Returns the current optical zoom value.
See also QCamera::opticalZoomChanged(qreal) and QCamera::digitalZoom().
Turn on auto aperture
Turn on auto sensitivity
Turn on auto shutter speed
Sets the exposure compensation to ev
See also exposureCompensation().
Set exposure mode to mode
See also exposureMode().
Set the flash mode to mode
See also flashMode().
Set the focus mode to mode
See also focusMode().
Set macro focusing to enabled.
See also macroFocusingEnabled().
Sets manual white balance to colorTemperature
See also manualWhiteBalance().
Sets the metering mode to mode.
See also meteringMode().
Sets the white balance to mode.
See also whiteBalanceMode().
Signals that a camera's shutter speed has changed.
Starts the camera.
This can involve powering up the camera device and can be asynchronyous.
State is changed to QCamera::ActiveState if camera is started succesfuly, otherwise error() signal is emited.
Starts single or continuous autofocus.
Does nothing in hyperfocal or infinity focus modes.
If supported by camera, startFocusing() turns on the manual focusing notifications, otherwise it does nothing in manual mode.
Signal emitted when state of the Camera object has changed.
Stops the camera.
Returns the list of aperture values camera supports. The apertures list can change depending on the focal length, in such a case the apertureRangeChanged() signal is emited.
If the camera supports arbitrary aperture values within the supported range, *continuous is set to true, otherwise *continuous is set to false.
Returns the supported capture modes.
Return the exposure modes available.
Returns the flash modes available.
Returns the focus modes available.
Returns the list of ISO senitivities camera supports.
If the camera supports arbitrary ISO sensitivities within the supported range, *continuous is set to true, otherwise *continuous is set to false.
Returns the metering modes available.
Returns the list of shutter speed values in seconds camera supports.
If the camera supports arbitrary shutter speed values within the supported range, *continuous is set to true, otherwise *continuous is set to false.
Returns the white balance modes available.
Unlock the exposure.
Returns the white balance mode being used.
See also setWhiteBalanceMode().
Set the camera optical and digital zoom values.
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt Mobility Project 1.0.0 |