|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of scaling processor |
|
15 * : using MIHLBitmap type bitmaps. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CIHLBITMAPPROCESSOR_H |
|
21 #define CIHLBITMAPPROCESSOR_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <MIHLBitmapProcessor.h> |
|
25 #include <e32base.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CIHLScaler; |
|
29 class CIHLBitmap; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 /** |
|
33 * CIHLBitmapProcessor |
|
34 * |
|
35 * Implementation of scaling processor |
|
36 * using MIHLBitmap type bitmaps. |
|
37 * @lib IHL.lib |
|
38 * @since 3.0 |
|
39 */ |
|
40 NONSHARABLE_CLASS( CIHLBitmapProcessor ) : public CActive, |
|
41 public MIHLBitmapProcessor |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 static CIHLBitmapProcessor* NewL( const TUint32 aOptions = 0 ); |
|
49 |
|
50 /* |
|
51 * Virtual destructor. |
|
52 */ |
|
53 virtual ~CIHLBitmapProcessor(); |
|
54 |
|
55 public: // From base class MIHLProcessor |
|
56 |
|
57 /* |
|
58 * From MIHLProcessor, see base class header. |
|
59 */ |
|
60 TIHLInterfaceType Type() const; |
|
61 |
|
62 public: // From base class MIHLBitmapProcessor |
|
63 |
|
64 /* |
|
65 * From MIHLBitmapProcessor, see base class header. |
|
66 */ |
|
67 TInt Process( TRequestStatus& aStatus, |
|
68 const MIHLBitmap& aSrcBitmap, |
|
69 const TRect& aSrcRect, |
|
70 MIHLBitmap& aDstBitmap, |
|
71 const TRect& aDstRect ); |
|
72 |
|
73 /* |
|
74 * From MIHLBitmapProcessor, see base class header. |
|
75 */ |
|
76 TBool IsBusy() const; |
|
77 |
|
78 /* |
|
79 * From MIHLBitmapProcessor, see base class header. |
|
80 */ |
|
81 void CancelProcess(); |
|
82 |
|
83 /* |
|
84 * From MIHLBitmapProcessor, see base class header. |
|
85 */ |
|
86 void SetFilter( MIHFilter* aFilter ); |
|
87 |
|
88 private: // From base class CActive |
|
89 |
|
90 /* |
|
91 * From CActive, see base class header. |
|
92 */ |
|
93 void DoCancel(); |
|
94 |
|
95 /* |
|
96 * From CActive, see base class header. |
|
97 */ |
|
98 void RunL(); |
|
99 |
|
100 /* |
|
101 * From CActive, see base class header. |
|
102 */ |
|
103 TInt RunError( TInt aError ); |
|
104 |
|
105 |
|
106 private: // Private methods |
|
107 |
|
108 /* |
|
109 * Process bitmap part of source image |
|
110 */ |
|
111 void ProcessBitmapL(); |
|
112 |
|
113 /* |
|
114 * Process mask part of source image |
|
115 */ |
|
116 void ProcessMaskL(); |
|
117 |
|
118 /* |
|
119 * Set this active object to completed state |
|
120 * -> one process step (RunL) will be executed. |
|
121 */ |
|
122 void SelfComplete(); |
|
123 |
|
124 /* |
|
125 * Set client request to completed state |
|
126 * -> process complete. |
|
127 * @param aReason Request complete reason |
|
128 */ |
|
129 void RequestComplete( TInt aReason ); |
|
130 |
|
131 private: // Private constructors |
|
132 |
|
133 CIHLBitmapProcessor(); |
|
134 void ConstructL( const TUint32 aOptions ); |
|
135 |
|
136 private: // Private data types |
|
137 |
|
138 enum TProcessorState |
|
139 { |
|
140 EInactive, |
|
141 EProcessBitmap, |
|
142 EProcessMask, |
|
143 EFinish, |
|
144 }; |
|
145 |
|
146 private: // Data |
|
147 |
|
148 // Ref: Process status & state |
|
149 TRequestStatus* iProcessorStatus; |
|
150 TProcessorState iProcessorState; |
|
151 |
|
152 // Ref: Source bitmap & rect |
|
153 const MIHLBitmap* iSrcBitmap; |
|
154 TRect iSrcRect; |
|
155 |
|
156 // Ref: Destination bitmap & rect |
|
157 CIHLBitmap* iDstBitmap; |
|
158 TRect iDstRect; |
|
159 |
|
160 // Own: Scaler |
|
161 CIHLScaler* iScaler; |
|
162 |
|
163 }; |
|
164 |
|
165 #endif // CIHLBITMAPPROCESSOR_H |
|
166 |
|
167 // End of File |