|
1 /* |
|
2 * Copyright (c) 2004-2008 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: Provides moving layer(s) functionality. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AKNSRLEFFECTPLUGINMOVINGLAYERS_H |
|
20 #define AKNSRLEFFECTPLUGINMOVINGLAYERS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "AknsRlEffectPlugin.h" |
|
24 #include <AknsRlEffect.h> |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 // Effect plugin UID |
|
29 const TInt KAknsRlEffectPluginMovingLayersUID = 0x1020762D; |
|
30 |
|
31 // Constants for parameter names |
|
32 _LIT( KAknsRlEffectMovingLayersAX, "ax" ); |
|
33 _LIT( KAknsRlEffectMovingLayersAY, "ay" ); |
|
34 _LIT( KAknsRlEffectMovingLayersBX, "bx" ); |
|
35 _LIT( KAknsRlEffectMovingLayersBY, "by" ); |
|
36 |
|
37 _LIT( KAknsRlEffectMovingLayersAXY, "axy" ); |
|
38 _LIT( KAknsRlEffectMovingLayersBXY, "bxy" ); |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * Moving layers can use two input layers. Input layer A is used as a |
|
44 * background. Input layer B is blended on A using input mask B. Input mask A is |
|
45 * ignored. The origin of both input layers can be moved (results in tiling, |
|
46 * seamless layer textures recommended). |
|
47 * |
|
48 * It is also possible to use input layer A only. |
|
49 * |
|
50 * @since 3.0 |
|
51 */ |
|
52 class CAknsRlEffectPluginMovingLayers: |
|
53 public CAknsRlEffectPlugin, |
|
54 public MAknsRlEffect |
|
55 { |
|
56 public: // Constructors and destructor |
|
57 |
|
58 /** |
|
59 * Default constructor. |
|
60 * |
|
61 * @since 3.0 |
|
62 */ |
|
63 CAknsRlEffectPluginMovingLayers(); |
|
64 |
|
65 /** |
|
66 * Destructor. |
|
67 * |
|
68 * @since 3.0 |
|
69 */ |
|
70 virtual ~CAknsRlEffectPluginMovingLayers(); |
|
71 |
|
72 public: // Implementation of CAknsEffectPlugin |
|
73 |
|
74 TUid EffectUid() const; |
|
75 MAknsRlEffect* Effect( const TInt aInterface ); |
|
76 |
|
77 public: // Implementation of MAknsRlEffect |
|
78 |
|
79 void InitializeL(); |
|
80 void Release(); |
|
81 |
|
82 void ActivateL( MAknsRlEffectContext* aContext ); |
|
83 void Deactivate(); |
|
84 |
|
85 /** |
|
86 * Accepted named parameters: |
|
87 * |
|
88 * - "ax", integer, coordinate x of A's origin |
|
89 * - "ay", integer, coordinate y of A's origin |
|
90 * - "bx", integer, coordinate x of B's origin |
|
91 * - "by", integer, coordinate y of B's origin |
|
92 * |
|
93 * Coordinate (ax, ay) defines the origin of input layer A on output. |
|
94 * Coordinate (bx, by) defines the origin of input layer B on output. |
|
95 * Coordinates are in pixels and allowed range is [MIN_INT, MAX_INT]. |
|
96 * |
|
97 * Alternatively you can use the next parameters: |
|
98 * - "axy", descriptor, point (x, y) of A's origin |
|
99 * - "bxy", descriptor, point (x, y) of B's origin |
|
100 * |
|
101 * Descriptor size must be at least 2, extra elements are ignored. First |
|
102 * element is coordinate x, second element is coordinate y. Coordinates |
|
103 * are in pixels and allowed range is full 16-bit ingeter. |
|
104 */ |
|
105 void SetParametersL( MAknsRlParameterIterator& aParameters ); |
|
106 |
|
107 /** |
|
108 * Supported modes: |
|
109 * - EColor64K -> EColor64K |
|
110 * - EColor16MU -> EColor16MU |
|
111 * - EGray256 -> EGray256 |
|
112 * |
|
113 * Masks are optional, mask A is always ignored. Target layer A is |
|
114 * required. Target layer B is optional. Output layer mask is optional, |
|
115 * cleared to white if exists. |
|
116 */ |
|
117 void GetCapabilities( TAknsRlEffectCaps& aCaps ); |
|
118 |
|
119 TInt Render( const TAknsRlRenderOpParam& aParam ); |
|
120 |
|
121 private: |
|
122 TInt CreateTempBitmap( const CFbsBitmap& aBitmap ); |
|
123 void DeleteTempBitmap(); |
|
124 |
|
125 private: |
|
126 |
|
127 MAknsRlEffectContext* iContext; |
|
128 |
|
129 TInt iAx; |
|
130 TInt iAy; |
|
131 TInt iBx; |
|
132 TInt iBy; |
|
133 |
|
134 /** |
|
135 * Temporary bitmap for cases where the target layer is the input layer |
|
136 * -> input layer must be stored to a temporary bitmap. |
|
137 */ |
|
138 CFbsBitmap* iTempBitmap; |
|
139 CFbsBitmapDevice* iTempDevice; |
|
140 CFbsBitGc* iTempContext; |
|
141 }; |
|
142 |
|
143 #endif // AKNSRLEFFECTPLUGINMOVINGLAYERS_H |
|
144 |
|
145 // End of File |
|
146 |