class CCamera::CCameraSnapshot : public CBase |
This class allows the client to request snapshot data in a specified image format for both still images and video.
Snapshot object may be created out of new classes: CCameraImageCapture and CCameraVideoCaptureControl . The client selects snapshot parameters calling PrepareSnapshotL(const TSnapshotParameters& aSnapshotParameters) . It can then enable and disable the snapshot generation by calling EnableSnapshotL() and DisableSnapshotL() . The client application using this API shall provide MCaptureImageObserver and MCaptureVideoObserver interface. Callbacks available are MCaptureImageObserver :: ClientSnapshotForImageReady and MCaptureVideoObserver::ClientSnapshotReady .
Snapshots are supposed to be displayed on a particular viewfinder. So, while destruction, client shall destroy snapshot first. In general, child objects shall be destroyed before the parent objects.
Following is valid for older clients who created snapshots using NewL method:- The client selects snapshot parameters calling PrepareSnapshotL() . It can then start and stop receiving notifications from the ECam implementation by calling StartSnapshot() and StopSnapshot() . The client application using this API should provide MCameraObserver2 interface to be signalled, with event KUidECamEventCameraSnapshot, when snapshot data is available to be retrieved from the ECam implementation. The client can then retrieve the snapshot data from the ECam implementation calling SnapshotDataL() .
This class provides a standardised client interface for the camera snapshot. Classes cannot be derived from it.
If the class methods leave, the output type parameter value is not guaranteed to be valid.
Public Member Functions | |
---|---|
~CCameraSnapshot () | |
IMPORT_C CCamera::CCameraV2Histogram * | CreateHistogramHandleL () |
IMPORT_C void | DisableSnapshotL () |
IMPORT_C void | EnableSnapshotL () |
IMPORT_C void | GetSnapshotParametersL ( TSnapshotParameters &) |
IMPORT_C void | GetSnapshotStatusL ( TSnapshotState &) |
IMPORT_C TBool | IsSnapshotActive () |
IMPORT_C CCameraSnapshot * | NewL ( CCamera &) |
IMPORT_C void | PrepareSnapshotL ( CCamera::TFormat , const TPoint &, const TSize &, const TRgb &, TBool ) |
IMPORT_C void | PrepareSnapshotL ( CCamera::TFormat , const TSize &, TBool ) |
IMPORT_C void | PrepareSnapshotL (const TSnapshotParameters &) |
IMPORT_C void | SelectSnapshotVideoFramesL ( TSnapshotVideoFrames ) |
IMPORT_C void | SetBgColorL (const TRgb &) |
IMPORT_C void | SetPositionL (const TPoint &) |
IMPORT_C void | SetSnapshotParametersL (const TSnapshotParameters &) |
IMPORT_C MCameraBuffer & | SnapshotDataL ( RArray < TInt > &) |
IMPORT_C void | StartSnapshot () |
IMPORT_C void | StopSnapshot () |
IMPORT_C TUint32 | SupportedFormats () |
Private Member Functions | |
---|---|
CCameraSnapshot ( CCamera &) | |
void | ConstructL () |
void | ConstructL (const MImplementationFactory &, TInt ) |
IMPORT_C CCameraSnapshot * | CreateL ( CCamera &, MImplementationFactory &, TInt ) |
Public Member Enumerations | |
---|---|
enum | TSnapshotState { ESnapshotNotCreated , ESnapshotInactive , ESnapshotActive , ESnapshotDisabled } |
enum | TSnapshotVideoFrames { ESnapshotVideoFirstFrame , ESnapshotVideoLastFrame , ESnapshotVideoFirstAndLastFrame , ESnapshotVideoEveryFrame } |
Private Attributes | |
---|---|
MCameraSnapshot * | iImpl |
MCameraSnapshot2 * | iImpl2 |
CCamera & | iOwner |
CCameraSnapshot | ( | CCamera & | aOwner | ) | [private] |
Constructor for the CCamera::CCameraSnapshot class.
CCamera & aOwner | A reference to the camera object for which a camera snapshot object is to be created. |
IMPORT_C | ~CCameraSnapshot | ( | ) |
Destructor for the CCamera::CCameraSnapshot class.
The child objects(for example,hisotgrams) created out of this snapshot class object shall be delete beforehand.
void | ConstructL | ( | ) | [private] |
CCameraSnapshot second phase constructor.
This function is used to initialise internal state of the object. It uses reference to the camera to retrieve snapshot interface pointer.
void | ConstructL | ( | const MImplementationFactory & | aImplFactory, |
TInt | aClientViewFinderId | |||
) | [private] |
CCameraSnapshot second phase constructor
Function used to initialise internal state of the object specifically for image capture or video capture. This may be used in other possible cases as well.
This method is supposed to be used by this class only.
const MImplementationFactory & aImplFactory | A constant reference to the MImplementationFactory derived object. |
TInt aClientViewFinderId | The client viewfinder on which this client snapshot will be displayed. |
IMPORT_C CCamera::CCameraV2Histogram * | CreateHistogramHandleL | ( | ) | const |
Retrieve pointer to histogram API in order to use it specifically for snapshots.
Different types of histogram may be used for a snapshot. Every time this method will be called on the CCameraSnapshot class object, a new type of histogram will be created.
IMPORT_C CCameraSnapshot * | CreateL | ( | CCamera & | aCamera, |
MImplementationFactory & | aImplFactory, | |||
TInt | aClientViewFinderId | |||
) | [private, static] |
Factory function that creates a new camera snapshot object specifically for image capture or video capture.
CCamera & aCamera | A reference to the camera object for which a camera snapshot object is to be created. |
MImplementationFactory & aImplFactory | A reference to the MImplementationFactory derived object. |
TInt aClientViewFinderId | The client viewfinder on which this client snapshot will be displayed. |
IMPORT_C void | DisableSnapshotL | ( | ) |
Deactivates the snapshot feature if it is active.
Once the snapshot has been deactivated, the client will no longer receive notifications about snapshots.
IMPORT_C void | EnableSnapshotL | ( | ) |
Activates the snapshot feature. Calls to this method when the snapshot feature is already active will be ignored.
The client will not receive snapshot notifications until the snapshot feature is activated.
Client shall implement the observers: MCaptureImageObserver and MCaptureVideoObserver . Snapshot notifications will be send to the clients via these observers and not through events.
IMPORT_C void | GetSnapshotParametersL | ( | TSnapshotParameters & | aSnapshotParameters | ) |
Retrieves the snapshot parameters used by the ECam implementation for snapshot creation.
This method is used to retrieve snapshot parameters.
TSnapshotParameters & aSnapshotParameters | Retrieves the currently used snapshot parameters. |
IMPORT_C void | GetSnapshotStatusL | ( | TSnapshotState & | aSnapshotState | ) | const |
Retrieves the current status for the snapshot.
This method is used to retrieve the snapshot status.
TSnapshotState & aSnapshotState | Retrieves information about the snapshot current state. |
IMPORT_C TBool | IsSnapshotActive | ( | ) | const |
Use void GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& aSnapshotState) const ;
Determines if the snapshot feature is active.
IMPORT_C CCameraSnapshot * | NewL | ( | CCamera & | aCamera | ) | [static] |
Factory function that creates a new camera snapshot object on the heap.
This will be deprecated shortly. Snapshot should be used via CCameraImageCapture::GetSnapshotHandleL() or CCameraVideoCaptureControl::GetSnapshotHandleL() .
Clients using MCameraObserver are not recommended to use this extension class since they cannot handle events.
CCamera & aCamera | A reference to the camera object for which a camera snapshot object is to be created. |
IMPORT_C void | PrepareSnapshotL | ( | CCamera::TFormat | aFormat, |
const TPoint & | aPosition, | |||
const TSize & | aSize, | |||
const TRgb & | aBgColor, | |||
TBool | aMaintainAspectRatio | |||
) |
Use void PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) ;
Sets the properties of the snapshot data including the background colour and the position of the snapshot.
CCamera::TFormat aFormat | The image format that the snapshot must have. |
const TPoint & aPosition | The top left corner position (in pixels) which determines the layout of the snapshot image within the dimensions provided by the aSize parameter when the snapshot has been scaled maintaining its aspect ratio. See also SetPositionL(). |
const TSize & aSize | The size of the snapshot in pixels. |
const TRgb & aBgColor | The background colour to be used if the snapshot has been scaled (maintaining its aspect ratio) and does not fully fill the dimension provided by the aSize parameter. See also SetBgColorL(). |
TBool aMaintainAspectRatio | Set to ETrue if the aspect ratio of the snapshot image must be maintained when scaling down. |
IMPORT_C void | PrepareSnapshotL | ( | CCamera::TFormat | aFormat, |
const TSize & | aSize, | |||
TBool | aMaintainAspectRatio | |||
) |
Use void PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) ;
Sets the properties of the snapshot data, excluding the background colour and the position of the snapshot. This method can be used when the client wishes to determine the layout and background colour after the snapshot image has been generated. See also SetPositionL() and SetBgColorL() .
CCamera::TFormat aFormat | The image format that the snapshot must have. |
const TSize & aSize | The size of the snapshot in pixels. |
TBool aMaintainAspectRatio | Set to ETrue if the aspect ratio of the snapshot image must be maintained when scaling down. |
IMPORT_C void | PrepareSnapshotL | ( | const TSnapshotParameters & | aSnapshotParameters | ) |
Sets the properties of the snapshot. ECam implementation may use a different size than that specified by this method. GetSnapshotParametersL may be used by the client know the actual parameters being used for snapshot creation.
This method is used to provide snapshot parameters.
const TSnapshotParameters & aSnapshotParameters | The snaspshot parameters. |
IMPORT_C void | SelectSnapshotVideoFramesL | ( | TSnapshotVideoFrames | aSnapshotVideoFrames | ) |
The method specifies the frames to be used from video captured data in order to create snapshot for video.
TSnapshotVideoFrames aSnapshotVideoFrames | A TSnapshotVideoFrames used to specify the desired frames to be used for creating snapshots for video. |
IMPORT_C void | SetBgColorL | ( | const TRgb & | aBgColor | ) |
Use void SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) ;
Sets the background colour to be used if the snapshot has been scaled (maintaining its aspect ratio) and does not fully fill the snapshot size as specified in PrepareSnapshot().
const TRgb & aBgColor | The new background colour. |
IMPORT_C void | SetPositionL | ( | const TPoint & | aPosition | ) |
Use void SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) ;
Sets the top left corner position (in pixels), where the snapshot should be laid out after scaling down (maintaining its aspect ratio). The position is within the dimensions provided by the snapshot size specified in PrepareSnapshot().
const TPoint & aPosition | The top left corner position in pixels of the snapshot. |
IMPORT_C void | SetSnapshotParametersL | ( | const TSnapshotParameters & | aSnapshotParameters | ) |
Sets/updates the snapshot parameters.
This method is used to set/update snapshot parameters.
const TSnapshotParameters & aSnapshotParameters | The desired snapshot parameters. |
IMPORT_C MCameraBuffer & | SnapshotDataL | ( | RArray < TInt > & | aFrameIndexOrder | ) |
Use callbacks: MCaptureImageObserver::ClientSnapshotForImageReady and MCaptureVideoObserver::ClientSnapshotReady
Returns the snapshot data from ECam implementation to the client.
The data is returned in an MCameraBuffer object. In the case where the driving mode returns more than one image (burst mode, bracket mode, etc.) the buffer contains several snapshots which may be returned in any order. The aFrameIndexOrder array provides the image sequence numbers in the order in which the snapshots for those images are returned within the MCameraBuffer .
The client application using this API should provide MCameraObserver2 interface to be signalled when snapshot data is available to be retrieved from the ECAM implementation.
IMPORT_C void | StartSnapshot | ( | ) |
Use void EnableSnapshotL() ;
Activates the snapshot feature. Calls to this method when the snapshot feature is already active will be ignored.
The client will not receive snapshot notifications until the snapshot feature is activated.
IMPORT_C void | StopSnapshot | ( | ) |
Use void DisableSnapshotL() ;
Deactivates the snapshot feature if it is active.
Once the snapshot has been deactivated, the client will no longer receive notifications about snapshots.
IMPORT_C TUint32 | SupportedFormats | ( | ) |
Gets a list of camera formats for which the ECam implementation supports snapshots.
Describes the state of snapshot. The enumeration list may be extended in future.
ESnapshotNotCreated |
Snapshot has not been prepared. |
ESnapshotInactive |
Snapshot has been prepared but not yet enabled. |
ESnapshotActive |
Snapshot has been prepared and enabled but not yet disabled. |
ESnapshotDisabled |
Snapshot has been disabled. |
Specifies the video frames to be used in order to create snapshots fo video. The enumeration list may be extended in future.
ESnapshotVideoFirstFrame |
Snapshot for video created from first video frame. Used by default. |
ESnapshotVideoLastFrame |
Snapshot for video created from last video frame. |
ESnapshotVideoFirstAndLastFrame |
Snapshot for video created from first and last video frame. |
ESnapshotVideoEveryFrame |
Snapshot for video created from every video frame. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.