Project

General

Profile

Download (32.2 KB) Statistics
| Branch: | Revision:

examples / src / main / java / org / distorted / examples / generic / GenericEffect.java @ cef5d326

1 56cbe1cf Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2016 Leszek Koltunski                                                               //
3
//                                                                                               //
4 71c8884f Leszek Koltunski
// This file is part of Distorted.                                                               //
5 56cbe1cf Leszek Koltunski
//                                                                                               //
6 71c8884f Leszek Koltunski
// Distorted is free software: you can redistribute it and/or modify                             //
7 56cbe1cf Leszek Koltunski
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11 71c8884f Leszek Koltunski
// Distorted is distributed in the hope that it will be useful,                                  //
12 56cbe1cf Leszek Koltunski
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17 71c8884f Leszek Koltunski
// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
18 56cbe1cf Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20 2ec2dc32 Leszek Koltunski
package org.distorted.examples.generic;
21 56cbe1cf Leszek Koltunski
22 cef5d326 Leszek Koltunski
import java.lang.ref.WeakReference;
23
24 56cbe1cf Leszek Koltunski
import android.view.View;
25
import android.widget.SeekBar;
26
import android.widget.TextView;
27
28
import org.distorted.examples.R;
29 cef5d326 Leszek Koltunski
import org.distorted.library.effect.*;
30
import org.distorted.library.type.*;
31 01782e85 Leszek Koltunski
import org.distorted.library.main.DistortedEffects;
32 56cbe1cf Leszek Koltunski
33
///////////////////////////////////////////////////////////////////////////////////////////////////
34
35 46b26cdc Leszek Koltunski
class GenericEffect implements SeekBar.OnSeekBarChangeListener
36 56cbe1cf Leszek Koltunski
  {
37 3b1e9c7e Leszek Koltunski
  private static final int BACKGROUND_ODD = 0xff555555;
38
  private static final int BACKGROUND_EVEN= 0xff333333;
39
40 cef5d326 Leszek Koltunski
  private final WeakReference<GenericActivity2> mAct;
41 56cbe1cf Leszek Koltunski
42 cef5d326 Leszek Koltunski
  private final EffectName mName;
43 56cbe1cf Leszek Koltunski
  private int[] mInter;
44
  private int[] mInterRegion;
45
  private int[] mInterCenter;
46
  private int[] mSeekID;
47
  private int[] mSeekRegionID;
48
  private int[] mSeekCenterID;
49 cef5d326 Leszek Koltunski
  private final int mDimension, mRegionDimension;
50 56cbe1cf Leszek Koltunski
  private TextView mText,mTextRegion,mTextCenter;
51
52
  private Dynamic1D mDyn1;
53 c11a3a15 Leszek Koltunski
  private Dynamic2D mDyn2;
54 56cbe1cf Leszek Koltunski
  private Dynamic3D mDyn3;
55 334c13fa Leszek Koltunski
  private Dynamic4D mDyn4;
56 2f2f6176 Leszek Koltunski
  private Dynamic5D mDyn5;
57 56cbe1cf Leszek Koltunski
  private Static1D  mSta1;
58 c11a3a15 Leszek Koltunski
  private Static2D  mSta2;
59 56cbe1cf Leszek Koltunski
  private Static3D  mSta3;
60 334c13fa Leszek Koltunski
  private Static4D  mSta4;
61 2f2f6176 Leszek Koltunski
  private Static5D  mSta5;
62 1585ba24 Leszek Koltunski
  private Dynamic4D mRegion4Dyn;
63
  private Static4D  mRegion4Sta;
64
  private Dynamic3D mRegion3Dyn;
65
  private Static3D  mRegion3Sta;
66 334c13fa Leszek Koltunski
  private Dynamic3D mCenterDyn;
67
  private Static3D  mCenterSta;
68 56cbe1cf Leszek Koltunski
69 fed00329 Leszek Koltunski
  private View mButton, mEffect, mCenter, mRegion;
70 fa9053f5 Leszek Koltunski
  private long mId;
71
72 8fd9f5fa Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
73 4282d39a Leszek Koltunski
// requires knowledge about effect nature
74 8fd9f5fa Leszek Koltunski
75 d04a4886 Leszek Koltunski
  void apply(DistortedEffects effects)
76 8fd9f5fa Leszek Koltunski
    {
77 06366d12 Leszek Koltunski
    Effect effect=null;
78
79 8fd9f5fa Leszek Koltunski
    switch(mName)
80
      {
81 ad98c3cb Leszek Koltunski
      case ROTATE           : effect = new MatrixEffectRotate      (mDyn1, mDyn3, mCenterDyn); break;
82
      case QUATERNION       : effect = new MatrixEffectQuaternion  (mDyn4, mCenterDyn)       ; break;
83
      case MOVE             : effect = new MatrixEffectMove        (mDyn3)                   ; break;
84
      case SCALE            : effect = new MatrixEffectScale       (mDyn3)                   ; break;
85
      case SHEAR            : effect = new MatrixEffectShear       (mDyn3, mCenterDyn)       ; break;
86 2a261997 Leszek Koltunski
87 513b2e9c Leszek Koltunski
      case DISTORT          : effect = new VertexEffectDistort     (mDyn3, mCenterDyn, mRegion4Dyn)              ; break;
88
      case DEFORM           : effect = new VertexEffectDeform      (mDyn3, mDyn1, mCenterDyn, mRegion4Dyn)       ; break;
89
      case SINK             : effect = new VertexEffectSink        (mDyn1, mCenterDyn, mRegion4Dyn)              ; break;
90
      case PINCH            : effect = new VertexEffectPinch       (mDyn3, mCenterDyn, mRegion4Dyn)              ; break;
91
      case SWIRL            : effect = new VertexEffectSwirl       (mDyn1, mCenterDyn, mRegion4Dyn)              ; break;
92
      case WAVE             : effect = new VertexEffectWave        (mDyn5, mCenterDyn, mRegion4Dyn)              ; break;
93 8bf89617 Leszek Koltunski
      case DISAPPEAR        : effect = new VertexEffectDisappear   ()                                            ; break;
94
95 513b2e9c Leszek Koltunski
      case VERTEX_MOVE      : effect = new VertexEffectMove        (mDyn3)                                       ; break;
96
      case VERTEX_QUATERNION: effect = new VertexEffectQuaternion  (mDyn4, mCenterDyn)                           ; break;
97
      case VERTEX_ROTATE    : effect = new VertexEffectRotate      (mDyn1, mDyn3, mCenterDyn)                    ; break;
98
      case VERTEX_SCALE     : effect = new VertexEffectScale       (mDyn3)                                       ; break;
99
      case VERTEX_SHEAR     : effect = new VertexEffectShear       (mDyn3, mCenterDyn)                           ; break;
100 1585ba24 Leszek Koltunski
101
      case ALPHA            : effect = new FragmentEffectAlpha     (mDyn1,        mCenterDyn, mRegion3Dyn, false); break;
102
      case SMOOTH_ALPHA     : effect = new FragmentEffectAlpha     (mDyn1,        mCenterDyn, mRegion3Dyn, true ); break;
103
      case CHROMA           : effect = new FragmentEffectChroma    (mDyn1, mDyn3, mCenterDyn, mRegion3Dyn, false); break;
104
      case SMOOTH_CHROMA    : effect = new FragmentEffectChroma    (mDyn1, mDyn3, mCenterDyn, mRegion3Dyn, true ); break;
105
      case BRIGHTNESS       : effect = new FragmentEffectBrightness(mDyn1,        mCenterDyn, mRegion3Dyn, false); break;
106
      case SMOOTH_BRIGHTNESS: effect = new FragmentEffectBrightness(mDyn1,        mCenterDyn, mRegion3Dyn, true ); break;
107
      case SATURATION       : effect = new FragmentEffectSaturation(mDyn1,        mCenterDyn, mRegion3Dyn, false); break;
108
      case SMOOTH_SATURATION: effect = new FragmentEffectSaturation(mDyn1,        mCenterDyn, mRegion3Dyn, true ); break;
109
      case CONTRAST         : effect = new FragmentEffectContrast  (mDyn1,        mCenterDyn, mRegion3Dyn, false); break;
110
      case SMOOTH_CONTRAST  : effect = new FragmentEffectContrast  (mDyn1,        mCenterDyn, mRegion3Dyn, true ); break;
111 06c636a5 Leszek Koltunski
112 678c391d Leszek Koltunski
      case BLUR             : effect = new PostprocessEffectBlur   (mDyn2      ); break;
113
      case GLOW             : effect = new PostprocessEffectGlow   (mDyn2,mDyn4); break;
114 cef5d326 Leszek Koltunski
      case BORDER           : effect = new PostprocessEffectBorder (mDyn1,mDyn4); break;
115 06366d12 Leszek Koltunski
      }
116
117 cef5d326 Leszek Koltunski
    effects.apply(effect);
118
    mId = effect.getID();
119 8fd9f5fa Leszek Koltunski
    }
120
121
///////////////////////////////////////////////////////////////////////////////////////////////////
122 4282d39a Leszek Koltunski
// requires knowledge about effect nature
123 8fd9f5fa Leszek Koltunski
124
  private void fillStatics()
125
    {
126
    switch(mName)
127
      {
128 06c636a5 Leszek Koltunski
      ///////////////////////////////////////////////////////////////////////////////////////
129 4282d39a Leszek Koltunski
      // MATRIX (and VERTEX-pseudo-matrix)
130 06c636a5 Leszek Koltunski
      ///////////////////////////////////////////////////////////////////////////////////////
131
132 ad98c3cb Leszek Koltunski
      case VERTEX_ROTATE    :
133 5e23b17b Leszek Koltunski
      case ROTATE           : float an = (mInter[0]-50)*180/50.0f;
134 334c13fa Leszek Koltunski
                              float rx = (mInter[1]-50)/ 50.0f;
135
                              float ry = (mInter[2]-50)/ 50.0f;
136
                              float rz = (mInter[3]-50)/ 50.0f;
137 2a261997 Leszek Koltunski
                              mSta1.set(an);
138
                              mSta3.set(rx,ry,rz);
139 334c13fa Leszek Koltunski
                              break;
140 4282d39a Leszek Koltunski
      case VERTEX_QUATERNION:
141 7c8012ee Leszek Koltunski
      case QUATERNION       : float qx = (mInter[0]-50)/ 50.0f;
142
                              float qy = (mInter[1]-50)/ 50.0f;
143
                              float qz = (mInter[2]-50)/ 50.0f;
144 4282d39a Leszek Koltunski
                              float qw = (mInter[3]-50)*3.1415f/50;
145
                              float cosA = (float)Math.cos(qw/2);
146 7c8012ee Leszek Koltunski
                              float len = (float)Math.sqrt(qx*qx+qy*qy+qz*qz);
147 4282d39a Leszek Koltunski
                              float sinAnorm = (float)Math.sin(qw/2)/len;
148 7c8012ee Leszek Koltunski
                              mSta4.set(sinAnorm*qx,sinAnorm*qy,sinAnorm*qz, cosA);
149 334c13fa Leszek Koltunski
                              break;
150 65f622c1 Leszek Koltunski
      case MOVE             : float scr= mAct.get().getScreenWidth();
151 64f93787 Leszek Koltunski
                              float sw = scr/200.0f;
152
                              float sh = scr/200.0f;
153 fce25d04 leszek
                              float xm = (mInter[0]-50)*sw;
154
                              float ym = (mInter[1]-50)*sh;
155
                              float zm = (mInter[2]-50)*(sw+sh)/2;
156 334c13fa Leszek Koltunski
                              mSta3.set(xm,ym,zm);
157
                              break;
158 60da87db Leszek Koltunski
      case VERTEX_SCALE     :
159 df80818c Leszek Koltunski
      case SCALE            : float xs = (mInter[0]>50 ? 0.04f : 0.013f)*(mInter[0]-50) + 1;
160
                              float ys = (mInter[1]>50 ? 0.04f : 0.013f)*(mInter[1]-50) + 1;
161
                              float zs = (mInter[2]>50 ? 0.04f : 0.013f)*(mInter[2]-50) + 1;
162 334c13fa Leszek Koltunski
                              mSta3.set(xs,ys,zs);
163
                              break;
164 073c140a Leszek Koltunski
      case VERTEX_SHEAR     :
165 334c13fa Leszek Koltunski
      case SHEAR            : float xsh = (mInter[0]-50)/25.0f;
166
                              float ysh = (mInter[1]-50)/25.0f;
167
                              float zsh = (mInter[2]-50)/25.0f;
168
                              mSta3.set(xsh,ysh,zsh);
169
                              break;
170 7c8012ee Leszek Koltunski
171 06c636a5 Leszek Koltunski
      ///////////////////////////////////////////////////////////////////////////////////////
172
      // VERTEX
173
      ///////////////////////////////////////////////////////////////////////////////////////
174
175 4282d39a Leszek Koltunski
      case VERTEX_MOVE      :
176 513b2e9c Leszek Koltunski
      case DISTORT          : float ld = mAct.get().getWidth()/50.0f;
177 334c13fa Leszek Koltunski
                              float xd = (mInter[0]-50)*ld;
178
                              float yd = (mInter[1]-50)*ld;
179
                              float zd = (mInter[2]-50)*ld;
180
                              mSta3.set(xd,yd,zd);
181 76a81b6a Leszek Koltunski
                              break;
182 513b2e9c Leszek Koltunski
      case DEFORM           : float le = mAct.get().getWidth()/50.0f;
183
                              float xe = (mInter[0]-50)*le;
184
                              float ye = (mInter[1]-50)*le;
185
                              float ze = (mInter[2]-50)*le;
186
                              mSta3.set(xe,ye,ze);
187
                              float re = (mInter[3])*le;
188
                              mSta1.set(re);
189
                              break;
190 30e77a6c Leszek Koltunski
      case WAVE             : float l2 = mAct.get().getWidth()/50.0f;
191
                              float x2 = (mInter[0]-50)*l2;
192 2e7c7abf Leszek Koltunski
                              float y2 = (mInter[1]-50)*l2;
193 5e23b17b Leszek Koltunski
                              float z2 = (mInter[2]-50)*180 / 50.0f;
194
                              float w2 = (mInter[3]-50)*180 / 50.0f;
195
                              float v2 = (mInter[4]-50)*180 / 50.0f;
196 2f2f6176 Leszek Koltunski
                              mSta5.set(x2,y2,z2,w2,v2);
197 30e77a6c Leszek Koltunski
                              break;
198 76a81b6a Leszek Koltunski
      case SWIRL            : mSta1.set( 3.6f*(mInter[0]-50) );
199
                              break;
200 7908dbc2 Leszek Koltunski
      case SINK             : mSta1.set(mInter[0] > 50 ? 50.0f/(100.01f-mInter[0]) : mInter[0] / 50.0f);
201
                              break;
202
      case PINCH            : float dp = mInter[0] > 50 ? 50.0f/(100.01f-mInter[0]) : mInter[0] / 50.0f;
203 5e23b17b Leszek Koltunski
                              float ap = (mInter[1]-50)*180 / 50.0f;
204
                              float bp = (mInter[2]-50)*180 / 50.0f;
205
                              mSta3.set(dp,ap,bp);
206 7908dbc2 Leszek Koltunski
                              break;
207 8bf89617 Leszek Koltunski
      case DISAPPEAR        : break;
208 7908dbc2 Leszek Koltunski
209 06c636a5 Leszek Koltunski
      ///////////////////////////////////////////////////////////////////////////////////////
210
      // FRAGMENT
211
      ///////////////////////////////////////////////////////////////////////////////////////
212
213 76a81b6a Leszek Koltunski
      case ALPHA            :
214 889a962e Leszek Koltunski
      case SMOOTH_ALPHA     : mSta1.set(mInter[0]/100.0f);
215
                              break;
216 76a81b6a Leszek Koltunski
      case SATURATION       :
217
      case SMOOTH_SATURATION:
218
      case CONTRAST         :
219 889a962e Leszek Koltunski
      case SMOOTH_CONTRAST  :
220
      case BRIGHTNESS       :
221
      case SMOOTH_BRIGHTNESS: mSta1.set(mInter[0] > 50 ? 50.0f/(100.01f-mInter[0]) : mInter[0] / 50.0f);
222 76a81b6a Leszek Koltunski
                              break;
223
      case CHROMA           :
224
      case SMOOTH_CHROMA    : mSta1.set(mInter[0]/100.0f);
225 889a962e Leszek Koltunski
                              mSta3.set(mInter[1]/100.0f,
226
                                        mInter[2]/100.0f,
227
                                        mInter[3]/100.0f);
228 76a81b6a Leszek Koltunski
                              break;
229 06c636a5 Leszek Koltunski
230
      ///////////////////////////////////////////////////////////////////////////////////////
231
      // POSTPROCESS
232
      ///////////////////////////////////////////////////////////////////////////////////////
233
234 678c391d Leszek Koltunski
      case BLUR             : mSta2.set(mInter[0]/2.0f,
235
                                        mInter[1]/2.0f);
236 06c636a5 Leszek Koltunski
                              break;
237 678c391d Leszek Koltunski
      case GLOW             : mSta2.set(mInter[0]/2.0f,
238
                                        mInter[1]/2.0f);
239
                              mSta4.set(mInter[2]/100.0f,
240 06c636a5 Leszek Koltunski
                                        mInter[3]/100.0f,
241 678c391d Leszek Koltunski
                                        mInter[4]/100.0f,
242
                                        mInter[5]/100.0f );
243 06c636a5 Leszek Koltunski
                              break;
244 cef5d326 Leszek Koltunski
      case BORDER           : mSta1.set(mInter[0]/2.0f);
245
                              mSta4.set(mInter[1]/100.0f,
246
                                        mInter[2]/100.0f,
247
                                        mInter[3]/100.0f,
248
                                        mInter[4]/100.0f );
249
                              break;
250 8fd9f5fa Leszek Koltunski
      }
251
    }
252
253
///////////////////////////////////////////////////////////////////////////////////////////////////
254
255
  private void setDefaultInter()
256
    {
257 c11a3a15 Leszek Koltunski
    switch(mDimension)
258 8fd9f5fa Leszek Koltunski
      {
259 678c391d Leszek Koltunski
      case 6: mInter[5] = 50;
260 c11a3a15 Leszek Koltunski
      case 5: mInter[4] = 50;
261
      case 4: mInter[3] = 50;
262
      case 3: mInter[2] = 50;
263
      case 2: mInter[1] = 50;
264
      case 1: mInter[0] = 50;
265 8fd9f5fa Leszek Koltunski
      }
266 334c13fa Leszek Koltunski
267 4282d39a Leszek Koltunski
    if( mName==EffectName.ROTATE         ||
268 ad98c3cb Leszek Koltunski
        mName==EffectName.VERTEX_ROTATE   )
269
      {
270
      mInter[1]= 100;
271
      }
272
    if( mName==EffectName.QUATERNION     ||
273 4282d39a Leszek Koltunski
        mName==EffectName.VERTEX_QUATERNION )
274
      {
275
      mInter[0]= 100;
276
      }
277 8fd9f5fa Leszek Koltunski
    }
278
279
///////////////////////////////////////////////////////////////////////////////////////////////////
280
281
  private void setText()
282
    {
283
    String text = mName.name();
284
285 f4e44230 Leszek Koltunski
    if( mSta1 !=null )
286 76a81b6a Leszek Koltunski
      {
287 bcbd5b45 Leszek Koltunski
      float f1 = ((int)(mSta1.get0()*100))/100.0f;
288 f4e44230 Leszek Koltunski
      text += " "+f1;
289 76a81b6a Leszek Koltunski
      }
290
291 c11a3a15 Leszek Koltunski
    if( mSta2 !=null )
292
      {
293 bcbd5b45 Leszek Koltunski
      float f1 = ((int)(mSta2.get0()*100))/100.0f;
294
      float f2 = ((int)(mSta2.get1()*100))/100.0f;
295 c11a3a15 Leszek Koltunski
      text += " ("+f1+","+f2+")";
296
      }
297
298 f4e44230 Leszek Koltunski
    if( mSta3 !=null )
299 8fd9f5fa Leszek Koltunski
      {
300 bcbd5b45 Leszek Koltunski
      float f1 = ((int)(mSta3.get0()*100))/100.0f;
301
      float f2 = ((int)(mSta3.get1()*100))/100.0f;
302
      float f3 = ((int)(mSta3.get2()*100))/100.0f;
303 8fd9f5fa Leszek Koltunski
      text += " ("+f1+","+f2+","+f3+")";
304
      }
305 f4e44230 Leszek Koltunski
306 334c13fa Leszek Koltunski
    if( mSta4 !=null )
307
      {
308 bcbd5b45 Leszek Koltunski
      float f1 = ((int)(mSta4.get0()*100))/100.0f;
309
      float f2 = ((int)(mSta4.get1()*100))/100.0f;
310
      float f3 = ((int)(mSta4.get2()*100))/100.0f;
311
      float f4 = ((int)(mSta4.get3()*100))/100.0f;
312 334c13fa Leszek Koltunski
      text += " ("+f1+","+f2+","+f3+","+f4+")";
313
      }
314
315 2f2f6176 Leszek Koltunski
    if( mSta5 !=null )
316 8fd9f5fa Leszek Koltunski
      {
317 bcbd5b45 Leszek Koltunski
      float f1 = ((int)(mSta5.get0()*100))/100.0f;
318
      float f2 = ((int)(mSta5.get1()*100))/100.0f;
319
      float f3 = ((int)(mSta5.get2()*100))/100.0f;
320
      float f4 = ((int)(mSta5.get3()*100))/100.0f;
321
      float f5 = ((int)(mSta5.get4()*100))/100.0f;
322 2f2f6176 Leszek Koltunski
      text += " ("+f1+","+f2+","+f3+","+f4+","+f5+")";
323 8fd9f5fa Leszek Koltunski
      }
324
325
    mText.setText(text);
326
    }
327
328 56cbe1cf Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
329
330
  private void fillCenterStatics()
331
    {
332 46b26cdc Leszek Koltunski
    GenericActivity2 act = mAct.get();
333 fce25d04 leszek
334 529054e9 Leszek Koltunski
    float x = (mInterCenter[0]*0.012f - 0.6f)*act.getWidth();
335
    float y = (mInterCenter[1]*0.012f - 0.6f)*act.getHeight();
336
    float z = (mInterCenter[2]*0.012f - 0.6f)*act.getDepth();
337 334c13fa Leszek Koltunski
338 fc286c71 Leszek Koltunski
    if( mName.getType() == EffectType.MATRIX )
339
      {
340
      float factor = act.getScaleFactor();
341
      x *= factor;
342
      y *= factor;
343
      z *= factor;
344
      }
345
346 334c13fa Leszek Koltunski
    mCenterSta.set(x,y,z);
347 56cbe1cf Leszek Koltunski
    }
348
349
///////////////////////////////////////////////////////////////////////////////////////////////////
350
351
  private void setDefaultCenterInter()
352
    {
353
    mInterCenter[0] = 50;
354
    mInterCenter[1] = 50;
355 334c13fa Leszek Koltunski
    mInterCenter[2] = 50;
356 56cbe1cf Leszek Koltunski
    }
357
358
///////////////////////////////////////////////////////////////////////////////////////////////////
359
360
  private void setCenterText()
361
    {
362 bcbd5b45 Leszek Koltunski
    float f0 = ((int)(mCenterSta.get0()*100))/100.0f;
363
    float f1 = ((int)(mCenterSta.get1()*100))/100.0f;
364
    float f2 = ((int)(mCenterSta.get2()*100))/100.0f;
365 56cbe1cf Leszek Koltunski
366 334c13fa Leszek Koltunski
    mTextCenter.setText("center ("+f0+","+f1+","+f2+")");
367 56cbe1cf Leszek Koltunski
    }
368
369
///////////////////////////////////////////////////////////////////////////////////////////////////
370
371
  private void fillRegionStatics()
372
    {
373 46b26cdc Leszek Koltunski
    GenericActivity2 act = mAct.get();
374 56cbe1cf Leszek Koltunski
375
    float factorX = act.getWidth() / 100.0f;
376
    float factorY = act.getHeight()/ 100.0f;
377 529054e9 Leszek Koltunski
 // float factorZ = act.getDepth() / 100.0f;
378 56cbe1cf Leszek Koltunski
379 a418b421 Leszek Koltunski
    int deduct = (mName.getType() == EffectType.VERTEX ? 50:0);
380 76a81b6a Leszek Koltunski
381 9e7b6dbd Leszek Koltunski
    float x = (mInterRegion[0]-deduct)*factorX;
382
    float y = (mInterRegion[1]-deduct)*factorY;
383
    float z = (mInterRegion[2]-deduct)*factorX;   // ??
384
    float r =  mInterRegion[3]        *(factorX+factorY)/2;
385 56cbe1cf Leszek Koltunski
386 1585ba24 Leszek Koltunski
    mRegion4Sta.set(x,y,z,r);
387
    mRegion3Sta.set(x,y,z);
388 56cbe1cf Leszek Koltunski
    }
389
390
///////////////////////////////////////////////////////////////////////////////////////////////////
391
392
  private void setDefaultRegionInter()
393
    {
394
    mInterRegion[0] = 50;
395
    mInterRegion[1] = 50;
396
    mInterRegion[2] = 50;
397
    mInterRegion[3] = 50;
398
    }
399
400
///////////////////////////////////////////////////////////////////////////////////////////////////
401
402
  private void setRegionText()
403
    {
404 1585ba24 Leszek Koltunski
    if( mRegionDimension==4 )
405
      {
406 bcbd5b45 Leszek Koltunski
      float f0 = ((int)(mRegion4Sta.get0()*100))/100.0f;
407
      float f1 = ((int)(mRegion4Sta.get1()*100))/100.0f;
408
      float f2 = ((int)(mRegion4Sta.get2()*100))/100.0f;
409
      float f3 = ((int)(mRegion4Sta.get3()*100))/100.0f;
410 1585ba24 Leszek Koltunski
411
      mTextRegion.setText("region (" + f0 + "," + f1 + "," + f2 + "," + f3 + ")");
412
      }
413 56cbe1cf Leszek Koltunski
414 1585ba24 Leszek Koltunski
    if( mRegionDimension==3 )
415
      {
416 bcbd5b45 Leszek Koltunski
      float f0 = ((int)(mRegion4Sta.get0()*100))/100.0f;
417
      float f1 = ((int)(mRegion4Sta.get1()*100))/100.0f;
418
      float f2 = ((int)(mRegion4Sta.get2()*100))/100.0f;
419 1585ba24 Leszek Koltunski
420
      mTextRegion.setText("region (" + f0 + "," + f1 + "," + f2 + ")");
421
      }
422 56cbe1cf Leszek Koltunski
    }
423
424 fc286c71 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
425
426
  private void setCenter(GenericActivity2 act)
427
    {
428
    float factor = ( mName.getType() == EffectType.MATRIX ? act.getScaleFactor() : 1.0f);
429
    act.setCenter( mCenterSta.get0()/factor, mCenterSta.get1()/factor, mCenterSta.get2()/factor );
430
    }
431
432 3b1e9c7e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
433
434
  void setBackground(int pos)
435
    {
436
    int color = (pos%2==1 ? BACKGROUND_ODD:BACKGROUND_EVEN);
437
438
    if( mEffect!=null ) mEffect.setBackgroundColor(color);
439
    if( mCenter!=null ) mCenter.setBackgroundColor(color);
440
    if( mRegion!=null ) mRegion.setBackgroundColor(color);
441
    }
442
443 56cbe1cf Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
444
445 46b26cdc Leszek Koltunski
  GenericEffect(EffectName name, GenericActivity2 act)
446 56cbe1cf Leszek Koltunski
    {
447
    mAct = new WeakReference<>(act);
448
    mName = name;
449
450 f4e44230 Leszek Koltunski
    mDyn1 = null;
451 c11a3a15 Leszek Koltunski
    mDyn2 = null;
452 f4e44230 Leszek Koltunski
    mDyn3 = null;
453 334c13fa Leszek Koltunski
    mDyn4 = null;
454 2f2f6176 Leszek Koltunski
    mDyn5 = null;
455 f4e44230 Leszek Koltunski
    mSta1 = null;
456 c11a3a15 Leszek Koltunski
    mSta2 = null;
457 f4e44230 Leszek Koltunski
    mSta3 = null;
458 334c13fa Leszek Koltunski
    mSta4 = null;
459 2f2f6176 Leszek Koltunski
    mSta5 = null;
460 f4e44230 Leszek Koltunski
461 1585ba24 Leszek Koltunski
    mDimension = mName.getEffectDimension();
462
    mRegionDimension = mName.getRegionDimension();
463 8fd9f5fa Leszek Koltunski
464 76a81b6a Leszek Koltunski
    switch(mDimension)
465 8fd9f5fa Leszek Koltunski
      {
466 8bf89617 Leszek Koltunski
      case 0 : break;
467 76a81b6a Leszek Koltunski
      case 1 : mDyn1 = new Dynamic1D();
468
               mSta1 = new Static1D(0);
469
               mDyn1.add(mSta1);
470
               break;
471 c11a3a15 Leszek Koltunski
      case 2 : mDyn2 = new Dynamic2D();
472
               mSta2 = new Static2D(0,0);
473
               mDyn2.add(mSta2);
474
               break;
475 76a81b6a Leszek Koltunski
      case 3 : mDyn3 = new Dynamic3D();
476
               mSta3 = new Static3D(0,0,0);
477
               mDyn3.add(mSta3);
478
               break;
479 4282d39a Leszek Koltunski
      case 4 : if( mName == EffectName.QUATERNION || mName == EffectName.VERTEX_QUATERNION )
480 334c13fa Leszek Koltunski
                 {
481
                 mDyn4 = new Dynamic4D();
482
                 mSta4 = new Static4D(0,0,0,0);
483
                 mDyn4.add(mSta4);
484
                 }
485
               else
486
                 {
487
                 mDyn3 = new Dynamic3D();
488
                 mSta3 = new Static3D(0,0,0);
489
                 mDyn3.add(mSta3);
490
                 mDyn1 = new Dynamic1D();
491
                 mSta1 = new Static1D(0);
492
                 mDyn1.add(mSta1);
493
                 }
494 2f2f6176 Leszek Koltunski
               break;
495 06c636a5 Leszek Koltunski
      case 5 : if( mName == EffectName.WAVE )
496
                 {
497
                 mDyn5 = new Dynamic5D();
498
                 mSta5 = new Static5D(0, 0, 0, 0, 0);
499
                 mDyn5.add(mSta5);
500
                 }
501
               else
502
                 {
503
                 mDyn4 = new Dynamic4D();
504
                 mSta4 = new Static4D(0,0,0,0);
505
                 mDyn4.add(mSta4);
506
                 mDyn1 = new Dynamic1D();
507
                 mSta1 = new Static1D(0);
508
                 mDyn1.add(mSta1);
509
                 }
510 76a81b6a Leszek Koltunski
               break;
511 678c391d Leszek Koltunski
      case 6 : mDyn2 = new Dynamic2D();
512
               mSta2 = new Static2D(0,0);
513
               mDyn2.add(mSta2);
514
               mDyn4 = new Dynamic4D();
515
               mSta4 = new Static4D(0,0,0,0);
516
               mDyn4.add(mSta4);
517
               break;
518 76a81b6a Leszek Koltunski
      default: throw new RuntimeException("unsupported effect");
519 8fd9f5fa Leszek Koltunski
      }
520 56cbe1cf Leszek Koltunski
521 8bf89617 Leszek Koltunski
    if( mDimension>0 )
522
      {
523
      mInter = new int[mDimension];
524
      mSeekID= new int[mDimension];
525
526
      mInterRegion = new int[4];
527
      mSeekRegionID= new int[4];
528
      mRegion4Dyn  = new Dynamic4D();
529
      mRegion4Sta  = new Static4D(0,0,0,0);
530
      mRegion4Dyn.add(mRegion4Sta);
531
      mRegion3Dyn  = new Dynamic3D();
532
      mRegion3Sta  = new Static3D(0,0,0);
533
      mRegion3Dyn.add(mRegion3Sta);
534
535
      mInterCenter = new int[3];
536
      mSeekCenterID= new int[3];
537
      mCenterDyn   = new Dynamic3D();
538
      mCenterSta   = new Static3D(0,0,0);
539
      mCenterDyn.add(mCenterSta);
540
      }
541 fed00329 Leszek Koltunski
542
    mButton = null;
543
    mEffect = null;
544
    mCenter = null;
545
    mRegion = null;
546 56cbe1cf Leszek Koltunski
    }
547
548
///////////////////////////////////////////////////////////////////////////////////////////////////
549
550 3b1e9c7e Leszek Koltunski
  View createView(int num)
551 56cbe1cf Leszek Koltunski
    {
552 8bf89617 Leszek Koltunski
    SeekBar[] seek = null;
553
554
    if( mDimension>0 )
555
      {
556
      seek = new SeekBar[mDimension];
557
      }
558 56cbe1cf Leszek Koltunski
559 46b26cdc Leszek Koltunski
    GenericActivity2 act = mAct.get();
560 56cbe1cf Leszek Koltunski
561
    switch(mDimension)
562
      {
563 8bf89617 Leszek Koltunski
      case 0 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect0d, null);
564
               mText      = mEffect.findViewById(R.id.effect0dText);
565
               mButton    = mEffect.findViewById(R.id.button0dRemove);
566
               setText();
567
               break;
568 fed00329 Leszek Koltunski
      case 1 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect1d, null);
569 fe7fe83e Leszek Koltunski
               mText      = mEffect.findViewById(R.id.effect1dText);
570
               seek[0]    = mEffect.findViewById(R.id.effect1dbar1);
571 56cbe1cf Leszek Koltunski
               mSeekID[0] = seek[0].getId();
572 fed00329 Leszek Koltunski
               mButton    = mEffect.findViewById(R.id.button1dRemove);
573 56cbe1cf Leszek Koltunski
               break;
574 fed00329 Leszek Koltunski
      case 2 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect2d, null);
