epoc32/include/icl/imageconversionextension.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/icl/imageconversionextension.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,641 @@
     1.4 +// Copyright (c) 2007-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +#ifndef IMAGECONVERSIONEXTENSION_H
    1.20 +#define IMAGECONVERSIONEXTENSION_H
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +class MImageConvExtension;
    1.24 +class MImageConvOperation;
    1.25 +class MImageConvScaler;
    1.26 +class MImageConvStreamedDecode;
    1.27 +class MImageConvStreamedEncode;
    1.28 +class TFrameLayout;
    1.29 +class CImageFrame;
    1.30 +class CFrameImageData;
    1.31 +
    1.32 +/**
    1.33 +@file
    1.34 +@publishedAll
    1.35 +@released
    1.36 +*/
    1.37 +
    1.38 +/**
    1.39 + Image Conversion Library extensions. When applied together there is an implicit order for operations:
    1.40 + 	1. Crop or clip.
    1.41 + 	2. Scale
    1.42 + 	3. Rotate / mirror over axis.
    1.43 + */
    1.44 + 
    1.45 +/**
    1.46 +Operation extension for Image Conversion Library. Allows rotation and mirror over axis.
    1.47 +*/
    1.48 +class TImageConvOperation
    1.49 +	{
    1.50 +friend class CImageDecoder;
    1.51 +friend class CImageEncoder;
    1.52 +
    1.53 +public:
    1.54 +
    1.55 +
    1.56 +	/**
    1.57 +	Operations or transforms on an image.
    1.58 +	*/
    1.59 +	enum TOperation
    1.60 +		{
    1.61 +		/** Rotate source 90 degrees clockwise.
    1.62 +		*/
    1.63 +		ERotation90DegreesClockwise		= 0x01,
    1.64 +		/** Rotate source 180 degrees clockwise.
    1.65 +		*/
    1.66 +		ERotation180DegreesClockwise 	= 0x02,
    1.67 +		/** Rotate source 270 degrees clockwise.
    1.68 +		*/
    1.69 +		ERotation270DegreesClockwise	= 0x04,
    1.70 +		/** Mirror source about the horizontal axis.
    1.71 +		*/
    1.72 +		EMirrorHorizontalAxis			= 0x08,
    1.73 +		/** Mirror source about the vertical axis.
    1.74 +		*/
    1.75 +		EMirrorVerticalAxis 			= 0x10
    1.76 +		};
    1.77 +
    1.78 +	/**
    1.79 +	Get the codec plugin's capabilities.
    1.80 +	
    1.81 +	@return Bitmask combination of TOperation. Bit is set if decoder plugin supports the operation.
    1.82 +	*/
    1.83 +	IMPORT_C TUint Capabilities() const;
    1.84 +	
    1.85 +	/**
    1.86 +	Set up an operation be applied to the source. May be called more than once 
    1.87 +	to set up a stack of operations, but it is not possible to add more than one
    1.88 +	operation in a single call.
    1.89 +	The operations are applied to the image in the same order as they are added.
    1.90 +	
    1.91 +	@param aOperation The operation to add to the current stack of operations.
    1.92 +		
    1.93 +	@leave if more than one TOperation enum is passed for each individual call
    1.94 +	*/
    1.95 +	IMPORT_C void AddOperationL(TOperation aOperation);
    1.96 +	
    1.97 +	/**
    1.98 +	Remove all operations previously set. 
    1.99 +	*/
   1.100 +	IMPORT_C void ClearOperationStack();
   1.101 +	
   1.102 +private:
   1.103 +
   1.104 +	IMPORT_C TImageConvOperation();  
   1.105 +	void SetExtension(MImageConvExtension* aExtension);
   1.106 +	
   1.107 +private:
   1.108 +	MImageConvOperation* iExtension;
   1.109 +	TInt iReserved; // future proof
   1.110 +	};
   1.111 +
   1.112 +
   1.113 +/**
   1.114 +Represents scaling capabilities of the code plugin.
   1.115 +*/
   1.116 +class TScalerCaps
   1.117 +	{
   1.118 +public:
   1.119 +	/**
   1.120 +	Constructor
   1.121 +	*/
   1.122 +	IMPORT_C TScalerCaps();
   1.123 +
   1.124 +	/**
   1.125 +	Constructor
   1.126 +	
   1.127 +	@param aMaxUpscaleLimit Maximum upscaling possible.
   1.128 +	@param aMaxDownscaleLimit Maximum downscaling possible.
   1.129 +	@param aPreserveAspectRatioIsNeeded ETrue if only support preservation of aspect ratio.
   1.130 +	*/
   1.131 +	IMPORT_C TScalerCaps(TInt aMaxUpscaleLimit,TInt aMaxDownscaleLimit,TBool aPreserveAspectRatioIsNeeded);
   1.132 +
   1.133 +	/**
   1.134 +	Maximum upscaling possible.
   1.135 +	@return value >= 1 : 1 means cannot upscale, 2 means twice original size
   1.136 +	*/
   1.137 +	IMPORT_C TInt MaxUpscaleLimit() const;
   1.138 +	
   1.139 +	/**
   1.140 +	Maximum downscaling possible.
   1.141 +	@return value <= -1 : -1 means cannot downscale, -2 means half original size
   1.142 +	*/
   1.143 +	IMPORT_C TInt MaxDownscaleLimit() const;
   1.144 +	
   1.145 +	/**
   1.146 +	Type of scaling which is supported.
   1.147 +
   1.148 +	@return ETrue if can only do 1/2, 1/4, 1/8 etc downscale (limit depends on iMaxDownscaleLimit)
   1.149 +	     2, 4, 8 etc upscale (limit depends on iMaxUpscaleLimit)
   1.150 +	     EFalse if can do arbitrary scaling between iMaxDownscaleLimit and iMaxUpscaleLimit
   1.151 +	*/
   1.152 +	IMPORT_C TBool PowerOfTwoScalingOnly() const;
   1.153 +	
   1.154 +	/**
   1.155 +	Returns ETrue if the codec must preserve aspect ratio during scaling.
   1.156 +	
   1.157 +	@return ETrue if scaling is only possible if preservation of aspect ratio is requested.
   1.158 +		    EFalse if scaling without preserving aspect ratio is possible.
   1.159 +	*/
   1.160 +	IMPORT_C TBool MustPreserveAspectRatio() const;
   1.161 +	
   1.162 +	/**
   1.163 +	Compatibility - internal use only
   1.164 +	@internalComponent
   1.165 +	*/
   1.166 +	IMPORT_C TUint Size() const;
   1.167 +
   1.168 +	/**
   1.169 +	Compatibility - internal use only
   1.170 +	@internalComponent
   1.171 +	*/
   1.172 +	IMPORT_C TUint Version() const;
   1.173 +	
   1.174 +private:
   1.175 +	TInt  iMaxUpscaleLimit;   // >= 1 : 2 means twice original size
   1.176 +	TBool iMustPreserveAspectRatio;  // If ETrue then can only do scaling whilst preserving aspect ratio
   1.177 +	TInt  iMaxDownscaleLimit; // <= -1 : -2 means 1/2 original size
   1.178 +	TBool iPowerOfTwoScalingOnly;
   1.179 +	TUint iSizeVersion; // bits 31 to 8 size, 7 to 0 contain version
   1.180 +	TInt  iReserved; // future proof
   1.181 +	};
   1.182 +
   1.183 +
   1.184 +/**
   1.185 +Scaling extension for Image Conversion Library. Supports both arbitrary or 'power of two' 1/2, 1/4, 1/8 scaling
   1.186 +*/
   1.187 +class TImageConvScaler
   1.188 +	{
   1.189 +friend class CImageDecoder;
   1.190 +
   1.191 +public:
   1.192 +
   1.193 +	/** 
   1.194 +	Quality used during scaling.
   1.195 +	*/
   1.196 +	enum TScalerQuality
   1.197 +		{
   1.198 +		EMinimumQuality, // = 0
   1.199 +		EMediumQuality,
   1.200 +		EMaximumQuality
   1.201 +		};
   1.202 +
   1.203 +	/**
   1.204 +	Get the codec plugin's capabilities.
   1.205 +
   1.206 +	@param aCaps Returns scaling capabilities of the codec plugin.
   1.207 +	*/
   1.208 +	IMPORT_C void GetCapabilities(TScalerCaps& aCaps) const;
   1.209 +
   1.210 +    /**
   1.211 +    Request scaling to the desired size using the quality specified and specifying if the aspect ratio is to
   1.212 +	be preserved. 
   1.213 +	Ensure that CImageDecoder::GetDestinationSize is used to obtain the size of destination bitmap passed
   1.214 +	to CImageDecoder::Convert if scaling is set up by calling this method.
   1.215 +	
   1.216 +	@param aDesiredSize  Proposed size of the scaled image. Note that this may not necessarily be the size
   1.217 +	returned by a subsequent call to CImageDecoder::GetDestinationSize and is dependant upon the operations 
   1.218 +	(such as scaling, cropping and rotation) requested and also the capabilities of the plugin (which can be
   1.219 +	queried using TImageConvScaler::GetCapabilities).
   1.220 +	
   1.221 +	Example: If a plugin is only capable of power of two scaling, with an original image size of 600x400,
   1.222 +	then calling this SetScalingL function with a desired size of 500x300 will result in a subsequent call to 
   1.223 +	CImageDecoder::GetDestinationSize returning a size of 300x200 (that is, a scaling coefficient of -2).
   1.224 +	
   1.225 +	@param aQuality Desired quality of the image. Allows codec to lower quality targets to
   1.226 +	improve performance.
   1.227 +	
   1.228 +	@param aLockAspectRatio Set to ETrue if the aspect ratio of the original image is to be preserved.
   1.229 +	
   1.230 +	@leave KErrNotSupported if an invalid size is passed.
   1.231 +	@leave KErrNotSupported if aLockAspectRatio is EFalse and codec only supports preservation of aspect ratio.
   1.232 +
   1.233 +	@see CImageDecoder::Convert
   1.234 +	@see CImageDecoder::GetDestinationSize
   1.235 +	@see TImageConvScaler::GetCapabilities
   1.236 +	*/ 
   1.237 +	IMPORT_C void SetScalingL(const TSize& aDesiredSize, TImageConvScaler::TScalerQuality aQuality, TBool aLockAspectRatio);
   1.238 +
   1.239 +	/**
   1.240 +	Define the scaling to be applied to the image according to the given coefficient at the requested quality.
   1.241 +	Ensure that CImageDecoder::GetDestinationSize is used to obtain the size of destination bitmap to be passed
   1.242 +	to CImageDecoder::Convert.
   1.243 +	
   1.244 +	@param aScalingCoeff Scale to apply to the source. 2 means twice the original size, -2 half the size. 
   1.245 +	Do not confuse this with ReductionFactor where 2 indicates 1/2 size.
   1.246 +	
   1.247 +	@param aScalingQuality Desired quality of the image. Allows codec to lower quality targets to
   1.248 +	improve performance.
   1.249 +	
   1.250 +	@leave KErrNotSupported if codec cannot perform the requested scale.
   1.251 +	
   1.252 +	@see CImageDecoder::Convert
   1.253 +	*/
   1.254 +	IMPORT_C void SetScalingL(TInt aScalingCoeff, TImageConvScaler::TScalerQuality aScalingQuality);
   1.255 +	
   1.256 +private:
   1.257 +	IMPORT_C TImageConvScaler(); 
   1.258 +	void SetExtension(MImageConvExtension* aExtension);
   1.259 +
   1.260 +private:
   1.261 +	MImageConvScaler* iExtension;
   1.262 +	TInt iReserved; // future proof
   1.263 +	};
   1.264 +
   1.265 +/** 
   1.266 +'Block' streaming extension capabilities.
   1.267 +*/
   1.268 +class TDecodeStreamCaps
   1.269 +	{
   1.270 +public:
   1.271 +	/** Navigation possibilities within stream. 
   1.272 +	 */
   1.273 +	enum TNavigation
   1.274 +		{
   1.275 +		/** Blocks are returned from first to last */
   1.276 +		ENavigationSequentialForward = 0x01,
   1.277 +		
   1.278 +		/** Blocks are returned in a random order but moving only from first to last e.g. 1, 5, 18...*/
   1.279 +		ENavigationRandomForward     = 0x02,
   1.280 +
   1.281 +		/** Blocks are returned in a random order but moving only from last to first e.g. 18, 5, 1...*/
   1.282 +		ENavigationRandomBackwards   = 0x04,
   1.283 +
   1.284 +		/** Blocks are returned randomly e.g. 18, 5, 20, ...*/
   1.285 +		ENavigationRandom = 0x08,
   1.286 +
   1.287 +		/** Blocks are returned from last to first  */
   1.288 +		ENavigationSequentialBackwards = 0x10
   1.289 +		};
   1.290 +		
   1.291 +	/**
   1.292 +	Constructor.
   1.293 +	*/
   1.294 +	IMPORT_C TDecodeStreamCaps();
   1.295 +	
   1.296 +	/**
   1.297 +	Constructor.
   1.298 +	
   1.299 +	@param aMaxBlocksPerRequest Maximum number of blocks that can be returned from the stream to client in a
   1.300 +	single request.
   1.301 +	@param aMinBlockSizeInPixels Minimum size in pixels of a block returned from the stream to the client in
   1.302 +	a single request.
   1.303 +	@param aOptimalBlocksPerRequest Optimum number of blocks returned from the stream to the client in
   1.304 +	a single request to get maximum performance benefit.
   1.305 +	@param aStreamSizeInBlocks Number of blocks of size MinBlockSizeInPixels() in the stream.
   1.306 +	@param aNavigation Navigation capabilities.
   1.307 +	*/
   1.308 +	IMPORT_C TDecodeStreamCaps(TInt aMaxBlocksPerRequest, const TSize& aMinBlockSizeInPixels, 
   1.309 +							TInt aOptimalBlocksPerRequest, TInt aStreamSizeInBlocks,
   1.310 +							TDecodeStreamCaps::TNavigation aNavigation);
   1.311 +	 
   1.312 +    /**
   1.313 +    The maximum number of blocks that can be returned from the stream to client in a
   1.314 +	single request.
   1.315 +	
   1.316 +	@return Maximum number of blocks that can be returned from the stream to client in a
   1.317 +	single request.
   1.318 +	*/ 
   1.319 +	IMPORT_C TInt MaxBlocksPerRequest() const;
   1.320 +	
   1.321 +	/** 
   1.322 +	The Minimum size in pixels of a block returned from the stream to the client in
   1.323 +	a single request.
   1.324 +	
   1.325 +	@return Minimum size in pixels of a block returned from the stream to the client in
   1.326 +	a single request. Sequence numbers and StreamSizeInBlocks() refer to this size of block.
   1.327 +	*/
   1.328 +	IMPORT_C const TSize& MinBlockSizeInPixels() const;
   1.329 +	
   1.330 +	/** 
   1.331 +	Optimum number of blocks returned from the stream to the client in
   1.332 +	a single request to get maximum performance benefit.
   1.333 +	
   1.334 +	@return Optimum number of blocks returned from the stream to the client in
   1.335 +	a single request to get maximum performance benefit.
   1.336 +	This can be used to determine the optimum value of the number of blocks of min block size per request.
   1.337 +	*/
   1.338 +	IMPORT_C TInt OptimalBlocksPerRequest() const;
   1.339 +
   1.340 +	/** 
   1.341 +	Number of blocks of size MinBlockSizeInPixels() in the stream.
   1.342 +	
   1.343 +	@return Number of blocks of size MinBlockSizeInPixels() in the stream.
   1.344 +	*/
   1.345 +	IMPORT_C TInt StreamSizeInBlocks() const;
   1.346 +	
   1.347 +	/**
   1.348 +	Navigation capabilities.
   1.349 +	
   1.350 +	@return Navigation capabilities.
   1.351 +
   1.352 +	Full random access to the stream if Navigation() returns 
   1.353 +	ENavigationSequentialForward | ENavigationRandomForward | ENavigationRandomBackwards
   1.354 +	*/
   1.355 +	IMPORT_C TDecodeStreamCaps::TNavigation Navigation() const;
   1.356 +	
   1.357 +	/**
   1.358 +	Compatibility - internal use only
   1.359 +	@internalComponent
   1.360 +	*/
   1.361 +	IMPORT_C TUint Size() const;
   1.362 +
   1.363 +	/**
   1.364 +	Compatibility - internal use only
   1.365 +	@internalComponent
   1.366 +	*/
   1.367 +	IMPORT_C TUint Version() const;
   1.368 +	
   1.369 +private:
   1.370 +	TInt  iMaxBlocksPerRequest;
   1.371 +	TSize iMinBlockSizeInPixels;
   1.372 +	TInt iOptimalBlocksPerRequest;
   1.373 +	TInt  iStreamSizeInBlocks;
   1.374 +	TNavigation iNavigation;
   1.375 +	TUint  iSizeVersion;  // bits 31 to 8 size, 7 to 0 contain version
   1.376 +	TInt  iReserved; // future proof
   1.377 +	};		
   1.378 +
   1.379 +/**
   1.380 + 'Block' streaming extension for Image Conversion Library decoder.
   1.381 + */
   1.382 +class TImageConvStreamedDecode
   1.383 +	{
   1.384 +friend class CImageDecoder;
   1.385 +	
   1.386 +public:
   1.387 +    /**
   1.388 +	Returns a list of supported formats and the optimal format to be used. @see imageframeconst.h
   1.389 +	for a list of format uids.
   1.390 +	@param aFormats Returns an array of format uids 
   1.391 +	@param aOptimalFormat The 'best' uid to use. 
   1.392 +	*/
   1.393 +	IMPORT_C void GetSupportedFormatsL(RArray<TUid>& aFormats, TUid& aOptimalFormat) const;
   1.394 +
   1.395 +	/**
   1.396 +	Returns the capabilities of the codec plugin for a specific format and for a specific frame.
   1.397 +	@param aFormat The format.
   1.398 +	@param aFrameNumber frame to stream
   1.399 +	@param aCaps The capabilities for the format given.
   1.400 +	*/     
   1.401 +	IMPORT_C void GetCapabilities(TUid aFormat, TInt aFrameNumber, TDecodeStreamCaps& aCaps) const;
   1.402 +	
   1.403 +	/**
   1.404 +	Get the size of the memory buffer to hold the returned data.
   1.405 +
   1.406 +	@param aFormat the required format
   1.407 +	@param aBlockSizeInPixels returns the size in pixels of the block returned from the stream when aNumBlocks of minimum block size are requested.
   1.408 +	@param aNumBlocks the number of blocks of size TDecodeStreamCaps::MinBlockSizeInPixels() to be returned by one request
   1.409 +
   1.410 +	@return The memory buffer size in bytes to hold the requested blocks. System wide error if for example 
   1.411 +	the format is not supported.
   1.412 +	*/
   1.413 +	IMPORT_C TInt GetBufferSize(TUid aFormat, TSize& aBlockSizeInPixels, TInt aNumBlocks)  const;
   1.414 +
   1.415 +
   1.416 +	/**
   1.417 +	Initialise the stream.
   1.418 +	
   1.419 +	@param aFormat the format to use
   1.420 +	@param aFrameNumber frame to stream
   1.421 +	@param aNavigation indication to stream of the way that the stream will be navigated. Allows 
   1.422 +	codec to optimise it's behaviour.
   1.423 +	@leave System wide error if for example the format is not supported.
   1.424 +
   1.425 +	@note must call InitFrameL before GetBlocks or GetNextBlocks. Failure to do so completes request with
   1.426 +	KErrNotReady
   1.427 +	*/
   1.428 +	IMPORT_C void InitFrameL(TUid aFormat, TInt aFrameNumber, TDecodeStreamCaps::TNavigation aNavigation);
   1.429 +
   1.430 +	/**
   1.431 +	Start asynchronous call to return random blocks from the stream
   1.432 +
   1.433 +	@param aStatus request status
   1.434 +	@param aFrame An image frame wrapper a memory buffer to hold the returned block(s) of 
   1.435 +	pixel data. This can be 'uninitialised' or given specific format which must match that
   1.436 +	specified in the InitFrameL call.
   1.437 +	@param aSeqPosition block number starting at top left 0 ... TDecodeStreamCaps::StreamSizeInBlocks()
   1.438 +	@param aNumBlocksToGet number of blocks requested
   1.439 +	@param aNumBlocksRead number of blocks which will be returned when the request completes
   1.440 +
   1.441 +	@note use CImageDecoder::Cancel() to cancel this request.
   1.442 +	*/
   1.443 +	IMPORT_C void GetBlocks(TRequestStatus& aStatus, CImageFrame& aFrame, TInt aSeqPosition, TInt aNumBlocksToGet, TInt& aNumBlocksRead);
   1.444 +
   1.445 +	/**
   1.446 +	Start asynchronous call to return blocks sequentially from the stream. Blocks are returned 
   1.447 +	from the first block until the last in the stream.
   1.448 +
   1.449 +	@param aStatus request status
   1.450 +	@param aFrame An image frame wrapper a memory buffer to hold the returned block(s) of 
   1.451 +	pixel data. This can be 'uninitialised' or given specific format which must match that
   1.452 +	specified in the InitFrameL call.
   1.453 +	@param aNumBlocksToGet number of blocks requested
   1.454 +	@param aNumBlocksRead number of blocks which will be returned when the request completes
   1.455 +
   1.456 +	@note use CImageDecoder::Cancel() to cancel this request.
   1.457 +	*/
   1.458 +	IMPORT_C void GetNextBlocks(TRequestStatus& aStatus, CImageFrame& aFrame, TInt aNumBlocksToGet, TInt& aNumBlocksRead, TBool& aHaveMoreBlocks);
   1.459 +
   1.460 +private:
   1.461 +	IMPORT_C TImageConvStreamedDecode(); 
   1.462 +	void SetExtension(MImageConvExtension* aExtension);
   1.463 +
   1.464 +private:
   1.465 +	MImageConvStreamedDecode* iExtension;
   1.466 +	TInt iReserved; // future proof
   1.467 +	};
   1.468 +
   1.469 +/**
   1.470 + 'Block' streaming extension for Image Conversion Library encoder.
   1.471 + */
   1.472 +/**
   1.473 + 'Block' streaming extension for Image Conversion Library encoder.
   1.474 + */
   1.475 +class TEncodeStreamCaps
   1.476 +	{
   1.477 +public:
   1.478 +	/** Navigation possibilities within the stream. 
   1.479 +	 */
   1.480 +	enum TNavigation
   1.481 +		{
   1.482 +		/** Blocks can be returned from first to last */
   1.483 +		ENavigationSequentialForward = 0x01,
   1.484 +		
   1.485 +		/** Blocks can be returned in a random order but moving only from first to last e.g. 1, 5, 18...*/
   1.486 +		ENavigationRandomForward     = 0x02,
   1.487 +
   1.488 +		/** Blocks can be returned in a random order but moving only from last to first e.g. 1, 5, 18...*/
   1.489 +		ENavigationRandomBackwards   = 0x04     
   1.490 +		};
   1.491 +
   1.492 +	/**
   1.493 +	Constructor.
   1.494 +	*/
   1.495 +	IMPORT_C TEncodeStreamCaps();
   1.496 +	
   1.497 +	/**
   1.498 +	Constructor.
   1.499 +	
   1.500 +	@param aMaxBlocksPerRequest Maximum number of blocks that can be sent from the stream to client in a
   1.501 +	single request.
   1.502 +	@param aMinBlockSizeInPixels Minimum size in pixels of a block sent to the stream from the client in
   1.503 +	a single request.
   1.504 +	@param aOptimalBlocksPerRequest Optimum number of blocks sent to the stream from the client in
   1.505 +	a single request to get maximum performance benefit.
   1.506 +	@param aNavigation Navigation capabilities.
   1.507 +	*/
   1.508 +	IMPORT_C TEncodeStreamCaps(TInt aMaxBlocksPerRequest, const TSize& aMinBlockSizeInPixels,
   1.509 +					  			TInt aOptimalBlocksPerRequest,
   1.510 +					  			TEncodeStreamCaps::TNavigation aNavigation);
   1.511 +    /**
   1.512 +	Maximum number of blocks that can be sent from the stream to client in a
   1.513 +	single request.
   1.514 +	
   1.515 +	@return Maximum number of blocks that can be sent from the stream to client in a
   1.516 +	single request.
   1.517 +	*/ 
   1.518 +	IMPORT_C TInt MaxBlocksPerRequest() const;
   1.519 +
   1.520 +	/** 
   1.521 +	Minimum size in pixels of a block sent to the stream from the client in
   1.522 +	a single request.
   1.523 +	
   1.524 +	@return Minimum size in pixels of a block sent to the stream from the client in
   1.525 +	a single request.
   1.526 +	*/
   1.527 +	IMPORT_C const TSize& MinBlockSizeInPixels() const;
   1.528 +
   1.529 +	/** 
   1.530 +	Optimum number of blocks sent to the stream from the client in
   1.531 +	a single request to get maximum performance benefit.
   1.532 +	
   1.533 +	@return Optimum number of blocks sent to the stream from the client in
   1.534 +	a single request to get maximum performance benefit.
   1.535 +	*/
   1.536 +	IMPORT_C TInt OptimalBlocksPerRequest() const;
   1.537 +
   1.538 +
   1.539 +	/**
   1.540 +	Navigation capabilities.
   1.541 +	
   1.542 +	@return navigation capabilities.
   1.543 +
   1.544 +	Full random access to the stream if Navigation() returns 
   1.545 +	ENavigationSequentialForward | ENavigationRandomForward |ENavigationRandomBackwards
   1.546 +	*/
   1.547 +	IMPORT_C TEncodeStreamCaps::TNavigation Navigation() const;
   1.548 +	
   1.549 +	/**
   1.550 +	Compatibility - internal use only
   1.551 +	@internalComponent
   1.552 +	*/
   1.553 +	IMPORT_C TUint Size() const;
   1.554 +
   1.555 +	/**
   1.556 +	Compatibility - internal use only
   1.557 +	@internalComponent
   1.558 +	*/
   1.559 +	IMPORT_C TUint Version() const;
   1.560 +
   1.561 +private:
   1.562 +	TInt  iMaxBlocksPerRequest;
   1.563 +	TSize iMinBlockSizeInPixels;
   1.564 +	TInt iOptimalBlocksPerRequest;
   1.565 +	TNavigation iNavigation;
   1.566 +	TUint  iSizeVersion;  // bits 31 to 8 size, 7 to 0 contain version
   1.567 +	TInt  iReserved; // future proof
   1.568 +	};
   1.569 +
   1.570 +class TImageConvStreamedEncode
   1.571 +	{
   1.572 +friend class CImageEncoder;	
   1.573 +	
   1.574 +public:
   1.575 +    /**
   1.576 +	Returns a list of supported formats and the optimal format to be used. @see imageframeconst.h
   1.577 +	for a list of format uids.
   1.578 +	@param aFormats Returns an array of format uids 
   1.579 +	@param aOptimalFormat The 'best' uid to use. 
   1.580 +	*/
   1.581 +	IMPORT_C void GetSupportedFormatsL(RArray<TUid>& aFormats, TUid& aOptimalFormat) const;
   1.582 +
   1.583 +	/**
   1.584 +	Returns the capabilities of the codec plugin for a specific format.
   1.585 +	@param aFormat The format.
   1.586 +	@param aCaps The capabilities for the format given.
   1.587 +	*/     
   1.588 +	IMPORT_C void GetCapabilities(TUid aFormat, TEncodeStreamCaps& aCaps) const;
   1.589 +
   1.590 +	/**
   1.591 +	Initialise the stream.
   1.592 +	
   1.593 +	@param aFormat the format to use
   1.594 +	@param aFrameNumber frame to stream
   1.595 +	@param aFrameSizeInPixels Size of this frame in pixels
   1.596 +	@param aBlockSizeInPixels Size of block to be added / appended.
   1.597 +	@param aNavigation indication to stream of the way that the stream will be navigated. Allows 
   1.598 +	codec to optimise it's behaviour.
   1.599 +	@param aFrameImageData The frame image data (optional pass NULL if not required).
   1.600 +	There are format-specific image data variants that are used by encoders to obtain image specific 
   1.601 +	data. This behaviour is invoked by specifying aFrameImageData. Otherwise, encoder specific defaults 
   1.602 +	are invoked. @see TJpegImageData
   1.603 +
   1.604 +	@leave System wide error if for example the format is not supported.
   1.605 +	
   1.606 +	@note must call InitFrameL before AppendBlocks or AddBlocks. Failure to do so completes request with
   1.607 +	KErrNotReady
   1.608 +
   1.609 +	@note can either specify format through aFormat or aImageFrameData. Conflicts cause a leave with KErrArgument. 
   1.610 +	*/
   1.611 +	IMPORT_C void InitFrameL(TUid aFormat, TInt aFrameNumber, const TSize& aFrameSizeInPixels, const TSize& aBlockSizeInPixels, TEncodeStreamCaps::TNavigation aNavigation, const CFrameImageData* aFrameImageData);
   1.612 +	
   1.613 +	/**
   1.614 +	Append blocks to the stream.
   1.615 +	@param aStatus request status	
   1.616 +	@param aBlocks wraps a memory buffer containing the pixel data to be added to the stream
   1.617 +	@param aNumBlocksToAdd number of blocks of size TEncodeStreamCaps::MinBlockSizeInPixels to add to the stream
   1.618 +	*/
   1.619 +	IMPORT_C void AppendBlocks(TRequestStatus& aStatus, const CImageFrame& aBlocks, TInt aNumBlocksToAdd);
   1.620 +	
   1.621 +	/**
   1.622 +	Add blocks to the stream at a random position.
   1.623 +	@param aStatus request status	
   1.624 +	@param aBlocks wraps a memory buffer containing the pixel data to be added to the stream
   1.625 +	@param aSeqPosition position of block in stream starting at 0
   1.626 +	*/
   1.627 +	IMPORT_C void AddBlocks(TRequestStatus& aStatus, const CImageFrame& aBlocks, const TInt& aSeqPosition);
   1.628 +
   1.629 +	/**
   1.630 +	Signal completion of writing the stream
   1.631 +	@param aStatus request status	
   1.632 +	*/
   1.633 +	IMPORT_C void Complete(TRequestStatus& aStatus); 
   1.634 +
   1.635 +private:
   1.636 +
   1.637 +	IMPORT_C TImageConvStreamedEncode();
   1.638 +	void SetExtension(MImageConvExtension* aExtension);
   1.639 +
   1.640 +	MImageConvStreamedEncode* iExtension;
   1.641 +	TInt iReserved; // future proof
   1.642 +	};
   1.643 +
   1.644 +#endif // IMAGECONVERSIONEXTENSION_H