Revision e8b6aa95
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/effects3d/Effects3DActivity.java | ||
---|---|---|
38 | 38 |
|
39 | 39 |
import org.distorted.examples.R; |
40 | 40 |
import org.distorted.library.Distorted; |
41 |
import org.distorted.library.DistortedBitmap; |
|
42 |
import org.distorted.library.DistortedCubes; |
|
41 |
import org.distorted.library.DistortedBitmapGrid; |
|
42 |
import org.distorted.library.DistortedCubesGrid; |
|
43 |
import org.distorted.library.DistortedObjectGrid; |
|
43 | 44 |
import org.distorted.library.DistortedObject; |
44 | 45 |
import org.distorted.library.EffectNames; |
45 | 46 |
import org.distorted.library.EffectTypes; |
... | ... | |
66 | 67 |
private NumberPicker mColsPicker, mRowsPicker; |
67 | 68 |
private boolean[] mShape; |
68 | 69 |
private DistortedObject mObject; |
70 |
private DistortedObjectGrid mGrid; |
|
69 | 71 |
private int mObjectType; |
70 | 72 |
private int mBitmapID; |
71 | 73 |
private Bitmap mBitmap; |
... | ... | |
220 | 222 |
return mObject; |
221 | 223 |
} |
222 | 224 |
|
225 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
226 |
|
|
227 |
public DistortedObjectGrid getGrid() |
|
228 |
{ |
|
229 |
return mGrid; |
|
230 |
} |
|
231 |
|
|
223 | 232 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
224 | 233 |
|
225 | 234 |
public static void setSupportsRegion(boolean supports) |
... | ... | |
388 | 397 |
if( mObjectType==1 ) |
389 | 398 |
{ |
390 | 399 |
getBitmap(); |
391 |
mObject = new DistortedBitmap(mBitmap.getWidth(),mBitmap.getHeight(),mNumCols); |
|
400 |
|
|
401 |
int w = mBitmap.getWidth(); |
|
402 |
int h = mBitmap.getHeight(); |
|
403 |
|
|
404 |
mObject = new DistortedObject(w,h,1); |
|
405 |
mGrid = new DistortedBitmapGrid(mNumCols,mNumCols*h/w); |
|
392 | 406 |
setEffectView(); |
393 | 407 |
} |
394 | 408 |
else |
... | ... | |
417 | 431 |
for(int i=0; i<mNumRows*mNumCols; i++) |
418 | 432 |
str += mShape[i] ? "1" : "0"; |
419 | 433 |
|
420 |
mObject = new DistortedCubes(mNumCols, str, 10); |
|
434 |
mObject = new DistortedObject(mNumCols,mNumRows,1); |
|
435 |
mGrid = new DistortedCubesGrid(mNumCols, str, false); |
|
421 | 436 |
|
422 | 437 |
setEffectView(); |
423 | 438 |
} |
Also available in: Unified diff
Major change in API: separate the GRID from DistortedObject; completely remove classes derived from DistortedObject.