575 fe7fe83e Leszek Koltunski
               mText      = mEffect.findViewById(R.id.effect2dText);
576
               seek[0]    = mEffect.findViewById(R.id.effect2dbar1);
577
               seek[1]    = mEffect.findViewById(R.id.effect2dbar2);
578 56cbe1cf Leszek Koltunski
               mSeekID[0] = seek[0].getId();
579
               mSeekID[1] = seek[1].getId();
580 fed00329 Leszek Koltunski
               mButton    = mEffect.findViewById(R.id.button2dRemove);
581 56cbe1cf Leszek Koltunski
               break;
582 fed00329 Leszek Koltunski
      case 3 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect3d, null);
583 fe7fe83e Leszek Koltunski
               mText      = mEffect.findViewById(R.id.effect3dText);
584
               seek[0]    = mEffect.findViewById(R.id.effect3dbar1);
585
               seek[1]    = mEffect.findViewById(R.id.effect3dbar2);
586
               seek[2]    = mEffect.findViewById(R.id.effect3dbar3);
587 56cbe1cf Leszek Koltunski
               mSeekID[0] = seek[0].getId();
588
               mSeekID[1] = seek[1].getId();
589
               mSeekID[2] = seek[2].getId();
590 fed00329 Leszek Koltunski
               mButton    = mEffect.findViewById(R.id.button3dRemove);
