|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include "CFilterNegate.h" |
|
21 |
|
22 |
|
23 |
|
24 EXPORT_C TInt CFilterNegate::Create() |
|
25 { |
|
26 CFilterNegate* ptr = NULL; |
|
27 TRAPD( error, ptr = NewL(); ); |
|
28 if( error != KErrNone ) |
|
29 { |
|
30 ptr = NULL; |
|
31 } |
|
32 return (TInt)((MImageFilter*)ptr); |
|
33 } |
|
34 |
|
35 |
|
36 |
|
37 CFilterNegate* CFilterNegate::NewL() |
|
38 { |
|
39 CFilterNegate* self = new( ELeave )CFilterNegate(); |
|
40 CleanupStack::PushL( self ); |
|
41 self->ConstructL(); |
|
42 CleanupStack::Pop( self ); |
|
43 return self; |
|
44 } |
|
45 |
|
46 |
|
47 |
|
48 CFilterNegate::~CFilterNegate() |
|
49 { |
|
50 } |
|
51 |
|
52 |
|
53 |
|
54 CFilterNegate::CFilterNegate() |
|
55 { |
|
56 |
|
57 } |
|
58 |
|
59 |
|
60 |
|
61 void CFilterNegate::ConstructL() |
|
62 { |
|
63 |
|
64 } |
|
65 |
|
66 |
|
67 |
|
68 TRect CFilterNegate::Rect() |
|
69 { |
|
70 return iChild->Rect(); |
|
71 } |
|
72 |
|
73 TReal CFilterNegate::Scale() |
|
74 { |
|
75 return iChild->Scale(); |
|
76 } |
|
77 |
|
78 TSize CFilterNegate::ViewPortSize() |
|
79 { |
|
80 return iChild->ViewPortSize(); |
|
81 } |
|
82 |
|
83 |
|
84 TBlock * CFilterNegate::GetBlockL ( const TRect & aRect ) |
|
85 { |
|
86 TBlock * pB = iChild->GetBlockL (aRect); |
|
87 if (!pB) return NULL; |
|
88 for (TInt i = 0; i < pB->iDataLength; ++i) |
|
89 { |
|
90 pB->iData[i] ^= 0xFFFFFF; |
|
91 } |
|
92 return pB; |
|
93 } |
|
94 |
|
95 |
|
96 void CFilterNegate::SetParent( MImageFilter* aParent ) |
|
97 { |
|
98 iParent = aParent; |
|
99 } |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 void CFilterNegate::SetChild( MImageFilter* aChild ) |
|
105 { |
|
106 iChild = aChild; |
|
107 } |
|
108 |
|
109 |
|
110 |
|
111 TInt CFilterNegate::CmdL( const TDesC16& /*aCmd*/ ) |
|
112 { |
|
113 return 0; |
|
114 } |
|
115 |
|
116 |
|
117 |
|
118 const char* CFilterNegate::Type() |
|
119 { |
|
120 return "negate"; |
|
121 } |
|
122 |
|
123 |
|
124 #if !defined(EKA2) |
|
125 GLDEF_C TInt E32Dll( TDllReason ) |
|
126 { |
|
127 return KErrNone; |
|
128 } |
|
129 #endif |