19 |
19 |
|
20 |
20 |
package org.distorted.examples.generic;
|
21 |
21 |
|
|
22 |
import java.lang.ref.WeakReference;
|
|
23 |
|
22 |
24 |
import android.view.View;
|
23 |
25 |
import android.widget.SeekBar;
|
24 |
26 |
import android.widget.TextView;
|
25 |
27 |
|
26 |
28 |
import org.distorted.examples.R;
|
27 |
|
import org.distorted.library.effect.Effect;
|
28 |
|
import org.distorted.library.effect.EffectName;
|
29 |
|
import org.distorted.library.effect.EffectType;
|
30 |
|
import org.distorted.library.effect.FragmentEffectAlpha;
|
31 |
|
import org.distorted.library.effect.FragmentEffectBrightness;
|
32 |
|
import org.distorted.library.effect.FragmentEffectChroma;
|
33 |
|
import org.distorted.library.effect.FragmentEffectContrast;
|
34 |
|
import org.distorted.library.effect.FragmentEffectSaturation;
|
35 |
|
import org.distorted.library.effect.MatrixEffectMove;
|
36 |
|
import org.distorted.library.effect.MatrixEffectQuaternion;
|
37 |
|
import org.distorted.library.effect.MatrixEffectRotate;
|
38 |
|
import org.distorted.library.effect.MatrixEffectScale;
|
39 |
|
import org.distorted.library.effect.MatrixEffectShear;
|
40 |
|
import org.distorted.library.effect.PostprocessEffectBlur;
|
41 |
|
import org.distorted.library.effect.PostprocessEffectGlow;
|
42 |
|
import org.distorted.library.effect.VertexEffectDeform;
|
43 |
|
import org.distorted.library.effect.VertexEffectDisappear;
|
44 |
|
import org.distorted.library.effect.VertexEffectDistort;
|
45 |
|
import org.distorted.library.effect.VertexEffectMove;
|
46 |
|
import org.distorted.library.effect.VertexEffectPinch;
|
47 |
|
import org.distorted.library.effect.VertexEffectQuaternion;
|
48 |
|
import org.distorted.library.effect.VertexEffectRotate;
|
49 |
|
import org.distorted.library.effect.VertexEffectScale;
|
50 |
|
import org.distorted.library.effect.VertexEffectShear;
|
51 |
|
import org.distorted.library.effect.VertexEffectSink;
|
52 |
|
import org.distorted.library.effect.VertexEffectSwirl;
|
53 |
|
import org.distorted.library.effect.VertexEffectWave;
|
|
29 |
import org.distorted.library.effect.*;
|
|
30 |
import org.distorted.library.type.*;
|
54 |
31 |
import org.distorted.library.main.DistortedEffects;
|
55 |
|
import org.distorted.library.type.Dynamic1D;
|
56 |
|
import org.distorted.library.type.Dynamic2D;
|
57 |
|
import org.distorted.library.type.Dynamic3D;
|
58 |
|
import org.distorted.library.type.Dynamic4D;
|
59 |
|
import org.distorted.library.type.Dynamic5D;
|
60 |
|
import org.distorted.library.type.Static1D;
|
61 |
|
import org.distorted.library.type.Static2D;
|
62 |
|
import org.distorted.library.type.Static3D;
|
63 |
|
import org.distorted.library.type.Static4D;
|
64 |
|
import org.distorted.library.type.Static5D;
|
65 |
|
|
66 |
|
import java.lang.ref.WeakReference;
|
67 |
32 |
|
68 |
33 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
69 |
34 |
|
... | ... | |
72 |
37 |
private static final int BACKGROUND_ODD = 0xff555555;
|
73 |
38 |
private static final int BACKGROUND_EVEN= 0xff333333;
|
74 |
39 |
|
75 |
|
private WeakReference<GenericActivity2> mAct;
|
|
40 |
private final WeakReference<GenericActivity2> mAct;
|
76 |
41 |
|
77 |
|
private EffectName mName;
|
|
42 |
private final EffectName mName;
|
78 |
43 |
private int[] mInter;
|
79 |
44 |
private int[] mInterRegion;
|
80 |
45 |
private int[] mInterCenter;
|
81 |
46 |
private int[] mSeekID;
|
82 |
47 |
private int[] mSeekRegionID;
|
83 |
48 |
private int[] mSeekCenterID;
|
84 |
|
private int mDimension, mRegionDimension;
|
|
49 |
private final int mDimension, mRegionDimension;
|
85 |
50 |
private TextView mText,mTextRegion,mTextCenter;
|
86 |
51 |
|
87 |
52 |
private Dynamic1D mDyn1;
|
... | ... | |
146 |
111 |
|
147 |
112 |
case BLUR : effect = new PostprocessEffectBlur (mDyn2 ); break;
|
148 |
113 |
case GLOW : effect = new PostprocessEffectGlow (mDyn2,mDyn4); break;
|
|
114 |
case BORDER : effect = new PostprocessEffectBorder (mDyn1,mDyn4); break;
|
149 |
115 |
}
|
150 |
116 |
|
151 |
|
if( effect!=null )
|
152 |
|
{
|
153 |
|
effects.apply(effect);
|
154 |
|
mId = effect.getID();
|
155 |
|
}
|
|
117 |
effects.apply(effect);
|
|
118 |
mId = effect.getID();
|
156 |
119 |
}
|
157 |
120 |
|
158 |
121 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
278 |
241 |
mInter[4]/100.0f,
|
279 |
242 |
mInter[5]/100.0f );
|
280 |
243 |
break;
|
|
244 |
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;
|
281 |
250 |
}
|
282 |
251 |
}
|
283 |
252 |
|
New BORDER effect.