591 56cbe1cf Leszek Koltunski
               break;
592 fed00329 Leszek Koltunski
      case 4 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect4d, null);
593 fe7fe83e Leszek Koltunski
               mText      = mEffect.findViewById(R.id.effect4dText);
594
               seek[0]    = mEffect.findViewById(R.id.effect4dbar1);
595
               seek[1]    = mEffect.findViewById(R.id.effect4dbar2);
596
               seek[2]    = mEffect.findViewById(R.id.effect4dbar3);
597
               seek[3]    = mEffect.findViewById(R.id.effect4dbar4);
598 56cbe1cf Leszek Koltunski
               mSeekID[0] = seek[0].getId();
599
               mSeekID[1] = seek[1].getId();
600
               mSeekID[2] = seek[2].getId();
601
               mSeekID[3] = seek[3].getId();
602 fed00329 Leszek Koltunski
               mButton    = mEffect.findViewById(R.id.button4dRemove);
603 56cbe1cf Leszek Koltunski
               break;
604 fed00329 Leszek Koltunski
      case 5 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect5d, null);
605 fe7fe83e Leszek Koltunski
               mText      = mEffect.findViewById(R.id.effect5dText);
606
               seek[0]    = mEffect.findViewById(R.id.effect5dbar1);
607
               seek[1]    = mEffect.findViewById(R.id.effect5dbar2);
