|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Texture |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "alf/alftextureprocessor.h" |
|
21 #include "alf/alftexture.h" |
|
22 #include "alf/alfenv.h" |
|
23 #include "alf/alftexturemanager.h" |
|
24 #include "alfclient.h" |
|
25 |
|
26 struct CAlfTextureProcessor::TPrivateData |
|
27 { |
|
28 CAlfEnv* iEnv; |
|
29 }; |
|
30 |
|
31 |
|
32 |
|
33 // ======== MEMBER FUNCTIONS ======== |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // Constructor |
|
37 // --------------------------------------------------------------------------- |
|
38 // |
|
39 CAlfTextureProcessor::CAlfTextureProcessor() |
|
40 { |
|
41 |
|
42 } |
|
43 |
|
44 |
|
45 // --------------------------------------------------------------------------- |
|
46 // ?description |
|
47 // --------------------------------------------------------------------------- |
|
48 // |
|
49 CAlfTextureProcessor::~CAlfTextureProcessor() |
|
50 { |
|
51 if ( iData ) |
|
52 { |
|
53 } |
|
54 delete iData; |
|
55 iData = NULL; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // ?description |
|
60 // --------------------------------------------------------------------------- |
|
61 // |
|
62 CAlfTextureProcessor* CAlfTextureProcessor::NewL(CAlfEnv& aEnv) |
|
63 { |
|
64 CAlfTextureProcessor* self = |
|
65 CAlfTextureProcessor::NewLC(aEnv); |
|
66 CleanupStack::Pop( self ); |
|
67 return self; |
|
68 } |
|
69 |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // ?description |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 CAlfTextureProcessor* CAlfTextureProcessor::NewLC(CAlfEnv& aEnv) |
|
76 { |
|
77 CAlfTextureProcessor* self = new( ELeave ) CAlfTextureProcessor; |
|
78 CleanupStack::PushL( self ); |
|
79 self->ConstructL(aEnv); |
|
80 return self; |
|
81 } |
|
82 |
|
83 // --------------------------------------------------------------------------- |
|
84 // ?description |
|
85 // --------------------------------------------------------------------------- |
|
86 // |
|
87 void CAlfTextureProcessor::ConstructL(CAlfEnv& aEnv) |
|
88 { |
|
89 iData = new (ELeave) TPrivateData; |
|
90 iData->iEnv = &aEnv; |
|
91 } |
|
92 |
|
93 // --------------------------------------------------------------------------- |
|
94 // ?description |
|
95 // --------------------------------------------------------------------------- |
|
96 // |
|
97 EXPORT_C void CAlfTextureProcessor::BlurL(const CAlfTexture& aSrc, CAlfTexture& aDest, |
|
98 TInt aFilterSize, TInt aFlags) |
|
99 { |
|
100 // By default, use a quarter of the original size. |
|
101 TSize originalSize = aSrc.Size(); |
|
102 return BlurL(aSrc, aDest, |
|
103 TSize(originalSize.iWidth/2, originalSize.iHeight/2), |
|
104 aFilterSize, aFlags); |
|
105 } |
|
106 |
|
107 // --------------------------------------------------------------------------- |
|
108 // ?description |
|
109 // --------------------------------------------------------------------------- |
|
110 // |
|
111 EXPORT_C void CAlfTextureProcessor::BlurL(const CAlfTexture& aSrc, CAlfTexture& aDest, |
|
112 const TSize& aPreferredSize, TInt aFilterSize, TInt aFlag) |
|
113 { |
|
114 iData->iEnv->Client().TextureProcessorBlurL( aSrc.ServerHandle(), |
|
115 aDest.ServerHandle(), |
|
116 0, |
|
117 aPreferredSize, |
|
118 aFilterSize, |
|
119 aFlag ); |
|
120 } |
|
121 |
|
122 |