CCamera::CCameraHistogram Class Reference

class CCamera::CCameraHistogram : public CBase

This class allows the client to get histogram data in a specified format for an image (for example, luminance based histogram, average colour value histogram, etc).

The data generated can be fed to some exposure based algorithm, or directly displayed in the viewfinder. It also allows the client to get and set the properties of a histogram.

The client selects histogram parameters calling PrepareHistogramL() . It can then start and stop receiving notifications from the ECam implementation by calling StartHistogramL() and StopHistogramL() . The client application using this API should provide MCameraObserver2 interface to be signalled, with event KUidECamEventCameraHistogram, when histogram data is available to be retrieved from the ECam implementation. The client can then retrieve the histogram data from the ECam implementation calling HistograDataL().

Note:

This class provides a standardised client interface for the camera histogram. Classes cannot be derived from it.

If the class methods leave, the output type parameter value is not guaranteed to be valid.

use CCamera::CCameraV2Histogram

Inherits from

Constructor & Destructor Documentation

CCameraHistogram(CCamera &)

CCameraHistogram ( CCamera & aOwner ) [private]

Parameters

CCamera & aOwner A reference to the camera object for which a camera histogram object is to be created.

~CCameraHistogram()

IMPORT_C ~CCameraHistogram ( )

Member Functions Documentation

ConstructL()

void ConstructL ( ) [private]

use void CCamera::CCameraV2Histogram::ConstructL(const MImplementationFactory& aImplFactory)

CCameraHistogram second phase constructor.

This function used to initialise internal state of the object. It uses reference to the camera to retrieve histogram interface pointer.

leave
KErrNotSupported if this functionality is not supported; also any system wide error.

DestroyHistogramL(TUint)

IMPORT_C void DestroyHistogramL ( TUint aHistHandle )

only one histogram is available per buffer with the usage of MHistogramV2Buffer and CCameraV2Histogram .

Destroys a histogram on the ECam implementation and releases its handle.

leave
KErrArgument if aHistHandle is out of range; also any system wide error.

Parameters

TUint aHistHandle The handle identifying the histogram on the ECam implementation.

GetActiveHistogramsL(RArray< TUint > &)

IMPORT_C void GetActiveHistogramsL ( RArray < TUint > & aActiveHistograms )

use void CCamera::CCameraV2Histogram::GetHistogramStateL(TBool& aIsHistogramActive)

Gets a list of all histograms that are active on the ECam implementation. A histogram is in an active state if StartHistogramL() has been called on it.

leave
KErrNoMemory if the ECam implementation cannot add more histogram handles due to low memory; also any system wide error.

Parameters

RArray < TUint > & aActiveHistograms Returned list of histogram handles for which StartHistogramL() has been called.

GetDSAHistogramPropertiesL(TUint, TPoint &, TSize &, TRgb &)

IMPORT_C void GetDSAHistogramPropertiesL ( TUint aHistHandle,
TPoint & aPosition,
TSize & aSize,
TRgb & aColor
)

use void CCamera::CCameraV2Histogram::GetDirectHistogramPropertiesL

Gets the properties of a direct histogram.

leave
KErrArgument if aHistHandle is out of range; also any system wide error.
Note:

If the method leaves, the reference arguments are not guaranteed to be valid.

Parameters

TUint aHistHandle The handle on the ECam implementation of the direct histogram whose properties are to be retrieved.
TPoint & aPosition A reference to a TPoint object that will receive the position (in pixels) of the histogram on the screen.
TSize & aSize A reference to a TSize object that will receive the size of the histogram in pixels.
TRgb & aColor A reference to a TRgb object that will receive the colour and alpha blending of the histogram.

HistogramDataL()

IMPORT_C MHistogramBuffer & HistogramDataL ( )

use MCaptureImageObserver , MCaptureVideoObserver , MDirectViewFinderObserver , and MClientViewFinderObserver which have callback functions which notify the client about availability of histogram data. These are sent when CCameraV2Histogram::StartHistogram() is called after CCameraV2Histogram::PrepareClientHistogramL() . If CCameraV2Histogram::PrepareClientHistogramL() is not called first then the callback returns KErrBadHandle.

Returns to the client the histogram data for all the histograms generated by the ECam implementation.

Note:

The client application using this API should provide MCameraObserver2 interface to be signalled when histogram data is available to be retrieved from the ECAM implementation.

KUidECamEventCameraHistogram
leave
KErrNoMemory if the ECam implementation has not been able to create the histogram buffer; also any system wide error.

HistogramDataL(TUint)

IMPORT_C MHistogramBuffer & HistogramDataL ( TUint aHistHandle )

use MCaptureImageObserver , MCaptureVideoObserver , MDirectViewFinderObserver , and MClientViewFinderObserver which have callback functions which notify the client about availability of histogram data. These are sent when CCameraV2Histogram::StartHistogram() is called after CCameraV2Histogram::PrepareClientHistogramL() . If CCameraV2Histogram::PrepareClientHistogramL() is not called first then the callback returns KErrBadHandle.

Returns the data for a single histogram from the ECam implementation to the client.

Note:

The client application using this API should provide MCameraObserver2 interface to be signalled when histogram data is available to be retrieved from the ECAM implementation.

KUidECamEventCameraHistogram
leave
KErrNoMemory if the ECam implementation has not been able to create the histogram buffer; also any system wide error.

Parameters

TUint aHistHandle The handle on the ECam implementation of the histogram whose data is to be retrieved.

NewL(CCamera &)

IMPORT_C CCamera::CCameraHistogram * NewL ( CCamera & aCamera ) [static]

use static CCamera::CCameraV2Histogram * CreateL(CCamera& aCamera, MImplementationFactory& aImplFactory)

Factory function that creates a new camera histogram object on the heap.

leave
KErrNoMemory if out of memory; also any system wide error.
Note:

Clients using MCameraObserver are not recommended to use this extension class since they cannot handle events.

Parameters

CCamera & aCamera A reference to the camera object for which a camera histogram object is to be created.

PrepareDSAHistogramL(CCamera::CCameraHistogram::THistogramType, const TPoint &, const TSize &, const TRgb &)

IMPORT_C TUint PrepareDSAHistogramL ( CCamera::CCameraHistogram::THistogramType aType,
const TPoint & aPosition,
const TSize & aSize,
const TRgb & aColor
)

use void CCamera::CCameraV2Histogram::PrepareDirectHistogramL

Request to prepare a direct histogram.

Note:

A Direct histogram is directly embedded into the viewfinder.

leave
KErrNotSupported if the histogram type supplied in aType is not supported.
PrepareHistogramL

Parameters

CCamera::CCameraHistogram::THistogramType aType The type of histogram to be prepared. This must be one of the supported histogram types returned by SupportedHistograms().
const TPoint & aPosition The position on the screen (in pixels) where the histogram is to be displayed.
const TSize & aSize The size of histogram in pixels.
const TRgb & aColor The colour and alpha blending with which the histogram will be displayed.

PrepareHistogramL(CCamera::CCameraHistogram::THistogramType)

IMPORT_C TUint PrepareHistogramL ( CCamera::CCameraHistogram::THistogramType aType )

use void CCamera::CCameraV2Histogram::PrepareClientHistogramL

Request to prepare a non direct histogram.

Note:

A direct histogram is directly embedded into the viewfinder. If a non direct histogram is requested the histogram data will be passed to the camera client.

leave
KErrNotSupported if the histogram type supplied in aType is not supported.
PrepareDSAHistogramL

Parameters

CCamera::CCameraHistogram::THistogramType aType The type of histogram to be prepared. This must be one of the supported histogram types returned by SupportedHistograms().

StartHistogramL(TUint)

IMPORT_C void StartHistogramL ( TUint aHistHandle )

use void CCamera::CCameraV2Histogram::StartHistogram()

Request to start getting histogram notifications.

leave
KErrArgument if aHistHandle is out of range; also any system wide error.
KUidECamEventCameraHistogram

Parameters

TUint aHistHandle The handle identifying the histogram on the ECam implementation.

StopHistogramL(TUint)

IMPORT_C void StopHistogramL ( TUint aHistHandle )

use void CCamera::CCameraV2Histogram::StopHistogram()

Request to stop getting histogram notifications.

leave
KErrArgument if aHistHandle is out of range; also any system wide error.

Parameters

TUint aHistHandle The handle identifying the histogram on the ECam implementation.

SupportedHistograms()

IMPORT_C TUint32 SupportedHistograms ( )

use void CCamera::CCameraV2Histogram::GetSupportedHistogramsL(TUint& aSupportedHistogramType)

Gets a list of the types of histograms the ECam implementation supports.

CCamera::CCameraHistogram::THistogramType

UpdateDSAHistogramPropertiesL(TUint, const TPoint &, const TSize &, const TRgb &)

IMPORT_C void UpdateDSAHistogramPropertiesL ( TUint aHistHandle,
const TPoint & aPosition,
const TSize & aSize,
const TRgb & aColor
)

use void CCamera::CCameraV2Histogram::UpdateDirectHistogramPropertiesL

Updates the properties of a direct histogram.

leave
KErrArgument if aHistHandle is out of range; also any system wide error.

Parameters

TUint aHistHandle The handle identifying the histogram on the ECam implementation.
const TPoint & aPosition The new position on the screen (in pixels) where the histogram is to be displayed.
const TSize & aSize The new size of histogram in pixels.
const TRgb & aColor The new colour and alpha blending with which the histogram will be displayed.

Member Enumerations Documentation

Enum THistogramType

Supported histogram types.

Enumerators

EHistNone = 0x0000

No histogram has been specified.

ELuminance = 0x0001

Luminance based histogram.

EAverageRGB = 0x0002

The histogram is based on the average value of all three RGB colour components.

ERedComponent = 0x0004

The histogram is based on the value of the red colour component.

EBlueComponent = 0x0008

The histogram is based on the value of the blue colour component.

EGreenComponent = 0x0010

The histogram is based on the value of the green colour component.

Member Data Documentation

MCameraHistogram * iImpl

MCameraHistogram * iImpl [private]

CCamera & iOwner

CCamera & iOwner [private]