1 // Copyright (c) 2007-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 the public client API for the Image Transform Library
24 #ifndef __IMAGETRANSFORM_H__
25 #define __IMAGETRANSFORM_H__
30 class CImageTransformFramework; //fwd ref
31 class CImageTransformPluginExtension;
35 The public API for clients to call the Image Transform (scaling) library.
36 This class provides functions to scale images held in files or descriptors.
41 class CImageTransform : public CBase
45 Flags to control how the image is transformed.
46 The EThumbnail and EIgnoreExifMetadataProcessing are mutually exclusive,
47 and SHOULD NOT be used together. If they are, then EThumbnail is used.
51 /** No flag set. This is the default option*/
53 /** If set, the destination image will always have a thumbnail.
54 If the source already has a thumbnail, then this is the one that will appear
55 in the destination, otherwise one will be generated. */
57 /** If set, then the Exif data is not parsed and ExifMetaData() will always return NULL. If the source image is EXIF,
58 then the EXIF information is copied without modification (i.e. without parsing) to the destination. In cases where
59 the source is JFIF, the destination image is also JFIF.
61 EIgnoreExifMetadataProcessing = 0x02,
63 TOptions should not be set greater than or equal to this value.
68 Flags to specify the desired transformations.
69 If no flag or "EScale" flag is set then the framework will look for the plugins
70 supporting scaling which includes all the plugins supporting
71 version-1 opaque data and the plugins supporting version-2 opaque
72 data with the scaling flag set.
73 A plug-in supporting Squeeze, Orientation and Overlay in a single transform
74 must perform these transformation in the order: Overlaying, Orientation and then
82 ETransformationNone = 0x00,
84 If set, the image is scaled based on the parameter passed in SetDestSizeInPixelsL().
88 If set, the image is clipped based on the parameter passed in SetSourceRect().
92 If set, the image is squeezed
96 If set, the image is oriented
100 If set, the image is blend with the overlay image
104 If set, the plugin having exif extension is looked for
108 TTransformations should not be set greater than or equal to this value
110 ETransformEnumBoundary = 0x40
113 IMPORT_C static CImageTransform* NewL(RFs& aFs);
114 IMPORT_C ~CImageTransform();
115 IMPORT_C void SetPluginUidL(TUid aPluginUid);
116 IMPORT_C void SetSourceFilenameL(const TDesC& aFilename);
117 IMPORT_C void SetSourceDataL(const TDesC8& aData);
118 IMPORT_C void SetSourceMimeTypeL(const TDesC8& aMIMEType);
119 IMPORT_C void SetSourceImageTypeL(TUid aImageType, TUid aImageSubType = KNullUid);
120 IMPORT_C void SetSourceRect(const TRect& aRect);
121 IMPORT_C void ClearSourceRect();
123 IMPORT_C void SetDestFilenameL(const TDesC& aFilename);
124 IMPORT_C void SetDestDataL(HBufC8*& aData);
125 IMPORT_C void SetDestSizeInPixelsL(const TSize& aDestinationSize, TBool aMaintainAspectRatio = ETrue);
127 IMPORT_C void SetOptionsL(TUint aOptions);
128 IMPORT_C void SetPreserveImageData(TBool aPreserveImageData);
130 IMPORT_C void SetupL();
131 IMPORT_C void Transform(TRequestStatus& aStatus);
132 IMPORT_C void CancelTransform();
133 IMPORT_C void Reset();
134 IMPORT_C CImageTransformPluginExtension* Extension() const;
135 IMPORT_C CImageTransformPluginExtension* Extension(TUid aExtensionUid, TInt& aError) const;
136 IMPORT_C void SetTransformationsL(TUint aTransformations);
139 void ConstructL(RFs& aFs);
142 CImageTransformFramework* iBody;
145 #endif // __IMAGETRANSFORM_H__