Advanced Settings for Focus, Drive Modes, and Bracket Modes

This document provides a detailed description of various advanced settings of Ecam component.

Introduction

The advanced settings class, CCamera::CCameraAdvancedSettings, provides access to common camera hardware settings related to image acquisition for still images and video.

Focus mode

The high level steps to set the Camera focus mode are shown here:

The following example shows how to change the focus mode:

    // Assigns the focus mode to be set    
    CCamera::CCameraAdvancedSettings::TFocusMode focusMode = CCamera::CCameraAdvancedSettings::EFocusModeFixed;
    
    // Gets the supported modes
    TInt suppFocusModes = settings->SupportedFocusModes();// Checks if the focus mode is supported before setting it
    if (focusMode & suppFocusModes)
        {
           // Sets the focus mode if it is supported
        settings->SetFocusMode(focusMode);
        }

Focus range

Get the supported focus range using the enumerated type CCamera::CCameraAdvancedSettings:TFocusRange. This defines eight supported focus ranges:

Enum Value

Description

EFocusRangeAuto

Automatic

EFocusRangeMacro

Focus operates in close range

EFocusRangeMacro

Normal operation

EFocusRangeMacro

Extended (tele) operation

EFocusRangePortrait

Focus at larger areas at short to medium distance

EFocusRangeSuperMacro

Optimized macro operation, where depth of field is very shallow and observation area changes quickly

EFocusRangeHyperfocal

All objects at distances from half of the hyperfocal distance out to infinity will be in focus. This gives maximum depth of field.

EFocusRangeInfinite

Infinite range, when there is a near obstacle or better focus wanted for far away objects.

The following example shows how to change the focus range:

    // Assigns the focus range to EFocusRangeHyperfocal and checks if it is supported
    CCamera::CCameraAdvancedSettings::TFocusRange focusRange = CCamera::CCameraAdvancedSettings::EFocusRangeHyperfocal;
        
    // Gets the supported ranges            
    TInt suppRanges = settings->SupportedFocusRanges();
    
    // Checks if the focus range is supported before setting it.
    if (focusRange & suppRanges) 
        {
        // Sets the focus range if it is supported
        settings->SetFocusRange(focusRange);
        }

The result of SetFocusRange is notified to the client asynchronously through MCameraObserver2::HandleEvent() and with UID KUidECamEventCameraSettingFocusRange2.

Autofocus

Autofocus support for camera applications is controlled through the CCameraAdvancedSettings class.

Figure 1. Implementation of autofocus

Pressing the camera shutter key on the device halfway down generates additional key events. The key events can be used to activate autofocus if the camera hardware supports the functionality. Shutter release (image capture) can be triggered by pressing the key all the way down. The key presses generate separate key events. To capture other than autofocus key events from the shutter key, you need the SwEvent capability.

The settings you can use in your application depend on the camera hardware on the device. The Camera API allows you to query almost all features of the device camera. For example, to get a list of supported advanced settings, use the CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const method.

Get the supported autofocus types using the enumerated type CCamera::CCameraAdvancedSettings:TAutoFocusType. This defines three supported focus types:

Enum

Description

EAutoFocusTypeOff

Autofocus is switched off.

EAutoFocusTypeSingle

Operates on a single shot, consumes less power.

EAutoFocusTypeContinuous

Continuous autofocus, more precise but consumes more power. This is also known as AF Servo.

The following example shows how to change the autofocus type:

    CCamera::CCameraAdvancedSettings::TAutoFocusType focusType = CCamera::CCameraAdvancedSettings::EAutoFocusTypeOff;
    
    // Gets the supported focus types
    TInt suppFocusTypes = settings->SupportedAutoFocusTypes();
    
    // Checks if the focus type is supported before setting it.
    if (focusType & suppFocusTypes)
        {
        // Sets the focus type if it is supported
        settings->SetAutoFocusType(focusType);
        }

The result of CCamera::CCameraAdvancedSettings::SetAutoFocusType(TAutoFocusType aAutoFocusType) is notified to the client asynchronously through MCameraObserver2::HandleEvent() and with uid KUidECamEventCameraSettingAutoFocusType2.

For more information on how to easily use the device camera with zoom and autofocus, see S60 Platform: Camera Example. The Camera Wrapper provides a unified interface for various Symbian camera APIs. The example application supports the use of both the keypad and touch UI. The application can be self-signed, but it also provides an option to use the dedicated camera key (Symbian signing required).

Drive modes

Get the supported drive modes for the camera using the enumerated type CCamera::CCameraAdvancedSettings:TDriveMode that determines how and in what succession images are captured. This defines eight supported drive modes for the camera with the following Enum Values:

