|
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: Black & White provides functionality to convert bitmaps to black & white. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AKNSRLEFFECTPLUGINBLACKWHITE_H |
|
20 #define AKNSRLEFFECTPLUGINBLACKWHITE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "AknsRlEffectPlugin.h" |
|
24 #include <AknsRlEffect.h> |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 // Effect plugin UID |
|
29 const TInt KAknsRlEffectPluginBlackWhiteUID = 0x10204ADE; |
|
30 |
|
31 // Constants for parameter names |
|
32 _LIT( KAknsRlEffectBlackWhiteTreshold, "t" ); |
|
33 _LIT( KAknsRlEffectBlackWhiteBlendFactor, "f" ); |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Black & White provides functionality to convert bitmaps to black & white. |
|
39 * |
|
40 * @since 2.8 |
|
41 */ |
|
42 NONSHARABLE_CLASS(CAknsRlEffectPluginBlackWhite): |
|
43 public CAknsRlEffectPlugin, |
|
44 public MAknsRlEffect |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Default constructor. |
|
50 * |
|
51 * @since 2.8 |
|
52 */ |
|
53 CAknsRlEffectPluginBlackWhite(); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 * |
|
58 * @since 2.8 |
|
59 */ |
|
60 virtual ~CAknsRlEffectPluginBlackWhite(); |
|
61 |
|
62 public: // Implementation of CAknsEffectPlugin |
|
63 |
|
64 TUid EffectUid() const; |
|
65 MAknsRlEffect* Effect( const TInt aInterface ); |
|
66 |
|
67 public: // Implementation of MAknsRlEffect |
|
68 |
|
69 void InitializeL(); |
|
70 void Release(); |
|
71 |
|
72 void ActivateL( MAknsRlEffectContext* aContext ); |
|
73 void Deactivate(); |
|
74 |
|
75 /** |
|
76 * Accepted named parameters: |
|
77 * - "t", integer, range [0, 255], black & white treshold |
|
78 * - "f", integer, blend factor |
|
79 * |
|
80 * Treshold: |
|
81 * If pixel intensity value is below the treshold it will be black, |
|
82 * otherwise white. Pixel intensity value is calculated by grayscaling |
|
83 * the pixel. Normal treshold range is [0,255], values outside range |
|
84 * work as expected. |
|
85 * |
|
86 * Blend factor: |
|
87 * Blend factor controls the resulting opacity of the applied effect. |
|
88 * Normal value range is [0, 255] but values outside will also work. |
|
89 * - Value 0 will result in the original image. |
|
90 * - Value 255 will result in the filtered image. |
|
91 * - Values outside range [0, 255] will result in underexposure or |
|
92 * overexposure. |
|
93 * |
|
94 * The default parameter values are: |
|
95 * - "t" = 127 |
|
96 * - "f" = 255, full filter opacity |
|
97 */ |
|
98 void SetParametersL( MAknsRlParameterIterator& aParameters ); |
|
99 |
|
100 /** |
|
101 * Supported modes: |
|
102 * - EColor64K -> EColor64K |
|
103 * - EColor16MU -> EColor16MU |
|
104 * |
|
105 * - EColor64K -> EGray256 |
|
106 * - EColor16MU -> EGray256 |
|
107 * |
|
108 * - EGray256 -> EColor64K |
|
109 * - EGray256 -> EColor16MU |
|
110 * - EGray256 -> EGray256 |
|
111 * |
|
112 * Masks are ignored. Target layer and input layer A are both required. |
|
113 */ |
|
114 void GetCapabilities( TAknsRlEffectCaps& aCaps ); |
|
115 |
|
116 TInt Render( const TAknsRlRenderOpParam& aParam ); |
|
117 |
|
118 private: |
|
119 |
|
120 MAknsRlEffectContext* iContext; |
|
121 |
|
122 TInt iTreshold; |
|
123 TInt iBlend; |
|
124 }; |
|
125 |
|
126 #endif // AKNSRLEFFECTPLUGINBLACKWHITE_H |
|
127 |
|
128 // End of File |