JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
TileRenderer.java
Go to the documentation of this file.
1/**
2 * Copyright 2013 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 *
28 * ---------------------
29 *
30 * Based on Brian Paul's tile rendering library, found
31 * at <a href = "http://www.mesa3d.org/brianp/TR.html">http://www.mesa3d.org/brianp/TR.html</a>.
32 *
33 * Copyright (C) 1997-2005 Brian Paul.
34 * Licensed under BSD-compatible terms with permission of the author.
35 * See LICENSE.txt for license information.
36 */
37package com.jogamp.opengl.util;
38
39import com.jogamp.nativewindow.util.Dimension;
40import com.jogamp.nativewindow.util.DimensionImmutable;
41import com.jogamp.opengl.GL;
42import com.jogamp.opengl.GL2ES3;
43import com.jogamp.opengl.GLException;
44
45import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
46
47/**
48 * A fairly direct port of Brian Paul's tile rendering library, found
49 * at <a href = "http://www.mesa3d.org/brianp/TR.html">
50 * http://www.mesa3d.org/brianp/TR.html </a> . I've java-fied it, but
51 * the functionality is the same.
52 * <p>
53 * Original code Copyright (C) 1997-2005 Brian Paul. Licensed under
54 * BSD-compatible terms with permission of the author. See LICENSE.txt
55 * for license information.
56 * </p>
57 * <p>
58 * Enhanced for {@link GL2ES3}.
59 * </p>
60 * <p>
61 * See {@link TileRendererBase} for details.
62 * </p>
63 *
64 * @author ryanm, sgothel
65 */
66public class TileRenderer extends TileRendererBase {
67 /**
68 * The width of the final clipped image. See {@link #getParam(int)}.
69 */
70 public static final int TR_IMAGE_CLIPPING_WIDTH = 7;
71 /**
72 * The height of the final clipped image. See {@link #getParam(int)}.
73 */
74 public static final int TR_IMAGE_CLIPPING_HEIGHT = 8;
75 /**
76 * The width of the tiles. See {@link #getParam(int)}.
77 */
78 public static final int TR_TILE_WIDTH = 9;
79 /**
80 * The height of the tiles. See {@link #getParam(int)}.
81 */
82 public static final int TR_TILE_HEIGHT = 10;
83 /**
84 * The width of the border around the tiles. See {@link #getParam(int)}.
85 */
86 public static final int TR_TILE_BORDER = 11;
87 /**
88 * The tiles x-offset. See {@link #getParam(int)}.
89 */
90 public static final int TR_TILE_X_OFFSET = 12;
91 /**
92 * The tiles y-offset. See {@link #getParam(int)}.
93 */
94 public static final int TR_TILE_Y_OFFSET = 13;
95 /**
96 * The number of rows of tiles. See {@link #getParam(int)}.
97 */
98 public static final int TR_ROWS = 14;
99 /**
100 * The number of columns of tiles. See {@link #getParam(int)}.
101 */
102 public static final int TR_COLUMNS = 15;
103 /**
104 * The current tile number. Has value -1 if {@link #eot()}. See {@link #getParam(int)}.
105 */
106 public static final int TR_CURRENT_TILE_NUM = 16;
107 /**
108 * The current row number. See {@link #getParam(int)}.
109 */
110 public static final int TR_CURRENT_ROW = 17;
111 /**
112 * The current column number. See {@link #getParam(int)}.
113 */
114 public static final int TR_CURRENT_COLUMN = 18;
115 /**
116 * The order that the rows are traversed. See {@link #getParam(int)}.
117 */
118 public static final int TR_ROW_ORDER = 19;
119 /**
120 * Indicates we are traversing rows from the top to the bottom. See {@link #getParam(int)}.
121 */
122 public static final int TR_TOP_TO_BOTTOM = 20;
123 /**
124 * Indicates we are traversing rows from the bottom to the top (default). See {@link #getParam(int)}.
125 */
126 public static final int TR_BOTTOM_TO_TOP = 21;
127
128 private static final int DEFAULT_TILE_WIDTH = 256;
129 private static final int DEFAULT_TILE_HEIGHT = 256;
130 private static final int DEFAULT_TILE_BORDER = 0;
131
132 private final Dimension tileSize = new Dimension(DEFAULT_TILE_WIDTH, DEFAULT_TILE_HEIGHT);
133 private final Dimension tileSizeNB = new Dimension(DEFAULT_TILE_WIDTH - 2 * DEFAULT_TILE_BORDER, DEFAULT_TILE_HEIGHT - 2 * DEFAULT_TILE_BORDER);
134
135 private boolean isInit = false;
136 private Dimension imageClippingDim = null; // not set - default
137 private int tileBorder = DEFAULT_TILE_BORDER;
138 private int rowOrder = TR_BOTTOM_TO_TOP;
139 private int rows;
140 private int columns;
141 private int currentTile = 0;
142 private int currentRow;
143 private int currentColumn;
144 private int offsetX;
145 private int offsetY;
146
147 @Override
148 protected StringBuilder tileDetails(final StringBuilder sb) {
149 sb.append("# "+currentTile+": ["+currentColumn+"]["+currentRow+"] / "+columns+"x"+rows+", ")
150 .append("rowOrder "+rowOrder+", offset/size "+offsetX+"/"+offsetY+" "+tileSize.getWidth()+"x"+tileSize.getHeight()+" brd "+tileBorder+", ");
151 return super.tileDetails(sb);
152 }
153
154 /**
155 * Creates a new TileRenderer object
156 */
157 public TileRenderer() {
158 super();
159 }
160
161 /**
162 * {@inheritDoc}
163 * <p>
164 * Implementation {@link #reset()} internal states.
165 * </p>
166 */
167 @Override
168 public final void setImageSize(final int width, final int height) {
169 super.setImageSize(width, height);
170 reset();
171 }
172
173 /**
174 * Clips the image-size this tile-renderer iterates through,
175 * which can be retrieved via {@link #getClippedImageSize()}.
176 * <p>
177 * Original image-size stored in this tile-renderer is unmodified.
178 * </p>
179 * <p>
180 * Implementation {@link #reset()} internal states.
181 * </p>
182 *
183 * @param width The image-clipping.width
184 * @param height The image-clipping.height
185 * @see #getClippedImageSize()
186 */
187 public final void clipImageSize(final int width, final int height) {
188 if( null == imageClippingDim ) {
189 imageClippingDim = new Dimension(width, height);
190 } else {
191 imageClippingDim.set(width, height);
192 }
193 reset();
194 }
195
196 /**
197 * Returns the clipped image-size.
198 * <p>
199 * If a image-size is clipped via {@link #clipImageSize(int, int)},
200 * method returns:
201 * <ul>
202 * <li><code>min( image-clipping, image-size )</code>, otherwise</li>
203 * <li><code> image-size </code></li>
204 * </ul>
205 * </p>
206 * <p>
207 * The clipping width and height can be retrieved via {@link #TR_IMAGE_CLIPPING_WIDTH}
208 * {@link #TR_IMAGE_CLIPPING_HEIGHT}.
209 * </p>
210 */
212 if( null != imageClippingDim ) {
213 return new Dimension(Math.min(imageClippingDim.getWidth(), imageSize.getWidth()),
214 Math.min(imageClippingDim.getHeight(), imageSize.getHeight()) );
215 } else {
216 return imageSize;
217 }
218 }
219
220 /**
221 * Sets the size of the tiles to use in rendering. The actual
222 * effective size of the tile depends on the border size, ie (
223 * width - 2*border ) * ( height - 2 * border )
224 * <p>
225 * Implementation {@link #reset()} internal states.
226 * </p>
227 *
228 * @param width
229 * The width of the tiles. Must not be larger than the GL
230 * context
231 * @param height
232 * The height of the tiles. Must not be larger than the
233 * GL context
234 * @param border
235 * The width of the borders on each tile. This is needed
236 * to avoid artifacts when rendering lines or points with
237 * thickness > 1.
238 */
239 public final void setTileSize(final int width, final int height, final int border) {
240 if( 0 > border ) {
241 throw new IllegalArgumentException("Tile border must be >= 0");
242 }
243 if( 2 * border >= width || 2 * border >= height ) {
244 throw new IllegalArgumentException("Tile size must be > 0x0 minus 2*border");
245 }
246 tileBorder = border;
247 tileSize.set( width, height );
248 tileSizeNB.set( width - 2 * border, height - 2 * border );
249 reset();
250 }
251
252 /**
253 * Sets an xy offset for the resulting tiles
254 * {@link TileRendererBase#TR_CURRENT_TILE_X_POS x-pos} and {@link TileRendererBase#TR_CURRENT_TILE_Y_POS y-pos}.
255 * @see #TR_TILE_X_OFFSET
256 * @see #TR_TILE_Y_OFFSET
257 **/
258 public void setTileOffset(final int xoff, final int yoff) {
259 offsetX = xoff;
260 offsetY = yoff;
261 }
262
263 /**
264 * {@inheritDoc}
265 *
266 * Reset internal states of {@link TileRenderer} are:
267 * <ul>
268 * <li>{@link #TR_ROWS}</li>
269 * <li>{@link #TR_COLUMNS}</li>
270 * <li>{@link #TR_CURRENT_COLUMN}</li>
271 * <li>{@link #TR_CURRENT_ROW}</li>
272 * <li>{@link #TR_CURRENT_TILE_NUM}</li>
273 * <li>{@link #TR_CURRENT_TILE_X_POS}</li>
274 * <li>{@link #TR_CURRENT_TILE_Y_POS}</li>
275 * <li>{@link #TR_CURRENT_TILE_WIDTH}</li>
276 * <li>{@link #TR_CURRENT_TILE_HEIGHT}</li>
277 *</ul>
278 */
279 @Override
280 public final void reset() {
281 final DimensionImmutable clippedImageSize = getClippedImageSize();
282 columns = ( clippedImageSize.getWidth() + tileSizeNB.getWidth() - 1 ) / tileSizeNB.getWidth();
283 rows = ( clippedImageSize.getHeight() + tileSizeNB.getHeight() - 1 ) / tileSizeNB.getHeight();
284 currentRow = 0;
285 currentColumn = 0;
286 currentTile = 0;
287 currentTileXPos = 0;
288 currentTileYPos = 0;
291
292 assert columns >= 0;
293 assert rows >= 0;
294
295 beginCalled = false;
296 isInit = true;
297 }
298
299 /* pp */ final int getCurrentTile() { return currentTile; }
300
301 @Override
302 public final int getParam(final int pname) {
303 switch (pname) {
304 case TR_IMAGE_WIDTH:
305 return imageSize.getWidth();
306 case TR_IMAGE_HEIGHT:
307 return imageSize.getHeight();
309 return currentTileXPos;
311 return currentTileYPos;
313 return currentTileWidth;
315 return currentTileHeight;
317 return null != imageClippingDim ? imageClippingDim.getWidth() : 0;
319 return null != imageClippingDim ? imageClippingDim.getHeight() : 0;
320 case TR_TILE_WIDTH:
321 return tileSize.getWidth();
322 case TR_TILE_HEIGHT:
323 return tileSize.getHeight();
324 case TR_TILE_BORDER:
325 return tileBorder;
326 case TR_TILE_X_OFFSET:
327 return offsetX;
328 case TR_TILE_Y_OFFSET:
329 return offsetY;
330 case TR_ROWS:
331 return rows;
332 case TR_COLUMNS:
333 return columns;
335 return currentTile;
336 case TR_CURRENT_ROW:
337 return currentRow;
339 return currentColumn;
340 case TR_ROW_ORDER:
341 return rowOrder;
342 default:
343 throw new IllegalArgumentException("Invalid pname: "+pname);
344 }
345 }
346
347 /**
348 * Sets the order of row traversal, default is {@link #TR_BOTTOM_TO_TOP}.
349 *
350 * @param order The row traversal order, must be either {@link #TR_TOP_TO_BOTTOM} or {@link #TR_BOTTOM_TO_TOP}.
351 */
352 public final void setRowOrder(final int order) {
353 if (order == TR_TOP_TO_BOTTOM || order == TR_BOTTOM_TO_TOP) {
354 rowOrder = order;
355 } else {
356 throw new IllegalArgumentException("Must pass TR_TOP_TO_BOTTOM or TR_BOTTOM_TO_TOP");
357 }
358 }
359
360 @Override
361 public final boolean isSetup() {
362 return 0 < imageSize.getWidth() && 0 < imageSize.getHeight();
363 }
364
365 /**
366 * {@inheritDoc}
367 *
368 * <p>
369 * <i>end of tiling</i> is reached w/ {@link TileRenderer}, if at least one of the following is true:
370 * <ul>
371 * <li>all tiles have been rendered, i.e. {@link #TR_CURRENT_TILE_NUM} is -1</li>
372 * <li>no tiles to render, i.e. {@link #TR_COLUMNS} or {@link #TR_ROWS} is 0</li>
373 * </ul>
374 * </p>
375 */
376 @Override
377 public final boolean eot() {
378 if ( !isInit ) { // ensure at least one reset-call
379 reset();
380 }
381 return 0 > currentTile || 0 >= columns*rows;
382 }
383
384 /**
385 * {@inheritDoc}
386 *
387 * @throws IllegalStateException if {@link #setImageSize(int, int) image-size} has not been set or
388 * {@link #eot() end-of-tiling} has been reached.
389 */
390 @Override
391 public final void beginTile( final GL gl ) throws IllegalStateException, GLException {
392 if( !isSetup() ) {
393 throw new IllegalStateException("Image size has not been set: "+this);
394 }
395 if ( eot() ) {
396 throw new IllegalStateException("EOT reached: "+this);
397 }
398 validateGL(gl);
399
400 /* which tile (by row and column) we're about to render */
401 if (rowOrder == TR_BOTTOM_TO_TOP) {
402 currentRow = currentTile / columns;
403 currentColumn = currentTile % columns;
404 } else {
405 currentRow = rows - ( currentTile / columns ) - 1;
406 currentColumn = currentTile % columns;
407 }
408 assert ( currentRow < rows );
409 assert ( currentColumn < columns );
410
411 final int border = tileBorder;
412
413 final DimensionImmutable clippedImageSize = getClippedImageSize();
414 int tH, tW;
415
416 /* Compute actual size of this tile with border */
417 if (currentRow < rows - 1) {
418 tH = tileSize.getHeight();
419 } else {
420 tH = clippedImageSize.getHeight() - ( rows - 1 ) * ( tileSizeNB.getHeight() ) + 2 * border;
421 }
422
423 if (currentColumn < columns - 1) {
424 tW = tileSize.getWidth();
425 } else {
426 tW = clippedImageSize.getWidth() - ( columns - 1 ) * ( tileSizeNB.getWidth() ) + 2 * border;
427 }
428
429 currentTileXPos = currentColumn * tileSizeNB.getWidth() + offsetX;
430 currentTileYPos = currentRow * tileSizeNB.getHeight() + offsetY;
431
432 /* Save tile size, with border */
433 currentTileWidth = tW;
435
436 gl.glViewport( 0, 0, tW, tH );
437
438 if( DEBUG ) {
439 System.err.println("TileRenderer.begin: "+this.toString());
440 }
441
442 // Do not forget to issue:
443 // reshape( 0, 0, tW, tH );
444 // which shall reflect tile renderer tiles: currentTileXPos, currentTileYPos and imageSize
445 beginCalled = true;
446 }
447
448 @Override
449 public void endTile( final GL gl ) throws IllegalStateException, GLException {
450 if( !beginCalled ) {
451 throw new IllegalStateException("beginTile(..) has not been called");
452 }
453 validateGL(gl);
454
455 // be sure OpenGL rendering is finished
456 gl.glFlush();
457
458 // implicitly save current glPixelStore values
459 psm.setPackAlignment(gl, 1);
460 final GL2ES3 gl2es3;
461 final int readBuffer;
462 if( gl.isGL2ES3() ) {
463 gl2es3 = gl.getGL2ES3();
464 readBuffer = gl2es3.getDefaultReadBuffer();
465 gl2es3.glReadBuffer(readBuffer);
466 } else {
467 gl2es3 = null;
468 readBuffer = 0; // undef. probably default: GL_FRONT (single buffering) GL_BACK (double buffering)
469 }
470 if( DEBUG ) {
471 System.err.println("TileRenderer.end.0: readBuffer 0x"+Integer.toHexString(readBuffer)+", "+this.toString());
472 }
473
474 final int tmp[] = new int[1];
475
476 if( tileBuffer != null ) {
477 final GLPixelAttributes pixelAttribs = tileBuffer.pixelAttributes;
478 final int srcX = tileBorder;
479 final int srcY = tileBorder;
480 final int srcWidth = tileSizeNB.getWidth();
481 final int srcHeight = tileSizeNB.getHeight();
482 final int readPixelSize = GLBuffers.sizeof(gl, tmp, pixelAttribs.pfmt.comp.bytesPerPixel(), srcWidth, srcHeight, 1, true);
484 if( tileBuffer.requiresNewBuffer(gl, srcWidth, srcHeight, readPixelSize) ) {
485 throw new IndexOutOfBoundsException("Required " + readPixelSize + " bytes of buffer, only had " + tileBuffer);
486 }
487 gl.glReadPixels( srcX, srcY, srcWidth, srcHeight, pixelAttribs.format, pixelAttribs.type, tileBuffer.buffer);
488 // be sure OpenGL rendering is finished
489 gl.glFlush();
490 tileBuffer.position( readPixelSize );
492 }
493
494 if( imageBuffer != null ) {
495 final GLPixelAttributes pixelAttribs = imageBuffer.pixelAttributes;
496 final int srcX = tileBorder;
497 final int srcY = tileBorder;
498 final int srcWidth = currentTileWidth - 2 * tileBorder;
499 final int srcHeight = currentTileHeight - 2 * tileBorder;
500
501 /* setup pixel store for glReadPixels */
502 final int rowLength = imageSize.getWidth();
503 psm.setPackRowLength(gl2es3, rowLength);
504
505 /* read the tile into the final image */
506 final int readPixelSize = GLBuffers.sizeof(gl, tmp, pixelAttribs.pfmt.comp.bytesPerPixel(), srcWidth, srcHeight, 1, true);
507
508 final int skipPixels = currentColumn * tileSizeNB.getWidth();
509 final int skipRows = currentRow * tileSizeNB.getHeight();
510 final int ibPos = ( skipPixels + ( skipRows * rowLength ) ) * pixelAttribs.pfmt.comp.bytesPerPixel();
511 final int ibLim = ibPos + readPixelSize;
513 if( imageBuffer.requiresNewBuffer(gl, srcWidth, srcHeight, readPixelSize) ) {
514 throw new IndexOutOfBoundsException("Required " + ibLim + " bytes of buffer, only had " + imageBuffer);
515 }
516 imageBuffer.position(ibPos);
517
518 gl.glReadPixels( srcX, srcY, srcWidth, srcHeight, pixelAttribs.format, pixelAttribs.type, imageBuffer.buffer);
519 // be sure OpenGL rendering is finished
520 gl.glFlush();
521 imageBuffer.position( ibLim );
523 }
524
525 /* restore previous glPixelStore values */
526 psm.restore(gl);
527
528 beginCalled = false;
529
530 /* increment tile counter, return 1 if more tiles left to render */
531 currentTile++;
532 if( currentTile >= rows * columns ) {
533 currentTile = -1; /* all done */
534 }
535 }
536}
final void set(final int width, final int height)
Definition: Dimension.java:71
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Utility routines for dealing with direct buffers.
Definition: GLBuffers.java:60
static final int sizeof(final GL gl, final int tmp[], final int bytesPerPixel, int width, int height, int depth, final boolean pack)
Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pi...
Definition: GLBuffers.java:364
final PixelFormat pfmt
PixelFormat describing the component layout
final int format
The OpenGL pixel data format.
int position()
Returns the byte position of the buffer.
Buffer flip()
See Buffer#flip().
final GLPixelAttributes pixelAttributes
The GLPixelAttributes.
Buffer clear()
See Buffer#clear().
boolean requiresNewBuffer(final GL gl, final int newWidth, final int newHeight, int newByteSize)
Returns true, if invalid or implementation requires a new buffer based on the new size due to pixel a...
final Buffer buffer
Buffer holding the pixel data.
final void setPackRowLength(final GL2ES3 gl, final int packRowLength)
Sets the GL2ES3#GL_PACK_ROW_LENGTH.
final void restore(final GL gl)
Restores PACK and UNPACK pixel storage mode previously saved w/ saveAll(GL) or savePack(GL) and saveU...
final void setPackAlignment(final GL gl, final int packAlignment)
Sets the GL#GL_PACK_ALIGNMENT.
A fairly direct port of Brian Paul's tile rendering library, found at http://www.mesa3d....
static final int TR_CURRENT_TILE_WIDTH
The width of the current tile.
static final int TR_IMAGE_WIDTH
The width of the final image.
static final int TR_CURRENT_TILE_HEIGHT
The height of the current tile.
static final int TR_CURRENT_TILE_X_POS
The x-pos of the current tile.
static final int TR_CURRENT_TILE_Y_POS
The y-pos of the current tile.
static final int TR_IMAGE_HEIGHT
The height of the final image.
A fairly direct port of Brian Paul's tile rendering library, found at http://www.mesa3d....
final void clipImageSize(final int width, final int height)
Clips the image-size this tile-renderer iterates through, which can be retrieved via getClippedImageS...
static final int TR_IMAGE_CLIPPING_HEIGHT
The height of the final clipped image.
static final int TR_ROW_ORDER
The order that the rows are traversed.
final int getParam(final int pname)
Gets the parameters of this TileRenderer object.
static final int TR_BOTTOM_TO_TOP
Indicates we are traversing rows from the bottom to the top (default).
static final int TR_TILE_Y_OFFSET
The tiles y-offset.
final boolean eot()
Returns true if end of tiling has been reached, otherwise false.end of tiling criteria is implementat...
TileRenderer()
Creates a new TileRenderer object.
static final int TR_TOP_TO_BOTTOM
Indicates we are traversing rows from the top to the bottom.
void setTileOffset(final int xoff, final int yoff)
Sets an xy offset for the resulting tiles x-pos and y-pos.
StringBuilder tileDetails(final StringBuilder sb)
final void beginTile(final GL gl)
Begins rendering a tile.This method modifies the viewport, see below. User shall reset the viewport w...
static final int TR_TILE_X_OFFSET
The tiles x-offset.
final void reset()
Method resets implementation's internal state to start of tiling as required for beginTile(GL) if end...
static final int TR_TILE_HEIGHT
The height of the tiles.
static final int TR_ROWS
The number of rows of tiles.
static final int TR_CURRENT_TILE_NUM
The current tile number.
static final int TR_COLUMNS
The number of columns of tiles.
static final int TR_TILE_WIDTH
The width of the tiles.
static final int TR_TILE_BORDER
The width of the border around the tiles.
static final int TR_CURRENT_COLUMN
The current column number.
final DimensionImmutable getClippedImageSize()
Returns the clipped image-size.
static final int TR_IMAGE_CLIPPING_WIDTH
The width of the final clipped image.
final void setRowOrder(final int order)
Sets the order of row traversal, default is TR_BOTTOM_TO_TOP.
void endTile(final GL gl)
Must be called after rendering the scene, see beginTile(GL).
final void setImageSize(final int width, final int height)
Sets the desired size of the final image.
static final int TR_CURRENT_ROW
The current row number.
final boolean isSetup()
Returns true if this instance is setup properly, i.e.
final void setTileSize(final int width, final int height, final int border)
Sets the size of the tiles to use in rendering.
final Composition comp
Unique Pixel Composition, i.e.
Immutable Dimension Interface, consisting of it's read only components:
int bytesPerPixel()
Number of bytes per pixel, i.e.
void glReadBuffer(int mode)
Entry point to C language function: void {@native glReadBuffer}(GLenum mode) Part of GL_ES_VERSION...
GL2ES3 getGL2ES3()
Casts this object to the GL2ES3 interface.
int getDefaultReadBuffer()
Returns the default color buffer within the current bound getDefaultReadFramebuffer(),...