From 556d92b63555a085b25e32b1cd55afce24edd07a Mon Sep 17 00:00:00 2001
From: Sven Gothel true
, allow row-stride, otherwise not.
* See {@link #getAllowRowStride()} and {@link GLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
*/
- public DefaultGLPixelBufferProvider(boolean allowRowStride) {
+ public DefaultGLPixelBufferProvider(final boolean allowRowStride) {
this.allowRowStride = allowRowStride;
}
@@ -111,7 +111,7 @@ public class GLPixelBuffer {
public boolean getAllowRowStride() { return allowRowStride; }
@Override
- public GLPixelAttributes getAttributes(GL gl, int componentCount) {
+ public GLPixelAttributes getAttributes(final GL gl, final int componentCount) {
final GLContext ctx = gl.getContext();
final int dFormat, dType;
@@ -121,14 +121,14 @@ public class GLPixelBuffer {
dFormat = GL2ES2.GL_RED;
} else {
// ALPHA is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
- dFormat = GL2ES2.GL_ALPHA;
+ dFormat = GL.GL_ALPHA;
}
dType = GL.GL_UNSIGNED_BYTE;
} else if( 3 == componentCount ) {
dFormat = GL.GL_RGB;
dType = GL.GL_UNSIGNED_BYTE;
} else if( 4 == componentCount ) {
- int _dFormat = ctx.getDefaultPixelDataFormat();
+ final int _dFormat = ctx.getDefaultPixelDataFormat();
final int dComps = GLBuffers.componentCount(_dFormat);
if( dComps == componentCount ) {
dFormat = _dFormat;
@@ -150,11 +150,11 @@ public class GLPixelBuffer {
*
null
.
*/
- public static final GLPixelAttributes convert(PixelFormat pixFmt, GLProfile glp) {
+ public static final GLPixelAttributes convert(final PixelFormat pixFmt, final GLProfile glp) {
int df = 0; // format
int dt = GL.GL_UNSIGNED_BYTE; // data type
switch(pixFmt) {
@@ -221,7 +221,7 @@ public class GLPixelBuffer {
df = GL2ES2.GL_RED;
} else {
// ALPHA/LUMINANCE is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
- df = GL2ES2.GL_LUMINANCE;
+ df = GL.GL_LUMINANCE;
}
break;
case BGR888:
@@ -256,7 +256,7 @@ public class GLPixelBuffer {
}
return null;
}
- private GLPixelAttributes(int componentCount, int dataFormat, int dataType, boolean checkArgs) {
+ private GLPixelAttributes(final int componentCount, final int dataFormat, final int dataType, final boolean checkArgs) {
this.componentCount = componentCount;
this.format = dataFormat;
this.type = dataType;
@@ -290,7 +290,7 @@ public class GLPixelBuffer {
case GL.GL_RGBA:
pixFmt = PixelFormat.RGBA8888;
break;
- case GL2.GL_BGR:
+ case GL2GL3.GL_BGR:
pixFmt = PixelFormat.BGR888;
break;
case GL.GL_BGRA:
@@ -383,7 +383,7 @@ public class GLPixelBuffer {
* @param buffer the backing array
* @param allowRowStride If true
, allow row-stride, otherwise not. See {@link #requiresNewBuffer(GL, int, int, int)}.
*/
- public GLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, Buffer buffer, boolean allowRowStride) {
+ public GLPixelBuffer(final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final Buffer buffer, final boolean allowRowStride) {
this.pixelAttributes = pixelAttributes;
this.width = width;
this.height = height;
@@ -414,7 +414,7 @@ public class GLPixelBuffer {
}
/** Sets the byte position of the {@link #buffer}. */
- public Buffer position(int bytePos) {
+ public Buffer position(final int bytePos) {
return buffer.position( bytePos / bufferElemSize );
}
@@ -465,7 +465,7 @@ public class GLPixelBuffer {
* @param newByteSize if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
* @see GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int)
*/
- public boolean requiresNewBuffer(GL gl, int newWidth, int newHeight, int newByteSize) {
+ public boolean requiresNewBuffer(final GL gl, final int newWidth, final int newHeight, int newByteSize) {
if( !isValid() ) {
return true;
}
--
cgit v1.2.3