Enum Value

Description

EDriveModeAuto

Automatic

EDriveModeSingleShot

Camera takes a single image or shot

EDriveModeContinuous

Camera continuously captures images as fast as it can until it is stopped or it exceeds the storage space.

EDriveModeBracket

Camera is in bracketing mode, producing individual frames.

EDriveModeBracketMerge

Camera is in bracketing mode, but producing a single image. Use CCamera::CCameraAdvancedSettings::SetBracketMerge(TInt aStartIndex, TInt aFrames) method to work in this drive mode.

EDriveModeTimed

Camera captures a single shot after specified time period. Use CCamera::CCameraAdvancedSettings::SetTimerInterval(TInt aTimerInterval) method to work in this drive mode.

EDriveModeTimeLapse

Camera captures a set of images with an uniform interval between them. Use CCamera::CCameraAdvancedSettings::SetTimeLapse(const TTime& aStart, const TTime& aEnd, const TTime& aInterval) method to work in this drive mode.

EDriveModeBurst

Camera captures a set of images as fast as it can in batches or bursts. Use CCamera::CCameraAdvancedSettings::SetBurstImages(TInt aImages) method to set the number of burst images before capturing the image.

Note: There are chances that the actual number of images captured may be less important due to memory or image size limitations.

The following example shows how to change the drive mode:

    CCamera::CCameraAdvancedSettings::TDriveMode driveMode = CCamera::CCameraAdvancedSettings::EDriveModeSingleShot;
    
    // Gets the supported drive modes
    TInt suppDriveModes = settings->SupportedDriveModes();
    
    // Checks if the drive mode is supported before setting it.
    if (driveMode & suppDriveModes) 
        {
        // Sets the drive mode
        settings->(driveMode);
        }

The result of CCamera::CCameraAdvancedSettings::SetDriveMode(TDriveMode aDriveMode) is notified to the client asynchronously through MCameraObserver2::HandleEvent() and with uid KUidECamEventCameraSettingDriveMode.

Bracket modes

Bracket mode is a type of drive mode, which is called using CCamera::CCameraAdvancedSettings::EDriveModeBracket.

Bracket mode involves the camera taking a sequence of pictures, while automatically varying a camera setting, such as exposure, over a range of values. The enumerated type CCamera::CCameraAdvancedSettings:TBracketMode defines three supported bracket modes for the camera. The setting that is varied is called the bracket parameter, and is represented by the CCamera::CCameraAdvancedSettings:TBracketParameter enumeration, while the scale of the change to the setting to make for each new picture is called the bracket step, and is represented by the CCamera::CCameraAdvancedSettings:TBracketStep enumeration. The possible bracket modes are:

Enum Value

Description

EBracketModeOff

Bracket mode is switched off. This is the default value.

EBracketMode3Image

Bracket mode on. Three consecutive pictures are taken in order, with the setting at under (-1), on (0), and over (+1).

EBracketMode5Image

Bracket mode on. Five consecutive pictures are taken in order, with the setting at under (-2), under (-1), on (0), over (+1), and over (+2).

The following example shows how to change the bracket mode:

    CCamera::CCameraAdvancedSettings::TBracketMode bracketMode = CCamera::CCameraAdvancedSettings::EBracketMode3Image;
    
    // Gets the supported bracket modes
    TInt suppBracketModes = settings->SupportedBracketModes();
    
    // Checks if the bracket mode is supported before setting it.
    if (bracketMode & suppBracketModes) 
        {
        settings->SetBracketMode(bracketMode);    
        }

Zoom Mode

The high level steps to perform various operations in zoom mode are listed below:

Extending Pixel Aspect Ratio

You can use the pixel aspect ratio to provide settings for PAL, NTSC and NTSC4:3. For this, you need to extend the enumeration of enum CCamera::CCameraAdvancedSettings:TPixelAspectRatio as follows:

Enum Value

Description

TPixelAspectRatio::EEPixelAspect16:11

PAL

TPixelAspectRatio::EEPixelAspect40:33

NTSC

TPixelAspectRatio::EEPixelAspect10:11

NTSC4:3

Use CCamera::CCameraAdvancedSettings::PixelAspectRatio() method to get the current pixel aspect ratio.

Use CCamera::CCameraAdvancedSettings::SetPixelAspectRatio(TPixelAspectRatio aPixelAspectRatio) method to set the pixel aspect ratio. Notify MCameraObserver2 clients with KUidECamEventPixelAspectRatio event.

Miscellaneous

This section details the miscellaneous APIs used in CCameraAdvancedSettings class.

See also

Overview for the advanced settings of Camera

The Advanced Camera Settings tutorials.

The S60 Platform: Camera Example.