Revision ffbf279e
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/DistortedBitmap.java | ||
---|---|---|
51 | 51 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
52 | 52 |
/** |
53 | 53 |
* Default constructor: creates a DistortedBitmap (width,height) pixels in size, with the distortion |
54 |
* grid of size 'size' and does not fill it up with any Bitmap data just yet.
|
|
54 |
* grid of 'cols' and does not fill it up with any Bitmap data just yet.
|
|
55 | 55 |
* <p> |
56 | 56 |
* Distortion grid is a grid of rectangles the Bitmap is split to. The vertices of this grid are then |
57 | 57 |
* moved around by the Vertex Shader to create various Vertex Effects. |
... | ... | |
65 | 65 |
* |
66 | 66 |
* @param width width of the DistortedBitmap, in pixels. |
67 | 67 |
* @param height height of the DistortedBitmap, in pixels. |
68 |
* @param gridSize Horizontal size of the distortion grid. 2<=size<256. |
|
68 |
* @param cols Number of columns in the distortion grid. 2<=size<256. |
|
69 |
* Number of rows gets calculated with 'rows = cols*height/width'. |
|
69 | 70 |
*/ |
70 |
public DistortedBitmap(int width, int height, int gridSize)
|
|
71 |
public DistortedBitmap(int width, int height, int cols)
|
|
71 | 72 |
{ |
72 |
int xsize = gridSize;
|
|
73 |
int ysize = xsize*height/width;
|
|
73 |
int xsize = cols;
|
|
74 |
int ysize = cols*height/width;
|
|
74 | 75 |
|
75 | 76 |
if( xsize<2 ) xsize= 2; |
76 | 77 |
if( xsize>256 ) xsize=256; |
... | ... | |
79 | 80 |
|
80 | 81 |
mSizeX= width; |
81 | 82 |
mSizeY= height; |
82 |
mSizeZ= 1;
|
|
83 |
mSizeZ= 1; |
|
83 | 84 |
mGrid = new DistortedBitmapGrid(xsize,ysize); |
84 |
initializeData(gridSize);
|
|
85 |
initializeData(); |
|
85 | 86 |
} |
86 | 87 |
|
87 | 88 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
revert latest changes to the fragment shader.
small things in DistortedObjects.