608
               seek[2]    = mEffect.findViewById(R.id.effect5dbar3);
609
               seek[3]    = mEffect.findViewById(R.id.effect5dbar4);
610
               seek[4]    = mEffect.findViewById(R.id.effect5dbar5);
611 2f2f6176 Leszek Koltunski
               mSeekID[0] = seek[0].getId();
612
               mSeekID[1] = seek[1].getId();
613
               mSeekID[2] = seek[2].getId();
614
               mSeekID[3] = seek[3].getId();
615
               mSeekID[4] = seek[4].getId();
616 fed00329 Leszek Koltunski
               mButton    = mEffect.findViewById(R.id.button5dRemove);
617 2f2f6176 Leszek Koltunski
               break;
618 678c391d Leszek Koltunski
      case 6 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect6d, null);
619
               mText      = mEffect.findViewById(R.id.effect6dText);
620
               seek[0]    = mEffect.findViewById(R.id.effect6dbar1);
621
               seek[1]    = mEffect.findViewById(R.id.effect6dbar2);
622
               seek[2]    = mEffect.findViewById(R.id.effect6dbar3);
623
               seek[3]    = mEffect.findViewById(R.id.effect6dbar4);
624
               seek[4]    = mEffect.findViewById(R.id.effect6dbar5);
