epoc32/include/imagetransform.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // This is the public client API for the Image Transform Library
    15 // 
    16 //
    17 
    18 /**
    19  @file
    20  @publishedAll
    21  @released
    22 */
    23 
    24 #ifndef __IMAGETRANSFORM_H__
    25 #define __IMAGETRANSFORM_H__
    26 
    27 #include <e32base.h>
    28 #include <fbs.h>
    29 // fwd refs
    30 class CImageTransformFramework;	//fwd ref
    31 class CImageTransformPluginExtension;
    32 
    33 	
    34 /**
    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.
    37 
    38 @publishedAll
    39 @released
    40 */
    41 class CImageTransform : public CBase
    42 	{
    43 public:
    44 	/**
    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.
    48 	*/
    49 	enum TOptions
    50 		{
    51 		/** No flag set. This is the default option*/
    52 		EOptionNone = 0x00,
    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. */
    56 		EThumbnail	= 0x01,
    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.
    60 		*/
    61 		EIgnoreExifMetadataProcessing = 0x02,
    62 		/**
    63 		TOptions should not be set greater than or equal to this value.
    64 		*/
    65 		EEnumBoundary = 0x04
    66 		};
    67 	/**
    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
    75 	Squeezing
    76 	*/
    77 	enum TTransformations
    78 		{
    79 		/** 
    80 		No transformation set
    81 		*/
    82 		ETransformationNone = 0x00,
    83 		/**
    84 		If set, the image is scaled based on the parameter passed in SetDestSizeInPixelsL(). 
    85 		*/
    86 		EScale = 0x01,
    87 		/**
    88 		If set, the image is clipped based on the parameter passed in SetSourceRect(). 
    89 		*/
    90 		ECrop = 0x02,
    91 		/**
    92 		If set, the image is squeezed
    93 		*/			
    94 		ESqueeze = 0x04,
    95 		/**
    96 		If set, the image is oriented 
    97 		*/			
    98 		EOrientation = 0x08,
    99 		/**
   100 		If set, the image is blend with the overlay image
   101 		*/
   102 		EOverlay = 0x10,
   103 		/**
   104 		If set, the plugin having exif extension is looked for
   105 		*/
   106 		EExif = 0x20,
   107 		/**
   108 		TTransformations should not be set greater than or equal to this value 
   109 		*/
   110 		ETransformEnumBoundary = 0x40
   111 		};
   112 public:
   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();
   122 
   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);
   126 	
   127 	IMPORT_C void SetOptionsL(TUint aOptions);
   128 	IMPORT_C void SetPreserveImageData(TBool aPreserveImageData);
   129 
   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);
   137 private:
   138 	CImageTransform();
   139 	void ConstructL(RFs& aFs);
   140 
   141 private:
   142 	CImageTransformFramework* iBody;
   143 	};
   144 
   145 #endif // __IMAGETRANSFORM_H__