Revision b4a73ea5
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/examples/check/CheckRenderer.java | ||
---|---|---|
45 | 45 |
import android.graphics.BitmapFactory; |
46 | 46 |
import android.opengl.GLES20; |
47 | 47 |
import android.opengl.GLSurfaceView; |
48 |
import android.util.Log; |
|
48 | 49 |
|
49 | 50 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
50 | 51 |
|
51 | 52 |
class CheckRenderer implements GLSurfaceView.Renderer |
52 | 53 |
{ |
54 |
private static final String TAG = "CheckRenderer"; |
|
55 |
|
|
53 | 56 |
private GLSurfaceView mView; |
54 | 57 |
private DistortedBitmap mSuccess; |
55 | 58 |
private int bmpHeight, bmpWidth; |
... | ... | |
138 | 141 |
dSwirl.add(new Static2D( 0, bmpHeight/2)); |
139 | 142 |
dSwirl.add(new Static2D( bmpWidth, bmpHeight/2)); |
140 | 143 |
|
141 |
mSuccess.swirl( new Static1D(30), dSwirl, new Static4D( 0,0,40,40) ); |
|
144 |
long swirlEffectID = mSuccess.swirl( new Static1D(30), dSwirl, new Static4D( 0,0,40,40) ); |
|
145 |
|
|
146 |
if( swirlEffectID<0 ) |
|
147 |
{ |
|
148 |
Log.e(TAG, "Failed to add Swirl effect!"); |
|
149 |
} |
|
142 | 150 |
|
143 | 151 |
Dynamic3D dDeform = new Dynamic3D(2000,0.0f); |
144 | 152 |
dDeform.add(new Static3D( 0, 0,0)); |
145 | 153 |
dDeform.add(new Static3D( 0,-bmpHeight,0)); |
146 | 154 |
|
147 |
mSuccess.deform(dDeform, new Static2D(bmpWidth/2,0) ); |
|
155 |
long deformEffectID = mSuccess.deform(dDeform, new Static2D(bmpWidth/2,0) ); |
|
156 |
|
|
157 |
if( deformEffectID<0 ) |
|
158 |
{ |
|
159 |
Log.e(TAG, "Failed to add Deform effect!"); |
|
160 |
} |
|
148 | 161 |
|
149 | 162 |
// Now try adding 1 Fragment Effect. Likewise, will fail if maxFragmentEffects is <1. |
150 | 163 |
Static3D color = new Static3D(1,0,0); |
... | ... | |
152 | 165 |
inter.add(new Static1D(0)); |
153 | 166 |
inter.add(new Static1D(1)); |
154 | 167 |
|
155 |
mSuccess.chroma(inter, color); |
|
168 |
long chromaEffectID = mSuccess.chroma(inter, color); |
|
169 |
|
|
170 |
if( chromaEffectID<0 ) |
|
171 |
{ |
|
172 |
Log.e(TAG, "Failed to add Chroma effect!"); |
|
173 |
} |
|
156 | 174 |
|
157 | 175 |
try |
158 | 176 |
{ |
Also available in: Unified diff
Essentially revert the last commit :)