williamr@2
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// This is the public client API for the Image Transform Library
|
williamr@2
|
15 |
//
|
williamr@2
|
16 |
//
|
williamr@4
|
17 |
|
williamr@2
|
18 |
/**
|
williamr@2
|
19 |
@file
|
williamr@2
|
20 |
@publishedAll
|
williamr@2
|
21 |
@released
|
williamr@2
|
22 |
*/
|
williamr@2
|
23 |
|
williamr@2
|
24 |
#ifndef __IMAGETRANSFORM_H__
|
williamr@2
|
25 |
#define __IMAGETRANSFORM_H__
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#include <e32base.h>
|
williamr@2
|
28 |
#include <fbs.h>
|
williamr@2
|
29 |
// fwd refs
|
williamr@2
|
30 |
class CImageTransformFramework; //fwd ref
|
williamr@2
|
31 |
class CImageTransformPluginExtension;
|
williamr@2
|
32 |
|
williamr@4
|
33 |
|
williamr@2
|
34 |
/**
|
williamr@2
|
35 |
The public API for clients to call the Image Transform (scaling) library.
|
williamr@2
|
36 |
This class provides functions to scale images held in files or descriptors.
|
williamr@2
|
37 |
|
williamr@2
|
38 |
@publishedAll
|
williamr@2
|
39 |
@released
|
williamr@2
|
40 |
*/
|
williamr@2
|
41 |
class CImageTransform : public CBase
|
williamr@2
|
42 |
{
|
williamr@2
|
43 |
public:
|
williamr@2
|
44 |
/**
|
williamr@2
|
45 |
Flags to control how the image is transformed.
|
williamr@2
|
46 |
The EThumbnail and EIgnoreExifMetadataProcessing are mutually exclusive,
|
williamr@2
|
47 |
and SHOULD NOT be used together. If they are, then EThumbnail is used.
|
williamr@2
|
48 |
*/
|
williamr@2
|
49 |
enum TOptions
|
williamr@2
|
50 |
{
|
williamr@2
|
51 |
/** No flag set. This is the default option*/
|
williamr@2
|
52 |
EOptionNone = 0x00,
|
williamr@2
|
53 |
/** If set, the destination image will always have a thumbnail.
|
williamr@2
|
54 |
If the source already has a thumbnail, then this is the one that will appear
|
williamr@2
|
55 |
in the destination, otherwise one will be generated. */
|
williamr@2
|
56 |
EThumbnail = 0x01,
|
williamr@2
|
57 |
/** If set, then the Exif data is not parsed and ExifMetaData() will always return NULL. If the source image is EXIF,
|
williamr@2
|
58 |
then the EXIF information is copied without modification (i.e. without parsing) to the destination. In cases where
|
williamr@2
|
59 |
the source is JFIF, the destination image is also JFIF.
|
williamr@2
|
60 |
*/
|
williamr@2
|
61 |
EIgnoreExifMetadataProcessing = 0x02,
|
williamr@2
|
62 |
/**
|
williamr@2
|
63 |
TOptions should not be set greater than or equal to this value.
|
williamr@2
|
64 |
*/
|
williamr@2
|
65 |
EEnumBoundary = 0x04
|
williamr@2
|
66 |
};
|
williamr@4
|
67 |
/**
|
williamr@4
|
68 |
Flags to specify the desired transformations.
|
williamr@4
|
69 |
If no flag or "EScale" flag is set then the framework will look for the plugins
|
williamr@4
|
70 |
supporting scaling which includes all the plugins supporting
|
williamr@4
|
71 |
version-1 opaque data and the plugins supporting version-2 opaque
|
williamr@4
|
72 |
data with the scaling flag set.
|
williamr@4
|
73 |
A plug-in supporting Squeeze, Orientation and Overlay in a single transform
|
williamr@4
|
74 |
must perform these transformation in the order: Overlaying, Orientation and then
|
williamr@4
|
75 |
Squeezing
|
williamr@4
|
76 |
*/
|
williamr@4
|
77 |
enum TTransformations
|
williamr@4
|
78 |
{
|
williamr@4
|
79 |
/**
|
williamr@4
|
80 |
No transformation set
|
williamr@4
|
81 |
*/
|
williamr@4
|
82 |
ETransformationNone = 0x00,
|
williamr@4
|
83 |
/**
|
williamr@4
|
84 |
If set, the image is scaled based on the parameter passed in SetDestSizeInPixelsL().
|
williamr@4
|
85 |
*/
|
williamr@4
|
86 |
EScale = 0x01,
|
williamr@4
|
87 |
/**
|
williamr@4
|
88 |
If set, the image is clipped based on the parameter passed in SetSourceRect().
|
williamr@4
|
89 |
*/
|
williamr@4
|
90 |
ECrop = 0x02,
|
williamr@4
|
91 |
/**
|
williamr@4
|
92 |
If set, the image is squeezed
|
williamr@4
|
93 |
*/
|
williamr@4
|
94 |
ESqueeze = 0x04,
|
williamr@4
|
95 |
/**
|
williamr@4
|
96 |
If set, the image is oriented
|
williamr@4
|
97 |
*/
|
williamr@4
|
98 |
EOrientation = 0x08,
|
williamr@4
|
99 |
/**
|
williamr@4
|
100 |
If set, the image is blend with the overlay image
|
williamr@4
|
101 |
*/
|
williamr@4
|
102 |
EOverlay = 0x10,
|
williamr@4
|
103 |
/**
|
williamr@4
|
104 |
If set, the plugin having exif extension is looked for
|
williamr@4
|
105 |
*/
|
williamr@4
|
106 |
EExif = 0x20,
|
williamr@4
|
107 |
/**
|
williamr@4
|
108 |
TTransformations should not be set greater than or equal to this value
|
williamr@4
|
109 |
*/
|
williamr@4
|
110 |
ETransformEnumBoundary = 0x40
|
williamr@4
|
111 |
};
|
williamr@2
|
112 |
public:
|
williamr@2
|
113 |
IMPORT_C static CImageTransform* NewL(RFs& aFs);
|
williamr@2
|
114 |
IMPORT_C ~CImageTransform();
|
williamr@2
|
115 |
IMPORT_C void SetPluginUidL(TUid aPluginUid);
|
williamr@2
|
116 |
IMPORT_C void SetSourceFilenameL(const TDesC& aFilename);
|
williamr@2
|
117 |
IMPORT_C void SetSourceDataL(const TDesC8& aData);
|
williamr@2
|
118 |
IMPORT_C void SetSourceMimeTypeL(const TDesC8& aMIMEType);
|
williamr@2
|
119 |
IMPORT_C void SetSourceImageTypeL(TUid aImageType, TUid aImageSubType = KNullUid);
|
williamr@2
|
120 |
IMPORT_C void SetSourceRect(const TRect& aRect);
|
williamr@2
|
121 |
IMPORT_C void ClearSourceRect();
|
williamr@2
|
122 |
|
williamr@2
|
123 |
IMPORT_C void SetDestFilenameL(const TDesC& aFilename);
|
williamr@2
|
124 |
IMPORT_C void SetDestDataL(HBufC8*& aData);
|
williamr@2
|
125 |
IMPORT_C void SetDestSizeInPixelsL(const TSize& aDestinationSize, TBool aMaintainAspectRatio = ETrue);
|
williamr@4
|
126 |
|
williamr@2
|
127 |
IMPORT_C void SetOptionsL(TUint aOptions);
|
williamr@2
|
128 |
IMPORT_C void SetPreserveImageData(TBool aPreserveImageData);
|
williamr@2
|
129 |
|
williamr@2
|
130 |
IMPORT_C void SetupL();
|
williamr@2
|
131 |
IMPORT_C void Transform(TRequestStatus& aStatus);
|
williamr@2
|
132 |
IMPORT_C void CancelTransform();
|
williamr@2
|
133 |
IMPORT_C void Reset();
|
williamr@2
|
134 |
IMPORT_C CImageTransformPluginExtension* Extension() const;
|
williamr@4
|
135 |
IMPORT_C CImageTransformPluginExtension* Extension(TUid aExtensionUid, TInt& aError) const;
|
williamr@4
|
136 |
IMPORT_C void SetTransformationsL(TUint aTransformations);
|
williamr@2
|
137 |
private:
|
williamr@2
|
138 |
CImageTransform();
|
williamr@2
|
139 |
void ConstructL(RFs& aFs);
|
williamr@2
|
140 |
|
williamr@2
|
141 |
private:
|
williamr@2
|
142 |
CImageTransformFramework* iBody;
|
williamr@2
|
143 |
};
|
williamr@2
|
144 |
|
williamr@2
|
145 |
#endif // __IMAGETRANSFORM_H__
|