|
|
|
Location:
ecam.h
Link against: ecam.lib
CCamera
Supported from 7.0s
Base class for camera devices.
Provides the interface that an application uses to control, and acquire images from, the camera.
An application must supply an implementation of MCameraObserver.
|
Defined in CCamera:
Brightness(), BuffersInUse(), CameraInfo(), CamerasAvailable(), CancelCaptureImage(), CaptureImage(), Contrast(), DigitalZoomFactor(), EBrightnessAuto, EContrastAuto, EExposureAuto, EExposureBacklight, EExposureCenter, EExposureNight, EFlashAuto, EFlashFillIn, EFlashForced, EFlashNone, EFlashRedEyeReduce, EFormat16BitRGB565, EFormat16bitRGB444, EFormat32BitRGB888, EFormatFbsBitmapColor16M, EFormatFbsBitmapColor4K, EFormatFbsBitmapColor64K, EFormatJpeg, EFormatMonochrome, EFormatUserDefined, EFormatYUV420Interleaved, EFormatYUV420Planar, EFormatYUV422, EFormatYUV422Reversed, EFormatYUV444, EWBAuto, EWBCloudy, EWBDaylight, EWBFlash, EWBFlourescent, EWBTungsten, EnumerateCaptureSizes(), EnumerateVideoFrameRates(), EnumerateVideoFrameSizes(), Exposure(), Flash(), FrameRate(), FramesPerBuffer(), GetFrameSize(), Handle(), JpegQuality(), NewDuplicateL(), NewL(), PowerOff(), PowerOn(), PrepareImageCaptureL(), PrepareImageCaptureL(), PrepareVideoCaptureL(), PrepareVideoCaptureL(), Release(), Reserve(), SetBrightnessL(), SetContrastL(), SetDigitalZoomFactorL(), SetExposureL(), SetFlashL(), SetJpegQuality(), SetViewFinderMirrorL(), SetWhiteBalanceL(), SetZoomFactorL(), StartVideoCapture(), StartViewFinderBitmapsL(), StartViewFinderBitmapsL(), StartViewFinderDirectL(), StartViewFinderDirectL(), StopVideoCapture(), StopViewFinder(), TBrightness, TContrast, TExposure, TFlash, TFormat, TWhiteBalance, VideoCaptureActive(), ViewFinderActive(), ViewFinderMirror(), WhiteBalance(), ZoomFactor()
Inherited from CBase:
operator new()
static CCamera* NewL(MCameraObserver& aObserver, TInt aCameraIndex);
Allocates and constructs a camera object.
May leave with KErrNoMemory or KErrNotSupported if aCameraIndex is out of range.
|
|
static TInt CamerasAvailable();
Gets the number of cameras on the device.
|
static CCamera* NewDuplicateL(MCameraObserver& aObserver, TInt aCameraHandle);
Duplicates the original camera object for use by, for example, multimedia systems.
May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid.
|
|
virtual void CameraInfo(TCameraInfo& aInfo) const=0;
Gets information about the camera device.
|
virtual void Reserve()=0;
Asynchronous function that performs any required initialisation and reserves the camera for exclusive use.
Calls MCameraObserver:: ReserveComplete() when complete.
virtual void Release()=0;
De-initialises the camera, allowing it to be used by other clients.
virtual void PowerOn()=0;
Asynchronous function to switch on camera power.
User must have successfully called Reserve() previously to calling this function.
Calls MCameraObserver::PowerOnComplete() when power on is complete.
virtual TInt Handle()=0;
Gets the device-unique handle of this camera object.
|
virtual void SetZoomFactorL(TInt aZoomFactor=0)=0;
Sets the zoom factor.
This must be in the range of TCameraInfo::iMinZoom to TCameraInfo::iMaxZoom inclusive. May leave with KErrNotSupported if the specified zoom factor is out of range.
|
virtual TInt ZoomFactor() const=0;
Gets the currently set zoom factor.
|
virtual void SetDigitalZoomFactorL(TInt aDigitalZoomFactor=0)=0;
Sets the digital zoom factor.
This must be in the range of 0 to TCameraInfo::iMaxDigitalZoom inclusive.
May leave with KErrNotSupported if the zoom factor is out of range.
|
virtual TInt DigitalZoomFactor() const=0;
Gets the currently set digital zoom factor.
|
virtual void SetContrastL(TInt aContrast)=0;
Sets the contrast adjustment of the device.
This must be in the range of –100 to +100 or EContrastAuto. May leave with KErrNotSupported if the specified contrast value is out of range.
|
virtual TInt Contrast() const=0;
Gets the currently set contrast value.
|
virtual void SetBrightnessL(TInt aBrightness)=0;
Sets the brightness adjustment of the device.
No effect if this is not supported, see TCameraInfo::iBrightnessSupported.
This must be in the range of –100 to +100 or EBrightnessAuto. May leave with KErrNotSupported if the brightness adjustment is out of range.
|
virtual TInt Brightness() const=0;
Gets the currently set brightness adjustment value.
|
virtual void SetFlashL(TFlash aFlash=EFlashNone)=0;
Sets the flash mode.
No effect if this is not supported, see TCameraInfo::iFlashModesSupported.
May leave with KErrNotSupported if the specified flash mode is invalid.
|
virtual TFlash Flash() const=0;
Gets the currently set flash mode.
|
virtual void SetExposureL(TExposure aExposure=EExposureAuto)=0;
Sets the exposure adjustment of the device.
No effect if this is not supported, see CameraInfo::iExposureModesSupported.
May leave with KErrNotSupported if the specified exposure adjustment is invalid.
|
virtual TExposure Exposure() const=0;
Gets the currently set exposure setting value.
|
virtual void SetWhiteBalanceL(TWhiteBalance aWhiteBalance=EWBAuto)=0;
Sets the white balance adjustment of the device.
No effect if this is not supported, see TCameraInfo::iWhiteBalanceModesSupported.
May leave with KErrNotSupported if the specified white balance adjustment is invalid.
|
virtual TWhiteBalance WhiteBalance() const=0;
Gets the currently set white balance adjustment value.
|
virtual void StartViewFinderDirectL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindowBase& aWindow, TRect& aScreenRect)=0;
Starts transfer of view finder data to the given portion of the screen using direct screen access.
May leave with KErrNotSupported or KErrNotReady if Reserve() has either not been called, or has not yet completed.
|
virtual void StartViewFinderDirectL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindowBase& aWindow, TRect& aScreenRect, TRect& aClipRect)=0;
Starts transfer of view finder data to the given portion of the screen using direct screen access and also clips to the specified portion of the screen.
The view finder has the same size and position as aScreenRect but is only visible in the intersection of aScreenRect and aClipRect. May leave with KErrNotSupported or KErrNotReady if Reserve() has not been called, or has not yet completed.
|
virtual void StartViewFinderBitmapsL(TSize& aSize)=0;
Starts transfer of view finder data.
Bitmaps are returned by MCameraObserver::ViewFinderFrameReady().
May leave with KErrNotSupported or KErrNotReady if Reserve() has not been called, or has not yet completed.
|
virtual void StartViewFinderBitmapsL(TSize& aSize, TRect& aClipRect)=0;
Starts transfer of view finder data and clips the bitmap to the specified clip rectangle.
The bitmap is the size of the intersection of aSize and aClipRect, not simply aSize padded with white space.
|
virtual TBool ViewFinderActive() const=0;
Queries whether the view finder is active.
|
virtual void SetViewFinderMirrorL(TBool aMirror)=0;
Sets whether view finder mirroring is on.
Used to switch between what the camera sees and what you would see if the device were a mirror.
May leave with KErrNotSupported.
|
virtual TBool ViewFinderMirror() const=0;
Gets whether view finder mirroring is active.
|
virtual void PrepareImageCaptureL(TFormat aImageFormat, TInt aSizeIndex)=0;
Performs setup and allocation of memory.
Called prior to calling CaptureImage() to keep the latency of that function to a minimum.
Needs to be called only once for multiple CaptureImage() calls. May leave with KErrNotSupported or KErrNoMemory.
The specified image format must be one of the formats supported (see TCameraInfo::iImageFormatsSupported).
The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1 inclusive.
|
virtual void PrepareImageCaptureL(TFormat aImageFormat, TInt aSizeIndex, const TRect& aClipRect)=0;
Performs setup and allocation of memory and clips the image to the specified rectangle.
No effect unless TCameraInfo::iImageClippingSupported is set to ETrue. The image captured is the intersection of aClipRect and the rectangle from (0,0) to aSize. Needs to be called only once for multiple CaptureImage() calls. May leave with KErrNotSupported or KErrNoMemory.
The specified image format must be one of the formats supported (see TCameraInfo::iImageFormatsSupported).
The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1 inclusive.
|
virtual void CaptureImage()=0;
Asynchronously performs still image capture.
Calls MCameraObserver::ImageReady() when complete.
virtual void EnumerateCaptureSizes(TSize& aSize, TInt aSizeIndex, TFormat aFormat) const=0;
Enumerates through the available image capture sizes, based on the specified size index and format
The size index must be in the range 0 to TCameraInfo::iNumImageSizesSupported-1 inclusive.
|
virtual void PrepareVideoCaptureL(TFormat aFormat, TInt aSizeIndex, TInt aRateIndex, TInt aBuffersToUse, TInt aFramesPerBuffer)=0;
Prepares for video capture.
Performs setup and allocation of memory prior to calling StartVideoCapture() to keep the latency of that function to a minimum.
May leave with KErrNotSupported or KErrNoMemory.
|
virtual void PrepareVideoCaptureL(TFormat aFormat, TInt aSizeIndex, TInt aRateIndex, TInt aBuffersToUse, TInt aFramesPerBuffer, const TRect& aClipRect)=0;
Prepares for video capture and clips the frames to the given rectangle.
Performs setup and allocation of memory prior to calling StartVideoCapture() to keep the latency of that function to a minimum.
May leave with KErrNotSupported or KErrNoMemory.
|
virtual void StartVideoCapture()=0;
Starts capturing video.
Calls MCameraObserver::FrameBufferReady() when each buffer has been filled with the required number of frames, as set by PrepareVideoCaptureL().
virtual TBool VideoCaptureActive() const=0;
Tests whether video capture is active.
|
virtual void EnumerateVideoFrameSizes(TSize& aSize, TInt aSizeIndex, TFormat aFormat) const=0;
Enumerates through the available video frame sizes, based on the specified size index and format.
|
virtual void EnumerateVideoFrameRates(TReal32& aRate, TInt aRateIndex, TFormat aFormat, TInt aSizeIndex, TExposure aExposure=EExposureAuto) const=0;
Enumerates through the available video frame rates, based on the specified rate index, video frame format, size index and exposure mode.
|
virtual void GetFrameSize(TSize& aSize) const=0;
Gets the frame size currently in use.
|
virtual TReal32 FrameRate() const=0;
Gets the frame rate currently in use.
|
virtual TInt BuffersInUse() const=0;
Gets the number of buffers currently in use.
|
virtual TInt FramesPerBuffer() const=0;
Gets the number of frames per buffer currently in use.
|
virtual void SetJpegQuality(TInt aQuality)=0;
Sets the quality value to use if jpeg is a supported image for video format.
Ignored if jpeg is not a supported image for video format.
|
virtual TInt JpegQuality() const=0;
Gets the currently set jpeg quality value.
Returns 0 if not supported.
|
TFormat
Possible still image and video frame formats
Formats are read from left to right, starting at the top of the image. YUV format is as defined by ITU-R BT.601-4.
|
TContrast
Specifies whether contrast is set automatically.
|
TBrightness
Specifies whether brightness is set automatically.
|
TFlash
Specifies the type of flash.
|
TExposure
Specifies the type of exposure.
|
TWhiteBalance
Specifies how the white balance is set.
|