|
1 // Copyright (c) 1998-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 // |
|
15 |
|
16 #include <mdaimageconverter.h> |
|
17 #include "MdaImageConverterPriv.h" |
|
18 |
|
19 // |
|
20 // CMdaBitmapRotator |
|
21 // |
|
22 |
|
23 /** |
|
24 Constructs and initialises a new instance of the image rotator. |
|
25 |
|
26 The function leaves if the image rotator object cannot be created. |
|
27 |
|
28 @return A pointer to the new image rotator object. |
|
29 */ |
|
30 EXPORT_C CMdaBitmapRotator* CMdaBitmapRotator::NewL() |
|
31 { |
|
32 CMdaBitmapRotator* self = new(ELeave) CMdaBitmapRotator; |
|
33 CleanupStack::PushL(self); |
|
34 self->iProperties = CMdaBitmapRotatorPriv::NewL(); |
|
35 CleanupStack::Pop(); // self |
|
36 return self; |
|
37 } |
|
38 |
|
39 /** |
|
40 Default destructor. |
|
41 |
|
42 Frees all associated resources. |
|
43 */ |
|
44 EXPORT_C CMdaBitmapRotator::~CMdaBitmapRotator() |
|
45 { |
|
46 delete iProperties; |
|
47 } |
|
48 |
|
49 /** |
|
50 Begins the rotation of a bitmap clockwise through the specified angle and writes |
|
51 the output to the specified file. |
|
52 |
|
53 The operation is asynchronous. When it is complete, successfully or |
|
54 otherwise, the callback function |
|
55 MMdaImageUtilObserver::MiuoConvertComplete() is called, |
|
56 passing the state of the operation. |
|
57 |
|
58 @param aObserver |
|
59 The image utility observer interface. |
|
60 @param aSrcBitmap |
|
61 The bitmap to be rotated. |
|
62 @param aTgtBitmap |
|
63 The target location for the rotated bitmap. |
|
64 @param aAngle |
|
65 The angle through which the bitmap is to be rotated. |
|
66 */ |
|
67 EXPORT_C void CMdaBitmapRotator::RotateL(MMdaImageUtilObserver& aObserver,CFbsBitmap& aSrcBitmap,CFbsBitmap& aTgtBitmap,TRotationAngle aAngle) |
|
68 { |
|
69 iProperties->RotateL(aObserver, aSrcBitmap, aTgtBitmap, aAngle); |
|
70 } |
|
71 |
|
72 /** |
|
73 Begins the rotation of a bitmap clockwise through the specified angle. |
|
74 |
|
75 The operation is asynchronous. When it is complete, successfully or |
|
76 otherwise, the callback function |
|
77 MMdaImageUtilObserver::MiuoConvertComplete() is called, |
|
78 passing the state of the operation. |
|
79 |
|
80 @param aObserver |
|
81 The image utility observer interface. |
|
82 @param aBitmap |
|
83 The bitmap to be rotated. This reference is also the |
|
84 target location for the rotated bitmap. |
|
85 @param aAngle |
|
86 The angle through which the bitmap is to be rotated. |
|
87 */ |
|
88 EXPORT_C void CMdaBitmapRotator::RotateL(MMdaImageUtilObserver& aObserver,CFbsBitmap& aBitmap,TRotationAngle aAngle) |
|
89 { |
|
90 iProperties->RotateL(aObserver, aBitmap, aAngle); |
|
91 } |
|
92 |
|
93 /** |
|
94 Cancels the bitmap rotation operation. |
|
95 |
|
96 The observer callback function |
|
97 MMdaImageUtilObserver::MiuoConvertComplete() is not |
|
98 called. |
|
99 */ |
|
100 EXPORT_C void CMdaBitmapRotator::CancelRotation() |
|
101 { |
|
102 iProperties->CancelRotation(); |
|
103 } |