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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This is Image Transform extension for Squeeze Transformation
24 #ifndef __SQUEEZETRANFORMEEXTENSION_H__
25 #define __SQUEEZETRANFORMEEXTENSION_H__
28 #include <icl/imagetransformpluginext.h>
29 #include <imageframeconst.h>
35 This class provides advanced parameters for squeezing
37 class TAdvancedSqueezeParams
41 The different behaviours of auto resize
43 enum TAutoResizeAction
46 Preserves the source encoding quality while shrinking the width and height of the image
48 EAutoResizeActionPreserveSourceEncodingQuality,
50 Tries to preserve the max image size while lowering the encoding quality
52 EAutoResizeActionPrioritizeLargeImageSize,
54 Tries to preserve the highest possible encoding quality while shrinking the width and height of the image
56 EAutoResizeActionResizePrioritizeHighEncodingQuality,
58 Simultaneously lower the encoding quality and shrink the width and height of the image
60 EAutoResizeActionMiddleCourse
63 IMPORT_C TAdvancedSqueezeParams();
66 The desired max size of the transformed image in bytes.
68 TUint iMaxDestSizeInBytes;
71 The transformed image must not be smaller than this. The
72 size must be smaller than the iMaxImageSize
77 The transformed image must not be bigger than this. The size
78 must be bigger than the iMinImageSize
83 The desired behaviour of the auto resize
88 The lowest desired encoding quality.
89 Must be in the range (0.0) to (1.0)
91 TReal32 iMinEncodingQuality;
94 The color spacing of the transformed image
109 Squeeze Extension to the ImageTransform plugin
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.
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.
123 class CSqueezeTransformExtension : public CImageTransformPluginExtension
126 IMPORT_C void SetDestSizeInBytes(TUint aMaxDestDataSize ) ;
127 IMPORT_C void SetAdvancedSqueezeModeL(TAdvancedSqueezeParams* aSqueezeAutoResizeParams ) ;
130 virtual void DoSetDestSizeInBytes(TUint aMaxDestDataSize ) = 0;
131 virtual void DoSetAdvancedSqueezeModeL(TAdvancedSqueezeParams* aSqueezeAutoResizeParams ) = 0;
134 IMPORT_C virtual void ReservedVirtual5();
141 #endif // __SQUEEZETRANFORMEEXTENSION_H__