Project

General

Profile

« Previous | Next » 

Revision 8dfa45c4

Added by Leszek Koltunski almost 7 years ago

Some progress with Effect classes.

10 apps compile now.

View differences:

src/main/java/org/distorted/examples/effectqueue/EffectQueueSurfaceView.java
24 24
import android.view.MotionEvent;
25 25
import android.util.AttributeSet;
26 26

  
27
import org.distorted.library.EffectNames;
28
import org.distorted.library.EffectTypes;
27
import org.distorted.library.effect.EffectName;
28
import org.distorted.library.effect.EffectType;
29
import org.distorted.library.effect.FragmentEffectAlpha;
30
import org.distorted.library.effect.FragmentEffectChroma;
31
import org.distorted.library.effect.FragmentEffectSaturation;
32
import org.distorted.library.effect.VertexEffectDistort;
33
import org.distorted.library.effect.VertexEffectSink;
29 34
import org.distorted.library.type.Dynamic1D;
30 35
import org.distorted.library.type.Static1D;
31 36
import org.distorted.library.type.Static3D;
......
123 128
    
124 129
  @Override public boolean onTouchEvent(MotionEvent event) 
125 130
    {
126
    int action = event.getAction();
127
    int x, y;
128
    long id;
131
    int x,y,action = event.getAction();
132
    boolean success;
129 133

  
130 134
    switch(action)
131 135
      {
......
137 141

  
138 142
                                    switch(mCurrentEffect)
139 143
                                      {
140
                                      case 0: id = mRenderer.getEffects().distort(mInterD, mPoint, mRegionV);
141
                                              act.effectAdded(id, EffectNames.DISTORT, EffectTypes.VERTEX);
144
                                      case 0: VertexEffectDistort distort = new VertexEffectDistort(mInterD, mPoint, mRegionV);
145
                                              success = mRenderer.getEffects().apply(distort);
146
                                              act.effectAdded(success,distort);
142 147
                                              break;
143
                                      case 1: id = mRenderer.getEffects().sink(mInterS, mPoint, mRegionV);
144
                                              act.effectAdded(id, EffectNames.SINK, EffectTypes.VERTEX);
148
                                      case 1: VertexEffectSink sink = new VertexEffectSink(mInterS, mPoint, mRegionV);
149
                                              success = mRenderer.getEffects().apply(sink);
150
                                              act.effectAdded(success,sink);
145 151
                                              break;
146
                                      case 2: id = mRenderer.getEffects().alpha(mInterA, mRegionF, true);
147
                                              act.effectAdded(id, EffectNames.ALPHA, EffectTypes.FRAGMENT);
152
                                      case 2: FragmentEffectAlpha alpha = new FragmentEffectAlpha(mInterA, mRegionF, true);
153
                                              success = mRenderer.getEffects().apply(alpha);
154
                                              act.effectAdded(success,alpha);
148 155
                                              break;
149
                                      case 3: id = mRenderer.getEffects().saturation(mInterB, mRegionF, false);
150
                                              act.effectAdded(id, EffectNames.SATURATION, EffectTypes.FRAGMENT);
156
                                      case 3: FragmentEffectSaturation saturation = new FragmentEffectSaturation(mInterB, mRegionF, false);
157
                                              success = mRenderer.getEffects().apply(saturation);
158
                                              act.effectAdded(success,saturation);
151 159
                                              break;
152
                                      case 4: id = mRenderer.getEffects().chroma(mInterC, mRED, mRegionF, true);
153
                                              act.effectAdded(id, EffectNames.CHROMA, EffectTypes.FRAGMENT);
160
                                      case 4: FragmentEffectChroma chroma = new FragmentEffectChroma(mInterC, mRED, mRegionF, true);
161
                                              success = mRenderer.getEffects().apply(chroma);
162
                                              act.effectAdded(success,chroma);
154 163
                                              break;
155 164
                                      }
156 165

  

Also available in: Unified diff