epoc32/include/icl/squeezetransformextension.h
branchSymbian3
changeset 4 837f303aceeb
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This is Image Transform extension for Squeeze Transformation 
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @publishedAll 
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef __SQUEEZETRANFORMEEXTENSION_H__
       
    25 #define __SQUEEZETRANFORMEEXTENSION_H__
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <icl/imagetransformpluginext.h>
       
    29 #include <imageframeconst.h>
       
    30 
       
    31 /** 
       
    32 @publishedAll 
       
    33 @released
       
    34 
       
    35 This class provides advanced parameters for squeezing 
       
    36 */
       
    37 class TAdvancedSqueezeParams
       
    38 	{
       
    39 public:
       
    40 	/** 
       
    41 	The different behaviours of auto resize 
       
    42 	*/
       
    43 	enum TAutoResizeAction
       
    44 		{
       
    45 		/** 
       
    46 		Preserves the source encoding quality while shrinking the width and height of the image
       
    47 		*/
       
    48 		EAutoResizeActionPreserveSourceEncodingQuality,
       
    49 		/**
       
    50 		Tries to preserve the max image size while lowering the encoding quality 
       
    51 		*/
       
    52 		EAutoResizeActionPrioritizeLargeImageSize,
       
    53 		/** 
       
    54 		Tries to preserve the highest possible encoding quality while shrinking the width and height of the image 
       
    55 		*/ 
       
    56 		EAutoResizeActionResizePrioritizeHighEncodingQuality,
       
    57 		/** 
       
    58 		Simultaneously lower the encoding quality and shrink the width and height of the image 
       
    59 		*/
       
    60 		EAutoResizeActionMiddleCourse
       
    61 		};
       
    62 
       
    63 	IMPORT_C TAdvancedSqueezeParams();
       
    64 	
       
    65 	/** 
       
    66 	The desired max size of the transformed image in bytes. 
       
    67 	*/
       
    68 	TUint iMaxDestSizeInBytes;
       
    69 
       
    70 	/**
       
    71 	The transformed image must not be smaller than this. The 
       
    72 	size must be smaller than the iMaxImageSize 
       
    73 	*/
       
    74 	TSize iMinImageSize;
       
    75 
       
    76 	/**
       
    77  	The transformed image must not be bigger than this. The size 
       
    78 	must be bigger than the iMinImageSize 
       
    79 	*/
       
    80 	TSize iMaxImageSize;
       
    81 
       
    82 	/** 
       
    83 	The desired behaviour of the auto resize 
       
    84 	*/
       
    85 	TInt iResizeAction;
       
    86 
       
    87 	/**
       
    88 	The lowest desired encoding quality. 
       
    89 	Must be in the range (0.0) to (1.0) 
       
    90 	*/
       
    91 	TReal32 iMinEncodingQuality;
       
    92 	
       
    93 	/**
       
    94 	The color spacing of the transformed image 
       
    95 	*/
       
    96 	TUid iSamplingUid;
       
    97 private:
       
    98 	// Future proof
       
    99 	TAny* iPad1;
       
   100 	TAny* iPad2;
       
   101 	TAny* iPad3;
       
   102 	TAny* iPad4;
       
   103 	};
       
   104 
       
   105 /**
       
   106 @publishedAll 
       
   107 @released
       
   108 
       
   109 Squeeze Extension to the ImageTransform plugin
       
   110 
       
   111 The class provides the methods to set the squeeze parameters and is intended to be implemented
       
   112 by the plugins supporting the squeezing of the images. The client can set the desired max size
       
   113 (in bytes) of the squeezed image and it can also enable auto resizing of the image by setting the
       
   114 advanced squeeze parameters. The plugin supporting this extension must use the opaque_data v2 format 
       
   115 in RSS file and also the squeeze flag must be set in the opaque_data. The client must 
       
   116 retrieve this extension implementation from the plugin using its extension UID.
       
   117 
       
   118 In the case where the client's desired size cannot be met the operation will squeeze to the
       
   119 smallest file possible and the transform operation will leave with KErrGeneral. The output file
       
   120 must be examined by the client to determine its suitability. The client must clean up if the
       
   121 output is not acceptable.
       
   122 */
       
   123 class CSqueezeTransformExtension : public CImageTransformPluginExtension
       
   124 	{
       
   125 public:
       
   126 	IMPORT_C void SetDestSizeInBytes(TUint aMaxDestDataSize ) ;
       
   127 	IMPORT_C void SetAdvancedSqueezeModeL(TAdvancedSqueezeParams* aSqueezeAutoResizeParams ) ;
       
   128 
       
   129 protected:
       
   130 	virtual void DoSetDestSizeInBytes(TUint aMaxDestDataSize ) = 0;
       
   131 	virtual void DoSetAdvancedSqueezeModeL(TAdvancedSqueezeParams* aSqueezeAutoResizeParams ) = 0;
       
   132 
       
   133 private:
       
   134 	IMPORT_C virtual void ReservedVirtual5();
       
   135 
       
   136 private:	
       
   137 	// Future proofing
       
   138 	TAny* iPad;
       
   139 	};
       
   140 
       
   141 #endif // __SQUEEZETRANFORMEEXTENSION_H__