1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/imagingandcamerafws/camerafw/Include/MCameraHistogram.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,397 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @publishedPartner
1.22 + @prototype
1.23 +*/
1.24 +
1.25 +#ifndef MCAMERAHISTOGRAM_H
1.26 +#define MCAMERAHISTOGRAM_H
1.27 +
1.28 +#include <ecam/camerahistogram.h>
1.29 +#include <ecam/ecamcommonuidif.hrh>
1.30 +
1.31 +/**
1.32 +This is the UID which is used to obtain the MCameraHistogram interface,
1.33 +via a call to CCamera::CustomInterface(), which provides implementation of the M-class interface.
1.34 +
1.35 +@see KECamMCameraHistogramUidValue
1.36 +@deprecated use KECamMCameraV2HistogramUid
1.37 +*/
1.38 +static const TUid KECamMCameraHistogramUid = {KECamMCameraHistogramUidValue};
1.39 +
1.40 +/**
1.41 +This is the UID which is used to obtain the MCameraV2Histogram interface,
1.42 +via a call to CCamera::CustomInterface(), which provides implementation of the M-class interface.
1.43 +
1.44 +@see KECamMCameraV2HistogramUidValue
1.45 +*/
1.46 +static const TUid KECamMCameraV2HistogramUid = {KECamMCameraV2HistogramUidValue};
1.47 +
1.48 +/**
1.49 +This is a mixin class to be implemented by providers of the extension API for the camera histogram.
1.50 +
1.51 +Histograms can be sent to the client or directly displayed on the viewfinder.
1.52 +
1.53 +@note This class is intended for sub classing by licensees only.
1.54 +
1.55 +@see CCamera::CCameraHistogram
1.56 +
1.57 +@publishedPartner
1.58 +@deprecated use MCameraV2Histogram
1.59 +*/
1.60 +class MCameraHistogram
1.61 + {
1.62 +
1.63 +public:
1.64 + /**
1.65 + @deprecated use void MCameraV2Histogram::GetSupportedHistogramsL(TUint& aSupportedHistogramType)
1.66 +
1.67 + Gets a list of the types of histograms the ECam implementation supports.
1.68 +
1.69 + @return A bit field representing all supported types of histograms.
1.70 +
1.71 + @see CCamera::CCameraHistogram::THistogramType
1.72 + */
1.73 + virtual TUint32 SupportedHistograms()=0;
1.74 +
1.75 + /**
1.76 + @deprecated use void MCameraV2Histogram::PrepareClientHistogramL
1.77 +
1.78 + Request to prepare a non direct histogram.
1.79 +
1.80 + @note A direct histogram is directly embedded into the viewfinder.
1.81 + If a non direct histogram is requested the histogram data will be passed to the camera client.
1.82 +
1.83 + @param aType
1.84 + The type of histogram to be prepared. This must be one of the supported histogram types returned by
1.85 + SupportedHistograms().
1.86 +
1.87 + @leave KErrNotSupported if the histogram type supplied in aType is not supported.
1.88 +
1.89 + @return An integer value which is the handle of the histogram on the ECam implementation.
1.90 + This value must be passed to other API functions when requesting operations
1.91 + involving this particular histogram.
1.92 +
1.93 + @see PrepareDSAHistogramL
1.94 + */
1.95 + virtual TUint PrepareHistogramL(CCamera::CCameraHistogram::THistogramType aType)=0;
1.96 +
1.97 + /**
1.98 + @deprecated use void MCameraV2Histogram::PrepareDirectHistogramL
1.99 +
1.100 + Request to prepare a direct histogram.
1.101 +
1.102 + @note A direct histogram is directly embedded into the viewfinder.
1.103 +
1.104 + @param aType
1.105 + The type of histogram to be prepared. This must be one of the supported histogram types returned by
1.106 + SupportedHistograms().
1.107 + @param aPosition
1.108 + The position on the screen (in pixels) where the histogram is to be displayed.
1.109 + @param aSize
1.110 + The size of histogram in pixels.
1.111 + @param aColor
1.112 + The colour and alpha blending with which the histogram will be displayed.
1.113 +
1.114 + @leave KErrNotSupported if the histogram type supplied in aType is not supported.
1.115 +
1.116 + @return An integer value which is the handle of the histogram on the ECam implementation.
1.117 + This value must be passed to other API functions when requesting operations
1.118 + involving this particular histogram.
1.119 +
1.120 + @see PrepareHistogramL
1.121 + */
1.122 + virtual TUint PrepareDSAHistogramL(CCamera::CCameraHistogram::THistogramType aType, const TPoint& aPosition, const TSize& aSize, const TRgb& aColor)=0;
1.123 +
1.124 + /**
1.125 + @deprecated use void MCameraV2Histogram::StartHistogram()
1.126 +
1.127 + Request to start getting histogram notifications.
1.128 +
1.129 + @param aHistHandle
1.130 + The handle identifying the histogram on the ECam implementation.
1.131 +
1.132 + @leave KErrArgument if aHistHandle is out of range; also any system wide error.
1.133 + */
1.134 + virtual void StartHistogramL(TUint aHistHandle)=0;
1.135 +
1.136 + /**
1.137 + @deprecated use void MCameraV2Histogram::StopHistogram()
1.138 +
1.139 + Request to stop getting histogram notifications.
1.140 +
1.141 + @param aHistHandle
1.142 + The handle identifying the histogram on the ECam implementation.
1.143 +
1.144 + @leave KErrArgument if aHistHandle is out of range; also any system wide error.
1.145 + */
1.146 + virtual void StopHistogramL(TUint aHistHandle)=0;
1.147 +
1.148 + /**
1.149 + @deprecated only one histogram is available per buffer with the usage of MHistogramV2Buffer and MCameraV2Histogram.
1.150 +
1.151 + Destroys a histogram on the ECam implementation and releases its handle.
1.152 +
1.153 + @param aHistHandle
1.154 + The handle identifying the histogram on the ECam implementation.
1.155 +
1.156 + @leave KErrArgument if aHistHandle is out of range; also any system wide error.
1.157 + */
1.158 + virtual void DestroyHistogramL(TUint aHistHandle)=0;
1.159 +
1.160 + /**
1.161 + @deprecated use void MCameraV2Histogram::Release(CCamera::CCameraV2Histogram *aHistogramHandle)
1.162 +
1.163 + Releases all the histogram handles created by this object and destroys them on the ECam implementation.
1.164 + This function is called from the destructor of CCamera::CCameraHistogram.
1.165 + */
1.166 + virtual void Release()=0;
1.167 +
1.168 + /**
1.169 + @deprecated use void MCameraV2Histogram::GetHistogramStateL(TBool& aIsHistogramActive)
1.170 +
1.171 + Gets a list of all histograms that are active on the ECam implementation.
1.172 + A histogram is in an active state if StartHistogramL() has been called on it.
1.173 +
1.174 + @param aActiveHistograms
1.175 + Returned list of histogram handles for which StartHistogramL() has been called.
1.176 +
1.177 + @leave KErrNoMemory if the ECam implementation cannot add more histogram handles due to low memory; also any system wide error.
1.178 + */
1.179 + virtual void GetActiveHistogramsL(RArray<TUint>& aActiveHistograms)=0;
1.180 +
1.181 + /**
1.182 + @deprecated use void MCameraV2Histogram::UpdateDirectHistogramPropertiesL
1.183 +
1.184 + Updates the properties of a direct histogram.
1.185 +
1.186 + @param aHistHandle
1.187 + The handle identifying the histogram on the ECam implementation.
1.188 + @param aPosition
1.189 + The new position on the screen (in pixels) where the histogram is to be displayed.
1.190 + @param aSize
1.191 + The new size of histogram in pixels.
1.192 + @param aColor
1.193 + The new colour and alpha blending with which the histogram will be displayed.
1.194 +
1.195 + @leave KErrArgument if aHistHandle is out of range; also any system wide error.
1.196 + */
1.197 + virtual void UpdateDSAHistogramPropertiesL(TUint aHistHandle, const TPoint& aPosition, const TSize& aSize, const TRgb& aColor)=0;
1.198 +
1.199 + /**
1.200 + @deprecated use void MCameraV2Histogram::GetDirectHistogramPropertiesL
1.201 +
1.202 + Gets the properties of a direct histogram.
1.203 +
1.204 + @param aHistHandle
1.205 + The handle on the ECam implementation of the direct histogram whose properties are to be retrieved.
1.206 + @param aPosition
1.207 + A reference to a TPoint object that will receive the position (in pixels) of the histogram on the screen.
1.208 + @param aSize
1.209 + A reference to a TSize object that will receive the size of the histogram in pixels.
1.210 + @param aColor
1.211 + A reference to a TRgb object that will receive the colour and alpha blending of the histogram.
1.212 +
1.213 + @leave KErrArgument if aHistHandle is out of range; also any system wide error.
1.214 + */
1.215 + virtual void GetDSAHistogramPropertiesL(TUint aHistHandle, TPoint& aPosition, TSize& aSize, TRgb& aColor)=0;
1.216 +
1.217 + /**
1.218 + @deprecated use MCaptureImageObserver, MCaptureVideoObserver, MDirectViewFinderObserver, and MClientViewFinderObserver
1.219 + which have callback functions which notify the client about availability of histogram data. These are sent when
1.220 + CCameraV2Histogram::StartHistogram() is called after CCameraV2Histogram::PrepareClientHistogramL(). If
1.221 + CCameraV2Histogram::PrepareClientHistogramL() is not called first then the callback returns KErrBadHandle.
1.222 +
1.223 + Returns to the client the histogram data for all the histograms generated by the ECam implementation.
1.224 +
1.225 + @leave KErrNoMemory if the ECam implementation has not been able to create the histogram buffer;
1.226 + also any system wide error.
1.227 +
1.228 + @return A reference to a histogram buffer which will contain the returned histogram data.
1.229 + */
1.230 + virtual MHistogramBuffer& HistogramDataL()=0;
1.231 +
1.232 + /**
1.233 + @deprecated use MCaptureImageObserver, MCaptureVideoObserver, MDirectViewFinderObserver, and MClientViewFinderObserver
1.234 + which have callback functions which notify the client about availability of histogram data. These are sent when
1.235 + CCameraV2Histogram::StartHistogram() is called after CCameraV2Histogram::PrepareClientHistogramL(). If
1.236 + CCameraV2Histogram::PrepareClientHistogramL() is not called first then the callback returns KErrBadHandle.
1.237 +
1.238 + Returns the data for a single histogram from the ECam implementation to the client.
1.239 +
1.240 + @param aHistHandle
1.241 + The handle on the ECam implementation of the histogram whose data is to be retrieved.
1.242 +
1.243 + @leave KErrNoMemory if the ECam implementation has not been able to create the histogram buffer;
1.244 + also any system wide error.
1.245 +
1.246 + @return A reference to a histogram buffer which will contain the returned histogram data.
1.247 + */
1.248 + virtual MHistogramBuffer& HistogramDataL(TUint aHistHandle)=0;
1.249 + };
1.250 +
1.251 +/**
1.252 +This is a mixin class to be implemented by providers of the extension API for the camera v2 histogram.
1.253 +
1.254 +Histograms can be sent to the client or directly displayed on the screen.
1.255 +
1.256 +@note This class is intended for sub classing by licensees only.
1.257 +
1.258 +@see CCamera::CCameraV2Histogram
1.259 +
1.260 +@publishedPartner
1.261 +@prototype
1.262 +*/
1.263 +class MCameraV2Histogram
1.264 + {
1.265 +
1.266 +public:
1.267 +
1.268 + /**
1.269 + Releases the interface.
1.270 +
1.271 + @param aHistogramHandle
1.272 + The pointer to the histogram class object which would be destroyed by the client.
1.273 + */
1.274 + virtual void Release(CCamera::CCameraV2Histogram* aHistogramHandle)=0;
1.275 +
1.276 + /**
1.277 + The pointer to the V2 Histogram class used to pass back to the client via observer callbacks when direct histogram
1.278 + gets displayed. Implementation is not supposed to not destroy this object.
1.279 +
1.280 + @param aHistogramHandle
1.281 + The pointer to the histogram class object.
1.282 +
1.283 + @see MCaptureImageObserver
1.284 + @see MDirectViewFinderObserver
1.285 + @see MClientViewFinderObserver
1.286 + */
1.287 + virtual void SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)=0;
1.288 +
1.289 + /**
1.290 + Retrieves a list of the supported types of histograms.
1.291 +
1.292 + @param aSupportedHistogramType
1.293 + A reference to bit field representing the supported types of histograms as given by CCamera::
1.294 + CCameraV2Histogram::THistogramType
1.295 +
1.296 + @leave May leave with any error code.
1.297 +
1.298 + @see CCamera::CCameraV2Histogram::THistogramType
1.299 + */
1.300 + virtual void GetSupportedHistogramsL(TUint& aSupportedHistogramType) const =0;
1.301 +
1.302 + /**
1.303 + Informs whether or not the direct histogram is supported.
1.304 +
1.305 + @param aIsDirectHistogramSupported
1.306 + ETrue implies that direct histogram is supported.
1.307 + EFalse implies that direct histogram is not supported.
1.308 +
1.309 + @leave May leave with any error code.
1.310 + */
1.311 + virtual void GetDirectHistogramSupportInfoL(TBool& aIsDirectHistogramSupported) const=0;
1.312 +
1.313 + /**
1.314 + Request to prepare a client based histogram.
1.315 +
1.316 + @note A direct histogram is directly embedded into the viewfinder.
1.317 + If a non direct histogram is requested the histogram data will be passed to the camera client.
1.318 +
1.319 + @param aType
1.320 + The type of histogram to be prepared. This must be one of the supported histogram types given by
1.321 + GetSupportedHistogramsL.
1.322 +
1.323 + @leave May leave with any error code.
1.324 +
1.325 + @note Each histogram object will either prepare direct histogram or client histogram. Preparing multiple histograms
1.326 + per object is an invalid case.
1.327 +
1.328 + @see PrepareDSAHistogramL
1.329 + */
1.330 + virtual void PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType aType)=0;
1.331 +
1.332 + /**
1.333 + Prepares the direct histogram.
1.334 +
1.335 + @param aDirectHistogramParameters
1.336 + The parameters required to prepare the direct histogram.
1.337 +
1.338 + @leave May leave with any error code.
1.339 +
1.340 + @note Each histogram object will either prepare direct histogram or client histogram. Preparing multiple histograms
1.341 + per object is an invalid case.
1.342 +
1.343 + @see PrepareClientHistogramL
1.344 + */
1.345 + virtual void PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)=0;
1.346 +
1.347 + /**
1.348 + Update the parameters for the direct histogram.
1.349 +
1.350 + @param aDirectHistogramParameters
1.351 + The desired parameters which have to be used to update the direct histogram.
1.352 +
1.353 + @leave May leave with any error code.
1.354 + */
1.355 + virtual void UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)=0;
1.356 +
1.357 + /**
1.358 + Retrieves the currently used parameters for the direct histogram.
1.359 +
1.360 + @param aDirectHistogramParameters
1.361 + Retrieves the parameters currently being used for the direct histogram.
1.362 +
1.363 + @leave May leave with any error code.
1.364 + */
1.365 + virtual void GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) const=0;
1.366 +
1.367 + /**
1.368 + Request to start getting histogram notifications.
1.369 +
1.370 + @note Histogram should have been prepared before calling this method.
1.371 +
1.372 + @note Histogram notifications are sent to the client by using relevant callbacks for image capture, video capture
1.373 + and viewfinders.
1.374 +
1.375 + @see MCaptureImageObserver
1.376 + @see MCaptureVideoObserver
1.377 + @see MDirectViewFinderObserver
1.378 + @see MClientViewFinderObserver
1.379 + */
1.380 + virtual void StartHistogram()=0;
1.381 +
1.382 + /**
1.383 + Request to stop generating histogram.
1.384 + */
1.385 + virtual void StopHistogram()=0;
1.386 +
1.387 + /**
1.388 + Informs whether the histogram is currently active or not.
1.389 + A histogram is in an active state if StartHistogram() has been called on it and has not been yet stopped.
1.390 +
1.391 + @param aIsHistogramActive
1.392 + ETrue indicates that the histogram is active.
1.393 + EFalse indicates that the histogram is inactive.
1.394 +
1.395 + @leave May leave with any error code.
1.396 + */
1.397 + virtual void GetHistogramStateL(TBool& aIsHistogramActive) const=0;
1.398 + };
1.399 +
1.400 +#endif // MCAMERAHISTOGRAM_H