625
               seek[5]    = mEffect.findViewById(R.id.effect6dbar6);
626
               mSeekID[0] = seek[0].getId();
627
               mSeekID[1] = seek[1].getId();
628
               mSeekID[2] = seek[2].getId();
629
               mSeekID[3] = seek[3].getId();
630
               mSeekID[4] = seek[4].getId();
631
               mSeekID[5] = seek[5].getId();
632
               mButton    = mEffect.findViewById(R.id.button6dRemove);
633
               break;
634 46b26cdc Leszek Koltunski
      default: android.util.Log.e("GenericEffect", "dimension "+mDimension+" not supported!");
635 56cbe1cf Leszek Koltunski
               return null;
636
      }
637
638 3b1e9c7e Leszek Koltunski
    mEffect.setBackgroundColor( num%2==1 ? BACKGROUND_EVEN: BACKGROUND_ODD );
639
640 56cbe1cf Leszek Koltunski
    setDefaultInter();
641
642
    for(int i=0; i<mDimension; i++)
643
      {
644
      seek[i].setOnSeekBarChangeListener(this);
645
      seek[i].setProgress( mInter[i] );
646
      }
647
648 fed00329 Leszek Koltunski
    return mEffect;
649 56cbe1cf Leszek Koltunski
    }
650
651
///////////////////////////////////////////////////////////////////////////////////////////////////
652
653 3b1e9c7e Leszek Koltunski
  View createRegion(int num)
