diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java index 680984cdb..abdb7c5f9 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java @@ -62,11 +62,11 @@ public class GLReadBufferUtil { * @param alpha true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: Alpha maybe forced on ES platforms! * @param write2Texture true if readPixel's TextureData shall be written to a 2d Texture */ - public GLReadBufferUtil(boolean alpha, boolean write2Texture) { + public GLReadBufferUtil(final boolean alpha, final boolean write2Texture) { this(GLPixelBuffer.defaultProviderNoRowStride, alpha, write2Texture); } - public GLReadBufferUtil(GLPixelBufferProvider pixelBufferProvider, boolean alpha, boolean write2Texture) { + public GLReadBufferUtil(final GLPixelBufferProvider pixelBufferProvider, final boolean alpha, final boolean write2Texture) { this.pixelBufferProvider = pixelBufferProvider; this.componentCount = alpha ? 4 : 3 ; this.alignment = alpha ? 4 : 1 ; @@ -110,11 +110,11 @@ public class GLReadBufferUtil { /** * Write the TextureData filled by {@link #readPixels(GLAutoDrawable, boolean)} to file */ - public void write(File dest) { + public void write(final File dest) { try { TextureIO.write(readTextureData, dest); rewindPixelBuffer(); - } catch (IOException ex) { + } catch (final IOException ex) { throw new RuntimeException("can not write to file: " + dest.getAbsolutePath(), ex); } } @@ -131,7 +131,7 @@ public class GLReadBufferUtil { * * @see #GLReadBufferUtil(boolean, boolean) */ - public boolean readPixels(GL gl, boolean mustFlipVertically) { + public boolean readPixels(final GL gl, final boolean mustFlipVertically) { return readPixels(gl, 0, 0, 0, 0, mustFlipVertically); } @@ -150,7 +150,7 @@ public class GLReadBufferUtil { * and handled in a efficient manner there (TextureCoordinates and TextureIO writer). * @see #GLReadBufferUtil(boolean, boolean) */ - public boolean readPixels(GL gl, int inX, int inY, int inWidth, int inHeight, boolean mustFlipVertically) { + public boolean readPixels(final GL gl, final int inX, final int inY, final int inWidth, final int inHeight, final boolean mustFlipVertically) { final GLDrawable drawable = gl.getContext().getGLReadDrawable(); final int width, height; if( 0 >= inWidth || drawable.getSurfaceWidth() < inWidth ) { @@ -207,7 +207,7 @@ public class GLReadBufferUtil { readPixelBuffer.buffer, null /* Flusher */); newData = true; - } catch (Exception e) { + } catch (final Exception e) { readTextureData = null; readPixelBuffer = null; throw new RuntimeException("can not fetch offscreen texture", e); @@ -229,7 +229,7 @@ public class GLReadBufferUtil { readPixelBuffer.clear(); try { gl.glReadPixels(inX, inY, width, height, pixelAttribs.format, pixelAttribs.type, readPixelBuffer.buffer); - } catch(GLException gle) { res = false; gle.printStackTrace(); } + } catch(final GLException gle) { res = false; gle.printStackTrace(); } readPixelBuffer.position( readPixelSize ); readPixelBuffer.flip(); final int glerr1 = gl.glGetError(); @@ -256,7 +256,7 @@ public class GLReadBufferUtil { return res; } - public void dispose(GL gl) { + public void dispose(final GL gl) { if(null != readTexture) { readTexture.destroy(gl); readTextureData = null; |