os/mm/imagingandcamerafws/camerafw/source/CameraSnapshot.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/imagingandcamerafws/camerafw/source/CameraSnapshot.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,583 @@
     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 +#include <ecam/mcamerasnapshot.h>
    1.26 +#include <ecamimageprocessing.h>
    1.27 +#include <ecam/camerahistogram.h>
    1.28 +#include <ecam/implementationfactoryintf.h>
    1.29 +
    1.30 +/**
    1.31 +Factory function that creates a new camera snapshot object on the heap.
    1.32 +
    1.33 +@param	aCamera
    1.34 +		A reference to the camera object for which a camera snapshot object is to be created.
    1.35 +
    1.36 +@leave  KErrNoMemory if out of memory; also any system wide error.
    1.37 +
    1.38 +@return A pointer to the newly created camera snapshot object.
    1.39 +
    1.40 +@note  This will be deprecated shortly. Snapshot should be used via CCameraImageCapture::GetSnapshotHandleL() or
    1.41 +	   CCameraVideoCaptureControl::GetSnapshotHandleL().
    1.42 +	   
    1.43 +@note  Clients using MCameraObserver are not recommended to use this extension class since they cannot handle events.
    1.44 +*/
    1.45 +EXPORT_C CCamera::CCameraSnapshot* CCamera::CCameraSnapshot::NewL(CCamera& aCamera)
    1.46 +	{
    1.47 +	CCamera::CCameraSnapshot* self = new (ELeave) CCamera::CCameraSnapshot(aCamera);
    1.48 +	CleanupStack::PushL(self);
    1.49 +	self->ConstructL();
    1.50 +	CleanupStack::Pop(self);
    1.51 +	return self; 
    1.52 +	}
    1.53 +
    1.54 +/**
    1.55 +@internalComponent
    1.56 +
    1.57 +Factory function that creates a new camera snapshot object specifically for image capture or video capture.
    1.58 +
    1.59 +@param	aCamera
    1.60 +		A reference to the camera object for which a camera snapshot object is to be created.
    1.61 +		
    1.62 +@param aImplFactory 
    1.63 +	   A reference to the MImplementationFactory derived object.
    1.64 +	   
    1.65 +@param aClientViewFinderId
    1.66 +	   The client viewfinder on which this client snapshot will be displayed.
    1.67 +
    1.68 +@leave  KErrNoMemory if out of memory; also any system wide error.
    1.69 +
    1.70 +@return A pointer to a fully constructed camera snapshot object.
    1.71 +*/	
    1.72 +EXPORT_C CCamera::CCameraSnapshot* CCamera::CCameraSnapshot::CreateL(CCamera& aCamera, MImplementationFactory& aImplFactory, TInt aClientViewFinderId)
    1.73 +	{
    1.74 +	CCamera::CCameraSnapshot* self = new (ELeave) CCamera::CCameraSnapshot(aCamera);
    1.75 +	CleanupStack::PushL(self);
    1.76 +	self->ConstructL(aImplFactory, aClientViewFinderId);
    1.77 +	CleanupStack::Pop(self);
    1.78 +	return self; 
    1.79 +	}
    1.80 +	
    1.81 +/**
    1.82 +CCameraSnapshot second phase constructor. 
    1.83 +
    1.84 +This function is used to initialise internal state of the object. 
    1.85 +It uses reference to the camera to retrieve snapshot interface pointer.
    1.86 +
    1.87 +@leave KErrNotSupported if this functionality is not supported; also any system wide error.
    1.88 +*/ 
    1.89 +void CCamera::CCameraSnapshot::ConstructL()
    1.90 +	{
    1.91 +	iImpl = static_cast<MCameraSnapshot*>(iOwner.CustomInterface(KECamMCameraSnapshotUid));
    1.92 +
    1.93 +	if (iImpl == NULL)
    1.94 +		{
    1.95 +		User::Leave(KErrNotSupported);
    1.96 +		}
    1.97 +	
    1.98 +	iImpl2 = static_cast<MCameraSnapshot2*>(iOwner.CustomInterface(KECamMCameraSnapshot2Uid));
    1.99 +	}
   1.100 +	
   1.101 +/**
   1.102 +@internalComponent
   1.103 +
   1.104 +CCameraSnapshot second phase constructor 
   1.105 +
   1.106 +Function used to initialise internal state of the object specifically for image capture or video capture. 
   1.107 +This may be used in other possible cases as well.
   1.108 +
   1.109 +@param aImplFactory 
   1.110 +	   A constant reference to the MImplementationFactory derived object.
   1.111 +	   
   1.112 +@param aClientViewFinderId
   1.113 +	   The client viewfinder on which this client snapshot will be displayed.
   1.114 +
   1.115 +@leave KErrNoMemory Out of memory; or any other error code as well.
   1.116 +
   1.117 +@note This method is supposed to be used by this class only.
   1.118 +*/ 
   1.119 +void CCamera::CCameraSnapshot::ConstructL(const MImplementationFactory& aImplFactory, TInt aClientViewFinderId) 
   1.120 +	{
   1.121 +	TInt err = KErrNone;
   1.122 +	TAny* implPtr = NULL;
   1.123 +	
   1.124 +	err = aImplFactory.GetImpl(implPtr, KECamMCameraSnapshotUid);
   1.125 +	if (err != KErrNone)
   1.126 +		{
   1.127 +		User::Leave(err);
   1.128 +		}
   1.129 +	iImpl = static_cast<MCameraSnapshot*>(implPtr);
   1.130 +	
   1.131 +	implPtr = NULL;	
   1.132 +	err = aImplFactory.GetImpl(implPtr, KECamMCameraSnapshot2Uid);
   1.133 +	if (err != KErrNone && err != KErrNotSupported)
   1.134 +		{
   1.135 +		User::Leave(err);
   1.136 +		}
   1.137 +	iImpl2 = static_cast<MCameraSnapshot2*>(implPtr);
   1.138 +	
   1.139 +	iImpl2->SetClientViewFinderId(aClientViewFinderId);
   1.140 +	}
   1.141 +
   1.142 +/**
   1.143 +Constructor for the CCamera::CCameraSnapshot class.
   1.144 +
   1.145 +@param 	aOwner
   1.146 +		A reference to the camera object for which a camera snapshot object is to be created.
   1.147 +*/
   1.148 +CCamera::CCameraSnapshot::CCameraSnapshot(CCamera& aOwner):iOwner(aOwner), iImpl(NULL), iImpl2(NULL)
   1.149 +	{
   1.150 +	}
   1.151 +	
   1.152 +/**
   1.153 +@released
   1.154 +
   1.155 +Destructor for the CCamera::CCameraSnapshot class.
   1.156 +
   1.157 +@note  The child objects(for example,hisotgrams) created out of this snapshot class object shall be 
   1.158 +	   delete beforehand.
   1.159 +
   1.160 +*/
   1.161 +EXPORT_C CCamera::CCameraSnapshot::~CCameraSnapshot()
   1.162 +	{
   1.163 +	if (iImpl != NULL)
   1.164 +		{
   1.165 +		iImpl->Release();
   1.166 +		}
   1.167 +	if (iImpl2 != NULL)
   1.168 +		{
   1.169 +		iImpl2->Release();	
   1.170 +		}
   1.171 +	}
   1.172 +	
   1.173 +/**
   1.174 +@released
   1.175 +
   1.176 +Gets a list of camera formats for which the ECam implementation supports snapshots.
   1.177 +
   1.178 +@return	Bit field containing the supported camera formats as CCamera::TFormat values.
   1.179 +*/
   1.180 +EXPORT_C TUint32 CCamera::CCameraSnapshot::SupportedFormats()
   1.181 +	{
   1.182 +	return iImpl->SupportedFormats();
   1.183 +	}
   1.184 +		
   1.185 +/**
   1.186 +@deprecated Use void PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
   1.187 +
   1.188 +Sets the properties of the snapshot data including the background colour and the position of the snapshot.
   1.189 +
   1.190 +@param 	aFormat
   1.191 +		The image format that the snapshot must have.
   1.192 +@param 	aPosition
   1.193 +		The top left corner position (in pixels) which determines the layout of the snapshot image  
   1.194 +		within the dimensions provided by the aSize parameter when the snapshot has been scaled 
   1.195 +		maintaining its aspect ratio. See also SetPositionL().
   1.196 +@param 	aSize
   1.197 +		The size of the snapshot in pixels.
   1.198 +@param 	aBgColor
   1.199 +		The background colour to be used if the snapshot has been scaled (maintaining its aspect ratio)
   1.200 +		and does not fully fill the dimension provided by the aSize parameter. See also SetBgColorL().
   1.201 +@param 	aMaintainAspectRatio
   1.202 +		Set to ETrue if the aspect ratio of the snapshot image must be maintained when scaling down.
   1.203 +
   1.204 +@leave  KErrNotSupported if the specified image format is not supported; also any system wide error.
   1.205 +*/
   1.206 +EXPORT_C void CCamera::CCameraSnapshot::PrepareSnapshotL(CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio)
   1.207 +	{
   1.208 +	iImpl->PrepareSnapshotL(aFormat, aPosition, aSize, aBgColor, aMaintainAspectRatio);
   1.209 +	}
   1.210 +
   1.211 +/**
   1.212 +@deprecated Use void PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
   1.213 +
   1.214 +Sets the properties of the snapshot data, excluding the background colour and the position of the snapshot.
   1.215 +This method can be used when the client wishes to determine the layout and background colour after the
   1.216 +snapshot image has been generated. See also SetPositionL() and SetBgColorL().
   1.217 +
   1.218 +@param 	aFormat
   1.219 +		The image format that the snapshot must have.
   1.220 +@param 	aSize
   1.221 +		The size of the snapshot in pixels.
   1.222 +@param 	aMaintainAspectRatio
   1.223 +		Set to ETrue if the aspect ratio of the snapshot image must be maintained when scaling down.
   1.224 +
   1.225 +@leave  KErrNotSupported if the specified image format is not supported; also any system wide error.
   1.226 +*/
   1.227 +EXPORT_C void CCamera::CCameraSnapshot::PrepareSnapshotL(CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio)
   1.228 +	{
   1.229 +	iImpl->PrepareSnapshotL(aFormat, aSize, aMaintainAspectRatio);
   1.230 +	}
   1.231 +
   1.232 +/**
   1.233 +@deprecated Use void SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
   1.234 +
   1.235 +Sets the background colour to be used if the snapshot has been scaled (maintaining its aspect ratio)
   1.236 +and does not fully fill the snapshot size as specified in PrepareSnapshot().
   1.237 +
   1.238 +@param 	aBgColor
   1.239 +		The new background colour.
   1.240 +
   1.241 +@leave  KErrNotSupported if the specified image format is not supported; also any system wide error.
   1.242 +*/		
   1.243 +EXPORT_C void CCamera::CCameraSnapshot::SetBgColorL(const TRgb& aBgColor)
   1.244 +	{
   1.245 +	iImpl->SetBgColorL(aBgColor);
   1.246 +	}
   1.247 +
   1.248 +/**
   1.249 +@deprecated Use void SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
   1.250 +
   1.251 +Sets the top left corner position (in pixels), where the snapshot should be laid out after scaling
   1.252 +down (maintaining its aspect ratio). The position is within the dimensions provided by the snapshot 
   1.253 +size specified in PrepareSnapshot().
   1.254 +
   1.255 +@param 	aPosition
   1.256 +		The top left corner position in pixels of the snapshot.  		
   1.257 +
   1.258 +@leave  KErrNotSupported if the specified image format is not supported; also any system wide error.
   1.259 +*/
   1.260 +EXPORT_C void CCamera::CCameraSnapshot::SetPositionL(const TPoint& aPosition)
   1.261 +	{
   1.262 +	iImpl->SetPositionL(aPosition);
   1.263 +	}
   1.264 +	
   1.265 +/**
   1.266 +@deprecated Use void GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& aSnapshotState) const;
   1.267 +
   1.268 +Determines if the snapshot feature is active.
   1.269 +
   1.270 +@return	ETrue, if StartSnapshot() has been called, otherwise EFalse.
   1.271 +*/
   1.272 +EXPORT_C TBool CCamera::CCameraSnapshot::IsSnapshotActive() const
   1.273 +	{
   1.274 +	return iImpl->IsSnapshotActive();
   1.275 +	}
   1.276 +
   1.277 +/**
   1.278 +@deprecated Use void EnableSnapshotL();
   1.279 +
   1.280 +Activates the snapshot feature. Calls to this method when the snapshot feature is already active
   1.281 +will be ignored. 
   1.282 +
   1.283 +The client will not receive snapshot notifications until the snapshot feature is activated. 
   1.284 +
   1.285 +@see KUidECamEventCameraSnapshot
   1.286 +*/
   1.287 +EXPORT_C void CCamera::CCameraSnapshot::StartSnapshot()
   1.288 +	{
   1.289 +	iImpl->StartSnapshot();
   1.290 +	}
   1.291 +
   1.292 +/**
   1.293 +@deprecated Use void DisableSnapshotL();
   1.294 +
   1.295 +Deactivates the snapshot feature if it is active. 
   1.296 +
   1.297 +Once the snapshot has been deactivated, the client will no longer receive notifications about snapshots.
   1.298 +*/
   1.299 +EXPORT_C void CCamera::CCameraSnapshot::StopSnapshot()
   1.300 +	{
   1.301 +	iImpl->StopSnapshot();
   1.302 +	}
   1.303 +    	
   1.304 +/**
   1.305 +@deprecated Use callbacks: MCaptureImageObserver::ClientSnapshotForImageReady and MCaptureVideoObserver::ClientSnapshotReady
   1.306 +
   1.307 +Returns the snapshot data from ECam implementation to the client. 
   1.308 +
   1.309 +The data is returned in an MCameraBuffer object. In the case where the driving mode returns more 
   1.310 +than one image (burst mode, bracket mode, etc.) the buffer contains several snapshots which may 
   1.311 +be returned in any order. The aFrameIndexOrder array provides the image sequence numbers in the 
   1.312 +order in which the snapshots for those images are returned within the MCameraBuffer.
   1.313 +
   1.314 +@note 	The client application using this API should provide MCameraObserver2 interface to be 
   1.315 +		signalled when snapshot data is available to be retrieved from the ECAM implementation.
   1.316 +
   1.317 +@see 	KUidECamEventCameraSnapshot
   1.318 +
   1.319 +@param 	aFrameIndexOrder
   1.320 +		A reference to an array that will receive the image sequence numbers in the order to which  
   1.321 +		the snapshots within MCameraBuffer relate.
   1.322 +
   1.323 +@return	A reference to an MCameraBuffer which will contain the returned snapshot image data.
   1.324 +		
   1.325 +@leave	KErrNoMemory if the ECam implementation has not been able to create the camera buffer;
   1.326 +		also any system wide error.
   1.327 +*/
   1.328 +EXPORT_C MCameraBuffer& CCamera::CCameraSnapshot::SnapshotDataL(RArray<TInt>& aFrameIndexOrder)
   1.329 +	{
   1.330 +	return iImpl->SnapshotDataL(aFrameIndexOrder);
   1.331 +	}
   1.332 +
   1.333 +/**
   1.334 +Retrieve pointer to histogram API in order to use it specifically for snapshots.
   1.335 +
   1.336 +@return Pointer to use histogram API specifically for the snapshots.
   1.337 +		
   1.338 +@leave  May leave with any error code.
   1.339 +
   1.340 +@note   Different types of histogram may be used for a snapshot. Every time this method will be called on the 
   1.341 +		CCameraSnapshot class object, a new type of histogram will be created.
   1.342 +*/	
   1.343 +EXPORT_C CCamera::CCameraV2Histogram* CCamera::CCameraSnapshot::CreateHistogramHandleL() const
   1.344 +	{
   1.345 +	if(iImpl2 != NULL)
   1.346 +		{
   1.347 +		MImplementationFactory* implFactory = NULL;
   1.348 +		
   1.349 +		iImpl2->CreateHistogramImplFactoryL(implFactory);
   1.350 +		
   1.351 +		CleanupReleasePushL(*implFactory);
   1.352 +		CCamera::CCameraV2Histogram* histogram = CCamera::CCameraV2Histogram::CreateL(iOwner, *implFactory);
   1.353 +		CleanupStack::Pop(implFactory);
   1.354 +		
   1.355 +		implFactory->Release();
   1.356 +		return histogram;	
   1.357 +		}
   1.358 +	else
   1.359 +		{
   1.360 +		return NULL;	
   1.361 +		}
   1.362 +	}
   1.363 +
   1.364 +/**
   1.365 +Sets the properties of the snapshot. ECam implementation may use a different size than that specified by this method. 
   1.366 +GetSnapshotParametersL may be used by the client know the actual parameters being used for snapshot creation.
   1.367 +
   1.368 +@param  aSnapshotParameters
   1.369 +		The snaspshot parameters.
   1.370 +
   1.371 +@leave  May leave with any error code.
   1.372 +
   1.373 +@note   This method is used to provide snapshot parameters.
   1.374 +*/
   1.375 +EXPORT_C void CCamera::CCameraSnapshot::PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
   1.376 +	{
   1.377 +	if(iImpl2 != NULL)
   1.378 +		{
   1.379 +		iImpl2->PrepareSnapshotL(aSnapshotParameters);	
   1.380 +		}
   1.381 +	else
   1.382 +		{
   1.383 +		User::Leave(KErrNotSupported);	
   1.384 +		}
   1.385 +	}
   1.386 +	
   1.387 +/**
   1.388 +Retrieves the snapshot parameters used by the ECam implementation for snapshot creation.
   1.389 +
   1.390 +@param  aSnapshotParameters
   1.391 +		Retrieves the currently used snapshot parameters.
   1.392 +
   1.393 +@leave  May leave with any error code.
   1.394 +
   1.395 +@note   This method is used to retrieve snapshot parameters.
   1.396 +*/
   1.397 +EXPORT_C void CCamera::CCameraSnapshot::GetSnapshotParametersL(CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
   1.398 +	{
   1.399 +	if(iImpl2 != NULL)
   1.400 +		{
   1.401 +		iImpl2->GetSnapshotParametersL(aSnapshotParameters);	
   1.402 +		}
   1.403 +	else
   1.404 +		{
   1.405 +		User::Leave(KErrNotSupported);	
   1.406 +		}
   1.407 +	}
   1.408 +	
   1.409 +/**
   1.410 +Sets/updates the snapshot parameters.
   1.411 +
   1.412 +@param  aSnapshotParameters
   1.413 +		The desired snapshot parameters.
   1.414 +		
   1.415 +@leave  May leave with any error code.
   1.416 +
   1.417 +@note   This method is used to set/update snapshot parameters.
   1.418 +*/
   1.419 +EXPORT_C void CCamera::CCameraSnapshot::SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) 
   1.420 +	{
   1.421 +	if(iImpl2 != NULL)
   1.422 +		{
   1.423 +		iImpl2->SetSnapshotParametersL(aSnapshotParameters);	
   1.424 +		}
   1.425 +	else
   1.426 +		{
   1.427 +		User::Leave(KErrNotSupported);	
   1.428 +		}
   1.429 +	}
   1.430 +
   1.431 +/**
   1.432 +Retrieves the current status for the snapshot.
   1.433 +
   1.434 +@param  aSnapshotState
   1.435 +		Retrieves information about the snapshot current state.
   1.436 +	
   1.437 +@leave  May leave with any error code.
   1.438 +
   1.439 +@note   This method is used to retrieve the snapshot status.
   1.440 +*/
   1.441 +EXPORT_C void CCamera::CCameraSnapshot::GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& aSnapshotState) const
   1.442 +	{
   1.443 +	if(iImpl2 != NULL)
   1.444 +		{
   1.445 +		iImpl2->GetSnapshotStatusL(aSnapshotState);	
   1.446 +		}
   1.447 +	else
   1.448 +		{
   1.449 +		User::Leave(KErrNotSupported);	
   1.450 +		}	
   1.451 +	}
   1.452 +
   1.453 +/**
   1.454 +The method specifies the frames to be used from video captured data in order to create snapshot for video.
   1.455 +
   1.456 +@param  aSnapshotVideoFrames
   1.457 +		A TSnapshotVideoFrames used to specify the desired frames to be used for creating snapshots for video. 
   1.458 +		
   1.459 +@leave  May leave with any error code.
   1.460 +*/
   1.461 +EXPORT_C void CCamera::CCameraSnapshot::SelectSnapshotVideoFramesL(CCamera::CCameraSnapshot::TSnapshotVideoFrames aSnapshotVideoFrames)
   1.462 +	{
   1.463 +	if(iImpl2 != NULL)
   1.464 +		{
   1.465 +		iImpl2->SelectSnapshotVideoFramesL(aSnapshotVideoFrames);	
   1.466 +		}
   1.467 +	else
   1.468 +		{
   1.469 +		User::Leave(KErrNotSupported);	
   1.470 +		}
   1.471 +	}
   1.472 +	
   1.473 +/**
   1.474 +Activates the snapshot feature. Calls to this method when the snapshot feature is already active will be ignored. 
   1.475 +
   1.476 +The client will not receive snapshot notifications until the snapshot feature is activated. 
   1.477 +
   1.478 +Client shall implement the observers: MCaptureImageObserver and MCaptureVideoObserver. Snapshot notifications will be send
   1.479 +to the clients via these observers and not through events.
   1.480 +
   1.481 +@leave  KErrNotSupported if the implementation of this method is not present.
   1.482 +*/
   1.483 +EXPORT_C void CCamera::CCameraSnapshot::EnableSnapshotL()
   1.484 +	{
   1.485 +	if(iImpl2 != NULL)
   1.486 +		{
   1.487 +		iImpl2->EnableSnapshot();	
   1.488 +		}
   1.489 +	else
   1.490 +		{
   1.491 +		User::Leave(KErrNotSupported);	
   1.492 +		}
   1.493 +	}
   1.494 +
   1.495 +/**
   1.496 +Deactivates the snapshot feature if it is active. 
   1.497 +
   1.498 +Once the snapshot has been deactivated, the client will no longer receive notifications about snapshots.
   1.499 +
   1.500 +@leave  KErrNotSupported if the implementation of this method is not present.
   1.501 +*/
   1.502 +EXPORT_C void CCamera::CCameraSnapshot::DisableSnapshotL()
   1.503 +	{
   1.504 +	if(iImpl2 != NULL)
   1.505 +		{
   1.506 +		iImpl2->DisableSnapshot();	
   1.507 +		}
   1.508 +	else
   1.509 +		{
   1.510 +		User::Leave(KErrNotSupported);	
   1.511 +		}
   1.512 +	}
   1.513 +
   1.514 +/**
   1.515 +Constructor for the TSnapshotParameters class.
   1.516 +Sets the size and version of this class.
   1.517 +*/	
   1.518 +EXPORT_C CCamera::CCameraSnapshot::TSnapshotParameters::TSnapshotParameters()
   1.519 +	{
   1.520 +	iSize = sizeof(CCamera::CCameraSnapshot::TSnapshotParameters);
   1.521 +	iVersion = KECamSnapshotParametersCurrentVersion;
   1.522 +	}
   1.523 +
   1.524 +/** 
   1.525 +Returns the size of the class. Used for extensibility by deriving from this base class and adding new member variables.
   1.526 +Intended to be used for implementation of methods where this class reference is passed as function arguments. 
   1.527 +Implementation of such methods can find out the whether the actual class passed is base or the derived one. So, if a new application 
   1.528 +is made to run on an old implementation, an error may occur once the old implementation detects this by getting 
   1.529 +the size information of the T class passed. Also, if an old application is made to run on a new implementation, this can be 
   1.530 +corrrectly handled if the derived class variables handling is done in a proper 'if-else' statement. 
   1.531 +
   1.532 +@return The size of the class.
   1.533 +
   1.534 +@note The size will be modified when the T-class gets updated.
   1.535 +*/
   1.536 +EXPORT_C TUint CCamera::CCameraSnapshot::TSnapshotParameters::Size() const
   1.537 +	{
   1.538 +	return iSize;
   1.539 +	}
   1.540 +	
   1.541 +/**	
   1.542 +Returns the version of the class. Used for extensibility specially when the class members are not added but the Reserved 
   1.543 +members get used at a later stage.
   1.544 +
   1.545 +@return The version of the class.
   1.546 +
   1.547 +@note The version will be modified when the T-class gets updated.
   1.548 +*/
   1.549 +EXPORT_C TUint CCamera::CCameraSnapshot::TSnapshotParameters::Version() const
   1.550 +	{
   1.551 +	return iVersion;
   1.552 +	}
   1.553 +
   1.554 +/** 
   1.555 +Indicates whether the aspect ratio of the snapshot image has to maintained (if ETrue) or not (if EFalse) 
   1.556 +while scaling down.
   1.557 +
   1.558 +@return TBool: ETrue implies aspect ratio has to be maintained, EFalse otherwise.
   1.559 +
   1.560 +@see CCamera::CCameraSnapshot::TSnapshotParameters::iIsAspectRatioMaintained
   1.561 +*/
   1.562 +EXPORT_C TBool CCamera::CCameraSnapshot::TSnapshotParameters::IsAspectRatioMaintained() const
   1.563 +	{
   1.564 +	if (iIsAspectRatioMaintained)
   1.565 +		{
   1.566 +		return ETrue;
   1.567 +		}
   1.568 +	else
   1.569 +		{
   1.570 +		return EFalse;
   1.571 +		}	
   1.572 +	}
   1.573 +
   1.574 +/** 
   1.575 +Sets the state to inform whether the aspect ratio of the snapshot image has to be maintained or not while scaling
   1.576 +down.
   1.577 +
   1.578 +@param  aIsAspectRatioMaintained
   1.579 +		ETrue implies must be maintained, EFalse otherwise.
   1.580 +		
   1.581 +@see CCamera::CCameraSnapshot::TSnapshotParameters::iIsAspectRatioMaintained
   1.582 +*/
   1.583 +EXPORT_C void CCamera::CCameraSnapshot::TSnapshotParameters::SetAspectRatioState(TBool aIsAspectRatioMaintained)
   1.584 +	{
   1.585 +	iIsAspectRatioMaintained = static_cast<TUint>(aIsAspectRatioMaintained);
   1.586 +	}