654 56cbe1cf Leszek Koltunski
    {
655 46b26cdc Leszek Koltunski
    GenericActivity2 act = mAct.get();
656 56cbe1cf Leszek Koltunski
657 1585ba24 Leszek Koltunski
    if( mRegionDimension== 4 )
658
      {
659
      mRegion = act.getLayoutInflater().inflate(R.layout.effectregion4, null);
660
      mRegion.setBackgroundColor(num % 2 == 1 ? BACKGROUND_EVEN : BACKGROUND_ODD);
661 56cbe1cf Leszek Koltunski
662 1585ba24 Leszek Koltunski
      SeekBar[] seek = new SeekBar[4];
663 56cbe1cf Leszek Koltunski
664 1585ba24 Leszek Koltunski
      seek[0] = mRegion.findViewById(R.id.effectRegion4BarX);
665
      seek[1] = mRegion.findViewById(R.id.effectRegion4BarY);
666
      seek[2] = mRegion.findViewById(R.id.effectRegion4BarZ);
667
      seek[3] = mRegion.findViewById(R.id.effectRegion4BarR);
668 56cbe1cf Leszek Koltunski
669 1585ba24 Leszek Koltunski
      mSeekRegionID[0] = seek[0].getId();
670
      mSeekRegionID[1] = seek[1].getId();
671
      mSeekRegionID[2] = seek[2].getId();
672
      mSeekRegionID[3] = seek[3].getId();
673 56cbe1cf Leszek Koltunski
674 1585ba24 Leszek Koltunski
      mTextRegion = mRegion.findViewById(R.id.effectRegion4Text);
675 56cbe1cf Leszek Koltunski
676 1585ba24 Leszek Koltunski
      setDefaultRegionInter();
677 56cbe1cf Leszek Koltunski
678 1585ba24 Leszek Koltunski
      for (int i = 0; i < 4; i++)
679
        {
680
        seek[i].setOnSeekBarChangeListener(this);
681
        seek[i].setProgress(mInterRegion[i]);
682
        }
683
684 1e7603bb Leszek Koltunski
      act.setRegion(mRegion4Sta);
685 56cbe1cf Leszek Koltunski
      }
686 1585ba24 Leszek Koltunski
    else
687
      {
688
      mRegion = act.getLayoutInflater().inflate(R.layout.effectregion3, null);
689
      mRegion.setBackgroundColor(num % 2 == 1 ? BACKGROUND_EVEN : BACKGROUND_ODD);
690
691
      SeekBar[] seek = new SeekBar[3];
692
693
      seek[0] = mRegion.findViewById(R.id.effectRegion3BarRX);
694
      seek[1] = mRegion.findViewById(R.id.effectRegion3BarRY);
695
      seek[2] = mRegion.findViewById(R.id.effectRegion3BarRZ);
696
697
      mSeekRegionID[0] = seek[0].getId();
698
      mSeekRegionID[1] = seek[1].getId();
699
      mSeekRegionID[2] = seek[2].getId();
700
701
      mTextRegion = mRegion.findViewById(R.id.effectRegion3Text);
702 56cbe1cf Leszek Koltunski
703 1585ba24 Leszek Koltunski
      setDefaultRegionInter();
704
705
      for (int i = 0; i < 3; i++)
706
        {
707
        seek[i].setOnSeekBarChangeListener(this);
708
        seek[i].setProgress(mInterRegion[i]);
709
        }
710
711 bcbd5b45 Leszek Koltunski
      act.setRegion( new Static4D( mRegion3Sta.get0(), mRegion3Sta.get1(), mRegion3Sta.get2(), 1.0f) );
712 1585ba24 Leszek Koltunski
      }
713 24991bc2 Leszek Koltunski
714 fed00329 Leszek Koltunski
    return mRegion;
715 56cbe1cf Leszek Koltunski
    }
716
717
///////////////////////////////////////////////////////////////////////////////////////////////////
718
719 3b1e9c7e Leszek Koltunski
  View createCenter(int num)
720 56cbe1cf Leszek Koltunski
    {
721 46b26cdc Leszek Koltunski
    GenericActivity2 act = mAct.get();
722 56cbe1cf Leszek Koltunski
723 fed00329 Leszek Koltunski
    mCenter = act.getLayoutInflater().inflate(R.layout.effectcenter, null);
724 3b1e9c7e Leszek Koltunski
    mCenter.setBackgroundColor( num%2==1 ? BACKGROUND_EVEN: BACKGROUND_ODD );
725 56cbe1cf Leszek Koltunski
726 334c13fa Leszek Koltunski
    SeekBar[] seek = new SeekBar[3];
727 56cbe1cf Leszek Koltunski
728 fe7fe83e Leszek Koltunski
    seek[0] = mCenter.findViewById(R.id.effectCenterBarX );
729
    seek[1] = mCenter.findViewById(R.id.effectCenterBarY );
730
    seek[2] = mCenter.findViewById(R.id.effectCenterBarZ );
731 56cbe1cf Leszek Koltunski
732
    mSeekCenterID[0] = seek[0].getId();
733
    mSeekCenterID[1] = seek[1].getId();
734 334c13fa Leszek Koltunski
    mSeekCenterID[2] = seek[2].getId();
735 56cbe1cf Leszek Koltunski
736 fe7fe83e Leszek Koltunski
    mTextCenter = mCenter.findViewById(R.id.effectCenterText);
737 56cbe1cf Leszek Koltunski
738
    setDefaultCenterInter();
739
740 334c13fa Leszek Koltunski
    for(int i=0; i<3; i++)
741 56cbe1cf Leszek Koltunski
      {
742
      seek[i].setOnSeekBarChangeListener(this);
743
      seek[i].setProgress( mInterCenter[i] );
744
      }
745
746 fc286c71 Leszek Koltunski
    setCenter(act);
747 24991bc2 Leszek Koltunski
748 fed00329 Leszek Koltunski
    return mCenter;
749 56cbe1cf Leszek Koltunski
    }
750
751
///////////////////////////////////////////////////////////////////////////////////////////////////
752
753
  public void onProgressChanged(SeekBar bar, int progress, boolean fromUser)
754
    {
755 4282d39a Leszek Koltunski
    boolean vectorChanged=false;
756
    boolean regionChanged=false;
757
    boolean centerChanged=false;
758
759 678c391d Leszek Koltunski
    for(int dim=0; dim<6; dim++)
760 56cbe1cf Leszek Koltunski
      {
761 4282d39a Leszek Koltunski
      if ( mDimension>dim && bar.getId()==mSeekID[dim] )
762
        {
763
        mInter[dim] = progress;
764
        vectorChanged = true;
765
        }
766 56cbe1cf Leszek Koltunski
      }
767 4282d39a Leszek Koltunski
768
    if( vectorChanged )
769 2f2f6176 Leszek Koltunski
      {
770
      fillStatics();
771
      setText();
772
      }
773 56cbe1cf Leszek Koltunski
774 4282d39a Leszek Koltunski
    for(int reg=0; reg<4; reg++)
775 56cbe1cf Leszek Koltunski
      {
776 4282d39a Leszek Koltunski
      if( mRegionDimension>reg && bar.getId() == mSeekRegionID[reg] )
777
        {
778
        mInterRegion[reg] = progress;
779
        regionChanged = true;
780
        }
781 56cbe1cf Leszek Koltunski
      }
782 4282d39a Leszek Koltunski
783
    if( regionChanged )
784 56cbe1cf Leszek Koltunski
      {
785
      fillRegionStatics();
786
      setRegionText();
787
      }
788
789 4282d39a Leszek Koltunski
    for(int cen=0; cen<3; cen++)
790 56cbe1cf Leszek Koltunski
      {
791 4282d39a Leszek Koltunski
      if( bar.getId() == mSeekCenterID[cen] )
792
        {
793
        mInterCenter[cen] = progress;
794
        centerChanged = true;
795
        }
796 56cbe1cf Leszek Koltunski
      }
797 4282d39a Leszek Koltunski
798
    if( centerChanged )
799 334c13fa Leszek Koltunski
      {
800
      fillCenterStatics();
801
      setCenterText();
802
      }
803 24991bc2 Leszek Koltunski
804
    if( fromUser )
805
      {
806 46b26cdc Leszek Koltunski
      GenericActivity2 act = mAct.get();
807 fc286c71 Leszek Koltunski
      setCenter(act);
808 1e7603bb Leszek Koltunski
      act.setRegion(mRegion4Sta);
809 24991bc2 Leszek Koltunski
      }
810 56cbe1cf Leszek Koltunski
    }
811
812 fa9053f5 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
813
814 6f3024ae Leszek Koltunski
  boolean thisView(View v)
815 fa9053f5 Leszek Koltunski
    {
816
    return v==mButton;
817
    }
818
819 fed00329 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
820
821
  public long getId()
822
    {
823
    return mId;
824
    }
825
826 d28ddc9b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
827
828
  public int getDimension()
829
    {
830
    return mDimension;
831
    }
832
833 fed00329 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
834
835
  public View getEffect()
836
    {
837
    return mEffect;
838
    }
839
840
///////////////////////////////////////////////////////////////////////////////////////////////////
841
842
  public View getRegion()
843
    {
844
    return mRegion;
845
    }
846
847
///////////////////////////////////////////////////////////////////////////////////////////////////
848
849
  public View getCenter()
850
    {
851
    return mCenter;
852
    }
853
854 56cbe1cf Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
855
856
  public void onStartTrackingTouch(SeekBar bar) { }
857
858
///////////////////////////////////////////////////////////////////////////////////////////////////
859
860
  public void onStopTrackingTouch(SeekBar bar)  { }
861
  }