aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/texture
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-10-17 22:27:27 -0700
committerHarvey Harrison <[email protected]>2013-10-17 22:27:27 -0700
commit5e9c02bce7b241a0bf95c8abca9a91cd25e51ed3 (patch)
tree78e913afc74a64e519d69dfb9aa886dd41ec16ed /src/jogl/classes/com/jogamp/opengl/util/texture
parent2ebf1bf35928e35ded6e38df64dee7aa578ae3c7 (diff)
jogl: remove all trailing whitespace
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/texture')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java86
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java16
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java94
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java74
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java120
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java52
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java28
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java18
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java22
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java40
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java22
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java36
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java66
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java38
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java34
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java14
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java16
20 files changed, 409 insertions, 409 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
index 4236e22fb..fd026d76e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -53,8 +53,8 @@ import com.jogamp.opengl.util.texture.spi.*;
* for enabling/disabling OpenGL texture state, binding this texture,
* and computing texture coordinates for both the entire image as well
* as a sub-image.
- *
- * <a name="textureCallOrder"><h5>Order of Texture Commands</h5></a>
+ *
+ * <a name="textureCallOrder"><h5>Order of Texture Commands</h5></a>
* <p>
* Due to many confusions w/ texture usage, following list described the order
* and semantics of texture unit selection, binding and enabling.
@@ -67,16 +67,16 @@ import com.jogamp.opengl.util.texture.spi.*;
* <li>Issue draw commands</li>
* </ul>
* </p>
- *
+ *
* <p><a name="nonpow2"><b>Non-power-of-two restrictions</b></a>
* <br> When creating an OpenGL texture object, the Texture class will
* attempt to use <i>non-power-of-two textures</i> (NPOT) if available, see {@link GL#isNPOTTextureAvailable()}.
- * Further more,
+ * Further more,
* <a href="http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt">GL_ARB_texture_rectangle</a>
* (RECT) will be attempted on OSX w/ ATI drivers.
* If NPOT is not available or RECT not chosen, the Texture class will simply upload a non-pow2-sized
* image into a standard pow2-sized texture (without any special
- * scaling).
+ * scaling).
* Since the choice of extension (or whether one is used at
* all) depends on the user's machine configuration, developers are
* recommended to use {@link #getImageTexCoords} and {@link
@@ -106,7 +106,7 @@ import com.jogamp.opengl.util.texture.spi.*;
* #bind}, but when drawing many triangles all using the same texture,
* for best performance only one call to {@link #bind} should be made.
* User may also utilize multiple texture units,
- * see <a href="#textureCallOrder"> order of texture commands above</a>.
+ * see <a href="#textureCallOrder"> order of texture commands above</a>.
*
* <p><a name="premult"><b>Alpha premultiplication and blending</b></a>
* <p>
@@ -119,7 +119,7 @@ import com.jogamp.opengl.util.texture.spi.*;
* <p>
* The mathematically correct way to perform blending in OpenGL
* with the SrcOver "source over destination" mode, or any other
- * Porter-Duff rule, is to use <i>premultiplied color components</i>,
+ * Porter-Duff rule, is to use <i>premultiplied color components</i>,
* which means the R/G/ B color components must have been multiplied by
* the alpha value. If using <i>premultiplied color components</i>
* it is important to use the correct blending function; for
@@ -137,7 +137,7 @@ import com.jogamp.opengl.util.texture.spi.*;
float g = g * a;
float b = b * a;
gl.glColor4f(r, g, b, a);
-</pre>
+</pre>
*
* For reference, here is a list of the Porter-Duff compositing rules
* and the associated OpenGL blend functions (source and destination
@@ -187,8 +187,8 @@ public class Texture {
/** The texture coordinates corresponding to the entire image. */
private TextureCoords coords;
-
- public String toString() {
+
+ public String toString() {
return "Texture[target 0x"+Integer.toHexString(target)+", name "+texID+", "+
imgWidth+"/"+texWidth+" x "+imgHeight+"/"+texHeight+", y-flip "+mustFlipVertically+
", "+estimatedMemorySize+" bytes]";
@@ -237,7 +237,7 @@ public class Texture {
* gl.glEnable(texture.getTarget());
* </pre>
* <p>
- * Call is ignored if the {@link GL} object's context
+ * Call is ignored if the {@link GL} object's context
* is using a core profile, see {@link GL#isGLcore()},
* or if {@link #getTarget()} is {@link GLES2#GL_TEXTURE_EXTERNAL_OES}.
* </p>
@@ -255,7 +255,7 @@ public class Texture {
gl.glEnable(target);
}
}
-
+
/**
* Disables this texture's target (e.g., GL_TEXTURE_2D) in the
* given GL state. This method is a shorthand equivalent
@@ -264,7 +264,7 @@ public class Texture {
* gl.glDisable(texture.getTarget());
* </pre>
* <p>
- * Call is ignored if the {@link GL} object's context
+ * Call is ignored if the {@link GL} object's context
* is using a core profile, see {@link GL#isGLcore()},
* or if {@link #getTarget()} is {@link GLES2#GL_TEXTURE_EXTERNAL_OES}.
* </p>
@@ -282,7 +282,7 @@ public class Texture {
gl.glDisable(target);
}
}
-
+
/**
* Binds this texture to the given GL context. This method is a
* shorthand equivalent of the following OpenGL code:
@@ -292,16 +292,16 @@ public class Texture {
*
* See the <a href="#perftips">performance tips</a> above for hints
* on how to maximize performance when using many Texture objects.
- *
+ *
* @param gl the current GL context
* @throws GLException if no OpenGL context was current or if any
* OpenGL-related errors occurred
*/
public void bind(GL gl) throws GLException {
validateTexID(gl, true);
- gl.glBindTexture(target, texID);
+ gl.glBindTexture(target, texID);
}
-
+
/**
* Destroys the native resources used by this texture object.
*
@@ -335,7 +335,7 @@ public class Texture {
public int getWidth() {
return texWidth;
}
-
+
/**
* Returns the height of the allocated OpenGL texture in pixels.
* Note that the texture height will be greater than or equal to the
@@ -345,9 +345,9 @@ public class Texture {
*/
public int getHeight() {
return texHeight;
- }
-
- /**
+ }
+
+ /**
* Returns the width of the image contained within this texture.
* Note that for non-power-of-two textures in particular this may
* not be equal to the result of {@link #getWidth}. It is
@@ -389,7 +389,7 @@ public class Texture {
* entire image. If the TextureData indicated that the texture
* coordinates must be flipped vertically, the returned
* TextureCoords will take that into account.
- *
+ *
* @return the texture coordinates corresponding to the entire image
*/
public TextureCoords getImageTexCoords() {
@@ -406,7 +406,7 @@ public class Texture {
* flipped vertically, the returned TextureCoords will take that
* into account; this should not be handled by the end user in the
* specification of the y1 and y2 coordinates.
- *
+ *
* @return the texture coordinates corresponding to the specified sub-image
*/
public TextureCoords getSubImageTexCoords(int x1, int y1, int x2, int y2) {
@@ -431,9 +431,9 @@ public class Texture {
}
/**
- * Updates the entire content area incl. {@link TextureCoords}
+ * Updates the entire content area incl. {@link TextureCoords}
* of this texture using the data in the given image.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void updateImage(GL gl, TextureData data) throws GLException {
@@ -465,12 +465,12 @@ public class Texture {
updateTexCoords();
}
}
-
+
/**
* Updates the content area incl. {@link TextureCoords} of the specified target of this texture
* using the data in the given image. In general this is intended
* for construction of cube maps.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void updateImage(GL gl, TextureData data, int targetOverride) throws GLException {
@@ -791,7 +791,7 @@ public class Texture {
* texture's target. This gives control over parameters such as
* GL_TEXTURE_MAX_ANISOTROPY_EXT. Causes this texture to be bound to
* the current texture state.
- *
+ *
* @throws GLException if no OpenGL context was current or if any
* OpenGL-related errors occurred
*/
@@ -805,7 +805,7 @@ public class Texture {
* Sets the OpenGL multi-floating-point texture parameter for the
* texture's target. Causes this texture to be bound to the current
* texture state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameterfv(GL gl, int parameterName,
@@ -818,7 +818,7 @@ public class Texture {
* Sets the OpenGL multi-floating-point texture parameter for the
* texture's target. Causes this texture to be bound to the current
* texture state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameterfv(GL gl, int parameterName,
@@ -834,7 +834,7 @@ public class Texture {
* to GL_CLAMP_TO_EDGE if OpenGL 1.2 is supported on the current
* platform and GL_CLAMP if not. Causes this texture to be bound to
* the current texture state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameteri(GL gl, int parameterName,
@@ -847,7 +847,7 @@ public class Texture {
* Sets the OpenGL multi-integer texture parameter for the texture's
* target. Causes this texture to be bound to the current texture
* state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameteriv(GL gl, int parameterName,
@@ -860,7 +860,7 @@ public class Texture {
* Sets the OpenGL multi-integer texture parameter for the texture's
* target. Causes this texture to be bound to the current texture
* state.
- *
+ *
* @throws GLException if any OpenGL-related errors occurred
*/
public void setTexParameteriv(GL gl, int parameterName,
@@ -886,7 +886,7 @@ public class Texture {
}
/**
- * Returns the underlying OpenGL texture object for this texture,
+ * Returns the underlying OpenGL texture object for this texture,
* maybe <code>0</code> if not yet generated.
* <p>
* Most applications will not need to access this, since it is
@@ -967,19 +967,19 @@ public class Texture {
}
} else {
if (mustFlipVertically) {
- coords = new TextureCoords(0, // l
+ coords = new TextureCoords(0, // l
(float) imgHeight / (float) texHeight, // b
(float) imgWidth / (float) texWidth, // r
0 // t
);
} else {
- coords = new TextureCoords(0, // l
+ coords = new TextureCoords(0, // l
0, // b
(float) imgWidth / (float) texWidth, // r
(float) imgHeight / (float) texHeight // t
);
}
- }
+ }
}
private void updateSubImageImpl(GL gl, TextureData data, int newTarget, int mipmapLevel,
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
index 3931b7290..63f100630 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -77,7 +77,7 @@ public class TextureCoords {
d[6+d_off] = right *ss; d[7+d_off] = top *ts;
return d;
}
-
+
/** Returns the leftmost (x) texture coordinate of this
rectangle. */
public float left() { return left; }
@@ -93,6 +93,6 @@ public class TextureCoords {
/** Returns the topmost (y) texture coordinate of this
rectangle. */
public float top() { return top; }
-
+
public String toString() { return "TexCoord[h: "+left+" - "+right+", v: "+bottom+" - "+top+"]"; }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
index afc5bf70c..28029efc5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -57,8 +57,8 @@ import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
public class TextureData {
/** ColorSpace of pixel data. */
- public static enum ColorSpace { RGB, YCbCr, YCCK, CMYK };
-
+ public static enum ColorSpace { RGB, YCbCr, YCCK, CMYK };
+
protected int width;
protected int height;
private int border;
@@ -83,7 +83,7 @@ public class TextureData {
protected GLProfile glProfile;
protected ColorSpace pixelCS = ColorSpace.RGB;
- /**
+ /**
* Constructs a new TextureData object with the specified parameters
* and data contained in the given Buffer. The optional Flusher can
* be used to clean up native resources associated with this
@@ -123,7 +123,7 @@ public class TextureData {
* data were invalid, such as requesting mipmap generation for a
* compressed texture
*/
- public TextureData(GLProfile glp,
+ public TextureData(GLProfile glp,
int internalFormat,
int width,
int height,
@@ -135,11 +135,11 @@ public class TextureData {
boolean mustFlipVertically,
Buffer buffer,
Flusher flusher) throws IllegalArgumentException {
- this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
+ this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
mipmap, dataIsCompressed, mustFlipVertically, buffer, flusher);
}
- /**
+ /**
* Constructs a new TextureData object with the specified parameters
* and data contained in the given Buffer. The optional Flusher can
* be used to clean up native resources associated with this
@@ -178,7 +178,7 @@ public class TextureData {
* data were invalid, such as requesting mipmap generation for a
* compressed texture
*/
- public TextureData(GLProfile glp,
+ public TextureData(GLProfile glp,
int internalFormat,
int width,
int height,
@@ -207,8 +207,8 @@ public class TextureData {
alignment = 1; // FIXME: is this correct enough in all situations?
estimatedMemorySize = estimatedMemorySize(buffer);
}
-
- /**
+
+ /**
* Constructs a new TextureData object with the specified parameters
* and data for multiple mipmap levels contained in the given array
* of Buffers. The optional Flusher can be used to clean up native
@@ -258,11 +258,11 @@ public class TextureData {
boolean mustFlipVertically,
Buffer[] mipmapData,
Flusher flusher) throws IllegalArgumentException {
- this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
+ this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
dataIsCompressed, mustFlipVertically, mipmapData, flusher);
}
- /**
+ /**
* Constructs a new TextureData object with the specified parameters
* and data for multiple mipmap levels contained in the given array
* of Buffers. The optional Flusher can be used to clean up native
@@ -325,19 +325,19 @@ public class TextureData {
estimatedMemorySize += estimatedMemorySize(mipmapData[i]);
}
}
-
- /**
+
+ /**
* Returns the color space of the pixel data.
- * @see #setColorSpace(ColorSpace)
+ * @see #setColorSpace(ColorSpace)
*/
public ColorSpace getColorSpace() { return pixelCS; }
- /**
+ /**
* Set the color space of the pixel data, which defaults to {@link ColorSpace#RGB}.
- * @see #getColorSpace()
+ * @see #getColorSpace()
*/
public void setColorSpace(ColorSpace cs) { pixelCS = cs; }
-
+
/** Used only by subclasses */
protected TextureData(GLProfile glp) { this.glProfile = glp; this.pixelAttributes = GLPixelAttributes.UNDEF; }
@@ -346,8 +346,8 @@ public class TextureData {
/** Returns the height in pixels of the texture data. */
public int getHeight() { return height; }
/** Returns the border in pixels of the texture data. */
- public int getBorder() {
- return border;
+ public int getBorder() {
+ return border;
}
/** Returns the intended OpenGL {@link GLPixelAttributes} of the texture data, i.e. format and type. */
public GLPixelAttributes getPixelAttributes() {
@@ -362,21 +362,21 @@ public class TextureData {
return pixelAttributes.type;
}
/** Returns the intended OpenGL internal format of the texture data. */
- public int getInternalFormat() {
- return internalFormat;
+ public int getInternalFormat() {
+ return internalFormat;
}
/** Returns whether mipmaps should be generated for the texture data. */
- public boolean getMipmap() {
- return mipmap;
+ public boolean getMipmap() {
+ return mipmap;
}
/** Indicates whether the texture data is in compressed form. */
- public boolean isDataCompressed() {
- return dataIsCompressed;
+ public boolean isDataCompressed() {
+ return dataIsCompressed;
}
/** Indicates whether the texture coordinates must be flipped
vertically for proper display. */
- public boolean getMustFlipVertically() {
- return mustFlipVertically;
+ public boolean getMustFlipVertically() {
+ return mustFlipVertically;
}
/** Returns the texture data, or null if it is specified as a set of mipmaps. */
public Buffer getBuffer() {
@@ -384,18 +384,18 @@ public class TextureData {
}
/** Returns all mipmap levels for the texture data, or null if it is
specified as a single image. */
- public Buffer[] getMipmapData() {
- return mipmapData;
+ public Buffer[] getMipmapData() {
+ return mipmapData;
}
/** Returns the required byte alignment for the texture data. */
- public int getAlignment() {
- return alignment;
+ public int getAlignment() {
+ return alignment;
}
/** Returns the row length needed for correct GL_UNPACK_ROW_LENGTH
specification. This is currently only supported for
non-mipmapped, non-compressed textures. */
- public int getRowLength() {
- return rowLength;
+ public int getRowLength() {
+ return rowLength;
}
/** Sets the width in pixels of the texture data. */
@@ -405,25 +405,25 @@ public class TextureData {
/** Sets the border in pixels of the texture data. */
public void setBorder(int border) { this.border = border; }
/** Sets the intended OpenGL pixel format of the texture data. */
- public void setPixelAttributes(GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
- /**
+ public void setPixelAttributes(GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
+ /**
* Sets the intended OpenGL pixel format component of {@link GLPixelAttributes} of the texture data.
* <p>
- * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
- * </p>
+ * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
+ * </p>
*/
public void setPixelFormat(int pixelFormat) {
if( pixelAttributes.format != pixelFormat ) {
pixelAttributes = new GLPixelAttributes(pixelFormat, pixelAttributes.type);
}
}
- /**
+ /**
* Sets the intended OpenGL pixel type component of {@link GLPixelAttributes} of the texture data.
* <p>
- * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
- * </p>
+ * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
+ * </p>
*/
- public void setPixelType(int pixelType) {
+ public void setPixelType(int pixelType) {
if( pixelAttributes.type != pixelType) {
pixelAttributes = new GLPixelAttributes(pixelAttributes.format, pixelType);
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
index 3748cd336..b6d89d6d2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2011 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -161,11 +161,11 @@ public class TextureIO {
/** Constant which can be used as a file suffix to indicate a PAM
file, NetPbm magic 7 - binary RGB and RGBA. Write support only. */
public static final String PAM = "pam";
-
+
/** Constant which can be used as a file suffix to indicate a PAM
file, NetPbm magic 6 - binary RGB. Write support only. */
public static final String PPM = "ppm";
-
+
private static final boolean DEBUG = Debug.debug("TextureIO");
// For manually disabling the use of the texture rectangle
@@ -421,7 +421,7 @@ public class TextureIO {
// methods that *do* require a current context
//
- /**
+ /**
* Creates an OpenGL texture object from the specified TextureData
* using the current OpenGL context.
*
@@ -434,7 +434,7 @@ public class TextureIO {
return newTexture(GLContext.getCurrentGL(), data);
}
- /**
+ /**
* Creates an OpenGL texture object from the specified TextureData
* using the given OpenGL context.
*
@@ -449,8 +449,8 @@ public class TextureIO {
}
return new Texture(gl, data);
}
-
- /**
+
+ /**
* Creates an OpenGL texture object from the specified file using
* the current OpenGL context.
*
@@ -474,7 +474,7 @@ public class TextureIO {
return texture;
}
- /**
+ /**
* Creates an OpenGL texture object from the specified stream using
* the current OpenGL context.
*
@@ -503,7 +503,7 @@ public class TextureIO {
return texture;
}
- /**
+ /**
* Creates an OpenGL texture object from the specified URL using the
* current OpenGL context.
*
@@ -535,13 +535,13 @@ public class TextureIO {
return texture;
}
- /**
+ /**
* Creates an OpenGL texture object associated with the given OpenGL
* texture target. The texture has
* no initial data. This is used, for example, to construct cube
* maps out of multiple TextureData objects.
*
- * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D,
+ * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D,
* GL.GL_TEXTURE_RECTANGLE_ARB
*/
public static Texture newTexture(int target) {
@@ -556,7 +556,7 @@ public class TextureIO {
* undefined results.
*
* @param textureID the OpenGL texture object to wrap
- * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
+ * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
* GL2.GL_TEXTURE_RECTANGLE
* @param texWidth the width of the texture in pixels
* @param texHeight the height of the texture in pixels
@@ -689,7 +689,7 @@ public class TextureIO {
gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
-
+
data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
false, false, false, res, null);
@@ -701,7 +701,7 @@ public class TextureIO {
write(data, file);
}
-
+
public static void write(TextureData data, File file) throws IOException, GLException {
for (Iterator<TextureWriter> iter = textureWriters.iterator(); iter.hasNext(); ) {
TextureWriter writer = iter.next();
@@ -712,12 +712,12 @@ public class TextureIO {
throw new IOException("No suitable texture writer found for "+file.getAbsolutePath());
}
-
+
//----------------------------------------------------------------------
// SPI support
//
- /**
+ /**
* Adds a TextureProvider to support reading of a new file format.
* <p>
* The last provider added, will be the first provider to be tested.
@@ -730,7 +730,7 @@ public class TextureIO {
textureProviders.add(0, provider);
}
- /**
+ /**
* Adds a TextureWriter to support writing of a new file format.
* <p>
* The last provider added, will be the first provider to be tested.
@@ -779,7 +779,7 @@ public class TextureIO {
private static List<TextureProvider> textureProviders = new ArrayList<TextureProvider>();
private static List<TextureWriter> textureWriters = new ArrayList<TextureWriter>();
- static {
+ static {
// ImageIO provider, the fall-back, must be the first one added
if(GLProfile.isAWTAvailable()) {
try {
@@ -1221,7 +1221,7 @@ public class TextureIO {
return null;
}
}
-
+
//----------------------------------------------------------------------
// DDS texture writer
//
@@ -1249,7 +1249,7 @@ public class TextureIO {
case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: d3dFormat = DDSImage.D3DFMT_DXT5; break;
default: throw new IOException("Unsupported pixel format 0x" + Integer.toHexString(pixelFormat) + " by DDS writer");
}
-
+
ByteBuffer[] mipmaps = null;
if (data.getMipmapData() != null) {
mipmaps = new ByteBuffer[data.getMipmapData().length];
@@ -1319,7 +1319,7 @@ public class TextureIO {
//----------------------------------------------------------------------
// TGA (Targa) texture writer
-
+
static class TGATextureWriter implements TextureWriter {
public boolean write(File file,
TextureData data) throws IOException {
@@ -1329,19 +1329,19 @@ public class TextureIO {
final int pixelFormat = pixelAttribs.format;
final int pixelType = pixelAttribs.type;
if ((pixelFormat == GL.GL_RGB ||
- pixelFormat == GL.GL_RGBA ||
+ pixelFormat == GL.GL_RGBA ||
pixelFormat == GL2.GL_BGR ||
pixelFormat == GL.GL_BGRA ) &&
(pixelType == GL.GL_BYTE ||
pixelType == GL.GL_UNSIGNED_BYTE)) {
-
+
ByteBuffer buf = (ByteBuffer) data.getBuffer();
if (null == buf) {
buf = (ByteBuffer) data.getMipmapData()[0];
}
buf.rewind();
-
- if( pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA ) {
+
+ if( pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA ) {
// Must reverse order of red and blue channels to get correct results
int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
for (int i = 0; i < buf.remaining(); i += skip) {
@@ -1364,12 +1364,12 @@ public class TextureIO {
}
return false;
- }
+ }
}
//----------------------------------------------------------------------
// PNG texture writer
-
+
static class PNGTextureWriter implements TextureWriter {
public boolean write(File file, TextureData data) throws IOException {
if (PNG.equals(IOUtil.getFileSuffix(file))) {
@@ -1402,13 +1402,13 @@ public class TextureIO {
break;
}
if ( ( 1 == bytesPerPixel || 3 == bytesPerPixel || 4 == bytesPerPixel) &&
- ( pixelType == GL.GL_BYTE || pixelType == GL.GL_UNSIGNED_BYTE)) {
+ ( pixelType == GL.GL_BYTE || pixelType == GL.GL_UNSIGNED_BYTE)) {
ByteBuffer buf = (ByteBuffer) data.getBuffer();
if (null == buf) {
buf = (ByteBuffer) data.getMipmapData()[0];
}
buf.rewind();
-
+
PNGImage image = PNGImage.createFromData(data.getWidth(), data.getHeight(), -1f, -1f,
bytesPerPixel, reversedChannels, !data.getMustFlipVertically(), buf);
image.write(file, true);
@@ -1418,9 +1418,9 @@ public class TextureIO {
" / type 0x"+Integer.toHexString(pixelFormat)+" (only GL_RGB/A, GL_BGR/A + bytes)");
}
return false;
- }
+ }
}
-
+
//----------------------------------------------------------------------
// Helper routines
//
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index 5c6b63535..e4f72abf0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -36,26 +36,26 @@ import com.jogamp.opengl.util.TimeFrameI;
/**
* Protocol for texture sequences, like animations, movies, etc.
* <p>
- * Ensure to respect the texture coordinates provided by
+ * Ensure to respect the texture coordinates provided by
* {@link TextureFrame}.{@link TextureFrame#getTexture() getTexture()}.{@link Texture#getImageTexCoords() getImageTexCoords()}.
* </p>
- * The user's shader shall be fitted for this implementation.
+ * The user's shader shall be fitted for this implementation.
* Assuming we use a base shader code w/o headers using </code>ShaderCode</code>.
* (Code copied from unit test / demo <code>TexCubeES2</code>)
* <pre>
- *
+ *
static final String[] es2_prelude = { "#version 100\n", "precision mediump float;\n" };
static final String gl2_prelude = "#version 110\n";
static final String shaderBasename = "texsequence_xxx"; // the base shader code w/o headers
- static final String myTextureLookupName = "myTexture2D"; // the desired texture lookup function
-
+ static final String myTextureLookupName = "myTexture2D"; // the desired texture lookup function
+
private void initShader(GL2ES2 gl, TextureSequence texSeq) {
// Create & Compile the shader objects
- ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, TexCubeES2.class,
+ ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, TexCubeES2.class,
"shader", "shader/bin", shaderBasename, true);
- ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, TexCubeES2.class,
+ ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, TexCubeES2.class,
"shader", "shader/bin", shaderBasename, true);
-
+
// Prelude shader code w/ GLSL profile specifics [ 1. pre-proc, 2. other ]
int rsFpPos;
if(gl.isGLES2()) {
@@ -72,25 +72,25 @@ import com.jogamp.opengl.util.TimeFrameI;
if(gl.isGLES2()) {
// insert ES2 default precision declaration
rsFpPos = rsFp.insertShaderSource(0, rsFpPos, es2_prelude[1]);
- }
+ }
// negotiate the texture lookup function name
final String texLookupFuncName = texSeq.getTextureLookupFunctionName(myTextureLookupName);
-
- // in case a fixed lookup function is being chosen, replace the name in our code
+
+ // in case a fixed lookup function is being chosen, replace the name in our code
rsFp.replaceInShaderSource(myTextureLookupName, texLookupFuncName);
-
+
// Cache the TextureSequence shader details in StringBuilder:
final StringBuilder sFpIns = new StringBuilder();
-
+
// .. declaration of the texture sampler using the implementation specific type
sFpIns.append("uniform ").append(texSeq.getTextureSampler2DType()).append(" mgl_ActiveTexture;\n");
-
+
// .. the actual texture lookup function, maybe null in case a built-in function is being used
sFpIns.append(texSeq.getTextureLookupFragmentShaderImpl());
-
+
// Now insert the TextureShader details in our shader after the given tag:
rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
-
+
// Create & Link the shader program
ShaderProgram sp = new ShaderProgram();
sp.add(rsVp);
@@ -102,16 +102,16 @@ import com.jogamp.opengl.util.TimeFrameI;
* </pre>
* The above procedure might look complicated, however, it allows most flexibility and
* workarounds to also deal with GLSL bugs.
- *
+ *
*/
public interface TextureSequence {
public static final String GL_OES_EGL_image_external_Required_Prelude = "#extension GL_OES_EGL_image_external : enable\n";
public static final String samplerExternalOES = "samplerExternalOES";
public static final String sampler2D = "sampler2D";
-
- /**
+
+ /**
* Texture holder interface, maybe specialized by implementation
- * to associated related data.
+ * to associated related data.
*/
public static class TextureFrame extends TimeFrameI {
public TextureFrame(Texture t, int pts, int duration) {
@@ -121,9 +121,9 @@ public interface TextureSequence {
public TextureFrame(Texture t) {
texture = t;
}
-
+
public final Texture getTexture() { return texture; }
-
+
public String toString() {
return "TextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ (null != texture ? texture.getTextureObject() : 0) + "]";
}
@@ -139,30 +139,30 @@ public interface TextureSequence {
* <p>
* Further more, the call may happen off-thread, possibly holding another, possibly shared, OpenGL context current.
* </p>
- * Hence a user shall not issue <i>any</i> OpenGL, time consuming
+ * Hence a user shall not issue <i>any</i> OpenGL, time consuming
* or {@link TextureSequence} lifecycle operations directly.<br>
* Instead, the user shall:
* <ul>
* <li>issue commands off-thread via spawning off another thread, or</li>
* <li>injecting {@link GLRunnable} objects via {@link GLAutoDrawable#invoke(boolean, GLRunnable)}, or</li>
* <li>simply changing a volatile state of their {@link GLEventListener} implementation.</li>
- * </ul>
+ * </ul>
* </p>
* */
public interface TexSeqEventListener<T extends TextureSequence> {
- /**
+ /**
* Signaling listeners that a new {@link TextureFrame} is available.
* <p>
- * User shall utilize {@link TextureSequence#getNextTexture(GL)} to dequeue it to maintain
- * a consistent queue.
+ * User shall utilize {@link TextureSequence#getNextTexture(GL)} to dequeue it to maintain
+ * a consistent queue.
* </p>
- * @param ts the event source
+ * @param ts the event source
* @param newFrame the newly enqueued frame
- * @param when system time in msec.
+ * @param when system time in msec.
**/
public void newFrameAvailable(T ts, TextureFrame newFrame, long when);
}
-
+
/** Return the texture unit used to render the current frame. */
public int getTextureUnit();
@@ -174,17 +174,17 @@ public interface TextureSequence {
* Returns the last updated texture.
* <p>
* In case the instance is just initialized, it shall return a <code>TextureFrame</code>
- * object with valid attributes. The texture content may be undefined
+ * object with valid attributes. The texture content may be undefined
* until the first call of {@link #getNextTexture(GL)}.<br>
- * </p>
+ * </p>
* Not blocking.
- *
- * @throws IllegalStateException if instance is not initialized
+ *
+ * @throws IllegalStateException if instance is not initialized
*/
public TextureFrame getLastTexture() throws IllegalStateException ;
/**
- * Returns the next texture to be rendered.
+ * Returns the next texture to be rendered.
* <p>
* Implementation shall return the next frame if available, may block if a next frame may arrive <i>soon</i>.
* Otherwise implementation shall return the last frame.
@@ -192,41 +192,41 @@ public interface TextureSequence {
* <p>
* Shall return <code>null</code> in case <i>no</i> next or last frame is available.
* </p>
- *
- * @throws IllegalStateException if instance is not initialized
+ *
+ * @throws IllegalStateException if instance is not initialized
*/
public TextureFrame getNextTexture(GL gl) throws IllegalStateException ;
-
+
/**
- * In case a shader extension is required, based on the implementation
+ * In case a shader extension is required, based on the implementation
* and the runtime GL profile, this method returns the preprocessor macros, e.g.:
* <pre>
* #extension GL_OES_EGL_image_external : enable
- * </pre>
- *
- * @throws IllegalStateException if instance is not initialized
+ * </pre>
+ *
+ * @throws IllegalStateException if instance is not initialized
*/
public String getRequiredExtensionsShaderStub() throws IllegalStateException ;
-
- /**
+
+ /**
* Returns either <code>sampler2D</code> or <code>samplerExternalOES</code>
- * depending on {@link #getLastTexture()}.{@link TextureFrame#getTexture() getTexture()}.{@link Texture#getTarget() getTarget()}.
- *
- * @throws IllegalStateException if instance is not initialized
+ * depending on {@link #getLastTexture()}.{@link TextureFrame#getTexture() getTexture()}.{@link Texture#getTarget() getTarget()}.
+ *
+ * @throws IllegalStateException if instance is not initialized
**/
public String getTextureSampler2DType() throws IllegalStateException ;
-
+
/**
* @param desiredFuncName desired lookup function name. If <code>null</code> or ignored by the implementation,
- * a build-in name is returned.
+ * a build-in name is returned.
* @return the final lookup function name
- *
+ *
* @see {@link #getTextureLookupFragmentShaderImpl()}
- *
+ *
* @throws IllegalStateException if instance is not initialized
*/
public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException ;
-
+
/**
* Returns the complete texture2D lookup function code of type
* <pre>
@@ -239,14 +239,14 @@ public interface TextureSequence {
* <i>funcName</i> can be negotiated and queried via {@link #getTextureLookupFunctionName(String)}.
* </p>
* Note: This function may return an empty string in case a build-in lookup
- * function is being chosen. If the implementation desires so,
+ * function is being chosen. If the implementation desires so,
* {@link #getTextureLookupFunctionName(String)} will ignore the desired function name
* and returns the build-in lookup function name.
* </p>
* @see #getTextureLookupFunctionName(String)
* @see #getTextureSampler2DType()
- *
- * @throws IllegalStateException if instance is not initialized
+ *
+ * @throws IllegalStateException if instance is not initialized
*/
- public String getTextureLookupFragmentShaderImpl() throws IllegalStateException ;
+ public String getTextureLookupFragmentShaderImpl() throws IllegalStateException ;
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
index 4a5d368e3..c8437d07c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
@@ -43,55 +43,55 @@ import javax.media.opengl.GLException;
* - GL.GL_TEXTURE_MAG_FILTER
* - GL.GL_TEXTURE_MIN_FILTER
* - GL.GL_TEXTURE_WRAP_S
- * - GL.GL_TEXTURE_WRAP_T
+ * - GL.GL_TEXTURE_WRAP_T
* </pre>
*/
public class TextureState {
- /**
+ /**
* Returns the <code>pname</code> to query the <code>textureTarget</code> currently bound to the active texture-unit.
* <p>
* Returns <code>0</code> is <code>textureTarget</code> is not supported.
- * </p>
- */
+ * </p>
+ */
public static final int getTextureTargetQueryName(int textureTarget) {
final int texBindQName;
switch(textureTarget) {
- case GL.GL_TEXTURE_2D: texBindQName = GL.GL_TEXTURE_BINDING_2D; break;
- case GL.GL_TEXTURE_CUBE_MAP: texBindQName = GL.GL_TEXTURE_BINDING_CUBE_MAP; break;
- case GL2ES2.GL_TEXTURE_3D: texBindQName = GL2ES2.GL_TEXTURE_BINDING_3D; break;
- case GL2GL3.GL_TEXTURE_1D: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D; break;
- case GL2GL3.GL_TEXTURE_1D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D_ARRAY; break;
- case GL2GL3.GL_TEXTURE_2D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_2D_ARRAY; break;
- case GL2GL3.GL_TEXTURE_RECTANGLE: texBindQName = GL2GL3.GL_TEXTURE_BINDING_RECTANGLE; break;
- case GL2GL3.GL_TEXTURE_BUFFER: texBindQName = GL2GL3.GL_TEXTURE_BINDING_BUFFER; break;
- case GL3.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break;
+ case GL.GL_TEXTURE_2D: texBindQName = GL.GL_TEXTURE_BINDING_2D; break;
+ case GL.GL_TEXTURE_CUBE_MAP: texBindQName = GL.GL_TEXTURE_BINDING_CUBE_MAP; break;
+ case GL2ES2.GL_TEXTURE_3D: texBindQName = GL2ES2.GL_TEXTURE_BINDING_3D; break;
+ case GL2GL3.GL_TEXTURE_1D: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D; break;
+ case GL2GL3.GL_TEXTURE_1D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D_ARRAY; break;
+ case GL2GL3.GL_TEXTURE_2D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_2D_ARRAY; break;
+ case GL2GL3.GL_TEXTURE_RECTANGLE: texBindQName = GL2GL3.GL_TEXTURE_BINDING_RECTANGLE; break;
+ case GL2GL3.GL_TEXTURE_BUFFER: texBindQName = GL2GL3.GL_TEXTURE_BINDING_BUFFER; break;
+ case GL3.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break;
case GL3.GL_TEXTURE_2D_MULTISAMPLE_ARRAY: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY; break;
default: texBindQName = 0;
}
return texBindQName;
}
-
+
private final int target;
- /**
+ /**
* <pre>
* 0 - unit
* 1 - texture object
* 2 - GL.GL_TEXTURE_MAG_FILTER
* 3 - GL.GL_TEXTURE_MIN_FILTER
* 4 - GL.GL_TEXTURE_WRAP_S
- * 5 - GL.GL_TEXTURE_WRAP_T
+ * 5 - GL.GL_TEXTURE_WRAP_T
* </pre>
*/
private final int[] state = new int[] { 0, 0, 0, 0, 0, 0 };
-
+
private static final String toHexString(int i) { return "0x"+Integer.toHexString(i); }
-
+
private static final int activeTexture(GL gl) {
final int[] vi = { 0 };
gl.glGetIntegerv(GL.GL_ACTIVE_TEXTURE, vi, 0);
return vi[0];
}
-
+
/**
* Creates a texture state for the retrieved active texture-unit and the given texture-target.
* See {@link TextureState}.
@@ -102,7 +102,7 @@ public class TextureState {
public TextureState(GL gl, int textureTarget) throws GLException {
this(gl, activeTexture(gl), textureTarget);
}
-
+
/**
* Creates a texture state for the given active texture-unit and the given texture-target.
* See {@link TextureState}.
@@ -124,7 +124,7 @@ public class TextureState {
gl.glGetTexParameteriv(target, GL.GL_TEXTURE_WRAP_S, state, 4);
gl.glGetTexParameteriv(target, GL.GL_TEXTURE_WRAP_T, state, 5);
}
-
+
/**
* Restores the texture-unit's texture-target state.
* <p>
@@ -140,12 +140,12 @@ public class TextureState {
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_S, state[4]);
gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_T, state[5]);
}
-
+
/** Returns the texture-unit of this state, key value. Unit is of range [ {@link GL#GL_TEXTURE0}.. ]. */
public final int getUnit() { return state[0]; }
/** Returns the texture-target of this state, key value. */
public final int getTarget() { return target; }
-
+
/** Returns the state's texture-object. */
public final int getObject() { return state[1]; }
/** Returns the state's mag-filter param. */
@@ -156,12 +156,12 @@ public class TextureState {
public final int getWrapS() { return state[4]; }
/** Returns the state's wrap-t param. */
public final int getWrapT() { return state[5]; }
-
-
+
+
public final String toString() {
return "TextureState[unit "+(state[0] - GL.GL_TEXTURE0)+", target "+toHexString(target)+
": obj "+toHexString(state[1])+
- ", filter[mag "+toHexString(state[2])+", min "+toHexString(state[3])+"], "+
+ ", filter[mag "+toHexString(state[2])+", min "+toHexString(state[3])+"], "+
": wrap[s "+toHexString(state[4])+", t "+toHexString(state[5])+"]]";
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
index d7e825c1d..202c08e4e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -80,7 +80,7 @@ public class AWTTextureData extends TextureData {
private static final java.awt.image.ColorModel rgbaColorModel =
new ComponentColorModel(java.awt.color.ColorSpace.getInstance(java.awt.color.ColorSpace.CS_sRGB),
- new int[] {8, 8, 8, 8}, true, true,
+ new int[] {8, 8, 8, 8}, true, true,
Transparency.TRANSLUCENT,
DataBuffer.TYPE_BYTE);
private static final java.awt.image.ColorModel rgbColorModel =
@@ -90,7 +90,7 @@ public class AWTTextureData extends TextureData {
DataBuffer.TYPE_BYTE);
- /**
+ /**
* Constructs a new TextureData object with the specified parameters
* and data contained in the given BufferedImage. The resulting
* TextureData "wraps" the contents of the BufferedImage, so if a
@@ -113,7 +113,7 @@ public class AWTTextureData extends TextureData {
* texture
* @param image the image containing the texture data
*/
- public AWTTextureData(GLProfile glp,
+ public AWTTextureData(GLProfile glp,
int internalFormat,
int pixelFormat,
boolean mipmap,
@@ -142,15 +142,15 @@ public class AWTTextureData extends TextureData {
(expectingGL12 && haveGL12))) {
revertPixelAttributes();
}
- }
+ }
}
-
+
@Override
public GLPixelAttributes getPixelAttributes() {
validatePixelAttributes();
return super.getPixelAttributes();
}
-
+
@Override
public int getPixelFormat() {
validatePixelAttributes();
@@ -246,7 +246,7 @@ public class AWTTextureData extends TextureData {
// we can pass the image data directly to OpenGL only if
// we have an integral number of pixels in each scanline
// and only if the GL_EXT_abgr extension is present
-
+
// NOTE: disabling this code path for now as it appears it's
// buggy at least on some NVidia drivers and doesn't perform
// the necessary byte swapping (FIXME: needs more
@@ -255,7 +255,7 @@ public class AWTTextureData extends TextureData {
pixelAttributes = new GLPixelAttributes(GL2.GL_ABGR_EXT, GL.GL_UNSIGNED_BYTE);
rowLength = scanlineStride / 4;
alignment = 4;
-
+
// Store a reference to the original image for later in
// case it turns out that we don't have GL_EXT_abgr at the
// time we're going to do the texture upload to OpenGL
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
index fdd1365f7..c70f5d0f3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -100,7 +100,7 @@ public class AWTTextureIO extends TextureIO {
return newTextureDataImpl(glp, image, internalFormat, pixelFormat, mipmap);
}
- /**
+ /**
* Creates an OpenGL texture object from the specified BufferedImage
* using the current OpenGL context.
*
@@ -119,7 +119,7 @@ public class AWTTextureIO extends TextureIO {
return texture;
}
- private static TextureData newTextureDataImpl(GLProfile glp,
+ private static TextureData newTextureDataImpl(GLProfile glp,
BufferedImage image,
int internalFormat,
int pixelFormat,
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
index 3f91ae966..d75bb3767 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -166,7 +166,7 @@ public class DDSImage {
public static DDSImage read(String filename) throws IOException {
return read(new File(filename));
}
-
+
/** Reads a DirectDraw surface from the specified file, returning
the resulting DDSImage.
@@ -212,7 +212,7 @@ public class DDSImage {
}
}
- /**
+ /**
* Creates a new DDSImage from data supplied by the user. The
* resulting DDSImage can be written to disk using the write()
* method.
@@ -763,7 +763,7 @@ public class DDSImage {
default:
throw new IllegalArgumentException("d3dFormat must be one of the known formats");
}
-
+
// Now check the mipmaps against this size
int curSize = topmostMipmapSize;
int totalSize = 0;
@@ -785,7 +785,7 @@ public class DDSImage {
buf.put(mipmapData[i]);
}
this.buf = buf;
-
+
// Allocate and initialize a Header
header = new Header();
header.size = Header.size();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
index 4d3d088ba..471938754 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -40,12 +40,12 @@ import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.util.texture.TextureData.ColorSpace;
public class JPEGImage {
- private static final boolean DEBUG = Debug.debug("JPEGImage");
-
-
+ private static final boolean DEBUG = Debug.debug("JPEGImage");
+
+
/**
* Reads a JPEG image from the specified InputStream, using the given color space for storage.
- *
+ *
* @param in
* @param cs Storage color space, either {@link ColorSpace#RGB} or {@link ColorSpace#YCbCr}. {@link ColorSpace#YCCK} and {@link ColorSpace#CMYK} will throw an exception!
* @return
@@ -54,12 +54,12 @@ public class JPEGImage {
public static JPEGImage read(InputStream in, ColorSpace cs) throws IOException {
return new JPEGImage(in, cs);
}
-
+
/** Reads a JPEG image from the specified InputStream, using the {@link ColorSpace#RGB}. */
public static JPEGImage read(InputStream in) throws IOException {
return new JPEGImage(in, ColorSpace.RGB);
}
-
+
private static class JPEGColorSink implements JPEGDecoder.ColorSink {
int width=0, height=0;
int sourceComponents=0;
@@ -67,7 +67,7 @@ public class JPEGImage {
int storageComponents;
final ColorSpace storageCS;
ByteBuffer data = null;
-
+
JPEGColorSink(ColorSpace storageCM) {
this.storageCS = storageCM;
switch(storageCS) {
@@ -79,7 +79,7 @@ public class JPEGImage {
throw new IllegalArgumentException("Unsupported storage color-space: "+storageCS);
}
}
-
+
@Override
public final ColorSpace allocate(int width, int height, ColorSpace sourceCM, int sourceComponents) throws RuntimeException {
this.width = width;
@@ -96,7 +96,7 @@ public class JPEGImage {
data.put(i++, r);
data.put(i++, g);
data.put(i++, b);
- // data.put(i++, (byte)0xff);
+ // data.put(i++, (byte)0xff);
}
@Override
@@ -111,12 +111,12 @@ public class JPEGImage {
data.put(i++, Cb);
data.put(i++, Cr);
}
-
+
public String toString() {
return "JPEGPixels["+width+"x"+height+", sourceComp "+sourceComponents+", sourceCS "+sourceCS+", storageCS "+storageCS+", storageComp "+storageComponents+"]";
}
};
-
+
private JPEGImage(InputStream in, ColorSpace cs) throws IOException {
pixelStorage = new JPEGColorSink(cs);
final JPEGDecoder decoder = new JPEGDecoder();
@@ -126,7 +126,7 @@ public class JPEGImage {
decoder.getPixel(pixelStorage, pixelWidth, pixelHeight);
data = pixelStorage.data;
final boolean hasAlpha = false;
-
+
bytesPerPixel = 3;
glFormat = GL.GL_RGB;
reversedChannels = false; // RGB[A]
@@ -142,7 +142,7 @@ public class JPEGImage {
private final int pixelWidth, pixelHeight, glFormat, bytesPerPixel;
private boolean reversedChannels;
private final ByteBuffer data;
-
+
/** Returns the color space of the pixel data */
public ColorSpace getColorSpace() { return pixelStorage.storageCS; }
@@ -157,10 +157,10 @@ public class JPEGImage {
/** Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected. */
public boolean getHasReversedChannels() { return reversedChannels; }
-
+
/** Returns the OpenGL format for this texture; e.g. GL.GL_LUMINANCE, GL.GL_RGB or GL.GL_RGBA. */
public int getGLFormat() { return glFormat; }
-
+
/** Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE. */
public int getGLType() { return GL.GL_UNSIGNED_BYTE; }
@@ -170,6 +170,6 @@ public class JPEGImage {
/** Returns the raw data for this texture in the correct
(bottom-to-top) order for calls to glTexImage2D. */
public ByteBuffer getData() { return data; }
-
+
public String toString() { return "JPEGImage["+pixelWidth+"x"+pixelHeight+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+pixelStorage+", "+data+"]"; }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
index b7262aa3e..4020ab3c0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -148,7 +148,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
}
public final int readUnsignedShort() throws IOException
- {
+ {
int ch1 = dataIn.read();
int ch2 = dataIn.read();
if ((ch1 | ch2) < 0)
@@ -195,7 +195,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
/**
* dont call this it is not implemented.
- * @return empty new string
+ * @return empty new string
**/
public final String readLine() throws IOException
{
@@ -204,7 +204,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
/**
* dont call this it is not implemented
- * @return empty new string
+ * @return empty new string
**/
public final String readUTF() throws IOException
{
@@ -213,7 +213,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
/**
* dont call this it is not implemented
- * @return empty new string
+ * @return empty new string
**/
public final static String readUTF(DataInput in) throws IOException
{
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
index e1e1ca924..a7101a576 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
index cd42a1157..43b8eebe6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -87,8 +87,8 @@ public class NetPbmTextureWriter implements TextureWriter {
public boolean write(File file, TextureData data) throws IOException {
boolean res;
final int magic_old = magic;
-
- // file suffix selection
+
+ // file suffix selection
if (0==magic) {
if (PPM.equals(IOUtil.getFileSuffix(file))) {
magic = 6;
@@ -97,7 +97,7 @@ public class NetPbmTextureWriter implements TextureWriter {
} else {
return false;
}
- }
+ }
try {
res = writeImpl(file, data);
} finally {
@@ -105,7 +105,7 @@ public class NetPbmTextureWriter implements TextureWriter {
}
return res;
}
-
+
private boolean writeImpl(File file, TextureData data) throws IOException {
int pixelFormat = data.getPixelFormat();
final int pixelType = data.getPixelType();
@@ -115,16 +115,16 @@ public class NetPbmTextureWriter implements TextureWriter {
pixelFormat == GL.GL_BGRA ) &&
(pixelType == GL.GL_BYTE ||
pixelType == GL.GL_UNSIGNED_BYTE)) {
-
+
ByteBuffer buf = (ByteBuffer) data.getBuffer();
if (null == buf ) {
buf = (ByteBuffer) data.getMipmapData()[0];
}
buf.rewind();
-
+
int comps = ( pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA ) ? 4 : 3 ;
-
- if( pixelFormat == GL2.GL_BGR || pixelFormat == GL.GL_BGRA ) {
+
+ if( pixelFormat == GL2.GL_BGR || pixelFormat == GL.GL_BGRA ) {
// Must reverse order of red and blue channels to get correct results
for (int i = 0; i < buf.remaining(); i += comps) {
byte red = buf.get(i + 0);
@@ -141,7 +141,7 @@ public class NetPbmTextureWriter implements TextureWriter {
}
FileOutputStream fos = IOUtil.getFileOutputStream(file, true);
-
+
StringBuilder header = new StringBuilder();
header.append("P");
header.append(magic);
@@ -171,7 +171,7 @@ public class NetPbmTextureWriter implements TextureWriter {
}
fos.write(header.toString().getBytes());
-
+
FileChannel fosc = fos.getChannel();
fosc.write(buf);
fosc.force(true);
@@ -180,7 +180,7 @@ public class NetPbmTextureWriter implements TextureWriter {
buf.rewind();
return true;
- }
+ }
throw new IOException("NetPbmTextureWriter writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
}
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
index 0f4559036..bfde1bfac 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/PNGImage.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -51,15 +51,15 @@ import com.jogamp.common.nio.Buffers;
import com.jogamp.common.util.IOUtil;
public class PNGImage {
- private static final boolean DEBUG = Debug.debug("PNGImage");
-
+ private static final boolean DEBUG = Debug.debug("PNGImage");
+
/**
* Creates a PNGImage from data supplied by the end user. Shares
* data with the passed ByteBuffer. Assumes the data is already in
* the correct byte order for writing to disk, i.e., LUMINANCE, RGB or RGBA.
* Orientation is <i>bottom-to-top</i> (OpenGL coord. default)
* or <i>top-to-bottom</i> depending on <code>isGLOriented</code>.
- *
+ *
* @param width
* @param height
* @param dpiX
@@ -74,17 +74,17 @@ public class PNGImage {
int bytesPerPixel, boolean reversedChannels, boolean isGLOriented, ByteBuffer data) {
return new PNGImage(width, height, dpiX, dpiY, bytesPerPixel, reversedChannels, isGLOriented, data);
}
-
- /**
+
+ /**
* Reads a PNG image from the specified InputStream.
* <p>
* Implicitly flip image to GL orientation, see {@link #isGLOriented()}.
- * </p>
+ * </p>
*/
public static PNGImage read(InputStream in) throws IOException {
return new PNGImage(in);
}
-
+
/** Reverse read and store, implicitly flip image to GL orientation, see {@link #isGLOriented()}. */
private static final int getPixelRGBA8(ByteBuffer d, int dOff, int[] scanline, int lineOff, boolean hasAlpha) {
final int b = hasAlpha ? 4-1 : 3-1;
@@ -95,11 +95,11 @@ public class PNGImage {
d.put(dOff--, (byte)scanline[lineOff + 3]); // A
}
d.put(dOff--, (byte)scanline[lineOff + 2]); // B
- d.put(dOff--, (byte)scanline[lineOff + 1]); // G
+ d.put(dOff--, (byte)scanline[lineOff + 1]); // G
d.put(dOff--, (byte)scanline[lineOff ]); // R
return dOff;
}
-
+
/** Reverse write and store, implicitly flip image from current orientation, see {@link #isGLOriented()}. Handle reversed channels (BGR[A]). */
private int setPixelRGBA8(ImageLine line, int lineOff, ByteBuffer d, int dOff, boolean hasAlpha) {
final int b = hasAlpha ? 4-1 : 3-1;
@@ -138,9 +138,9 @@ public class PNGImage {
this.bytesPerPixel = bytesPerPixel;
this.reversedChannels = reversedChannels;
this.isGLOriented = isGLOriented;
- this.data = data;
+ this.data = data;
}
-
+
private PNGImage(InputStream in) {
final PngReader pngr = new PngReader(new BufferedInputStream(in), null);
final ImageInfo imgInfo = pngr.imgInfo;
@@ -148,12 +148,12 @@ public class PNGImage {
final PngChunkTRNS trns = pngr.getMetadata().getTRNS();
final boolean indexed = imgInfo.indexed;
final boolean hasAlpha = indexed ? ( trns != null ) : imgInfo.alpha ;
-
+
final int channels = indexed ? ( hasAlpha ? 4 : 3 ) : imgInfo.channels ;
if ( ! ( 1 == channels || 3 == channels || 4 == channels ) ) {
throw new RuntimeException("PNGImage can only handle Lum/RGB/RGBA [1/3/4 channels] images for now. Channels "+channels + " Paletted: " + indexed);
}
-
+
bytesPerPixel = indexed ? channels : imgInfo.bytesPixel ;
if ( ! ( 1 == bytesPerPixel || 3 == bytesPerPixel || 4 == bytesPerPixel ) ) {
throw new RuntimeException("PNGImage can only handle Lum/RGB/RGBA [1/3/4 bpp] images for now. BytesPerPixel "+bytesPerPixel);
@@ -189,14 +189,14 @@ public class PNGImage {
", bytesPerPixel "+bytesPerPixel+"/"+imgInfo.bytesPixel+
", pixels "+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+"x"+dpi[1]+", glFormat 0x"+Integer.toHexString(glFormat));
}
-
+
data = Buffers.newDirectByteBuffer(bytesPerPixel * pixelWidth * pixelHeight);
reversedChannels = false; // RGB[A]
isGLOriented = true;
int dataOff = bytesPerPixel * pixelWidth * pixelHeight - 1; // start at end-of-buffer, reverse store
int[] rgbaScanline = indexed ? new int[imgInfo.cols * channels] : null;
-
+
for (int row = 0; row < pixelHeight; row++) {
final ImageLine l1 = pngr.readRow(row);
int lineOff = ( pixelWidth - 1 ) * bytesPerPixel ; // start w/ last pixel in line, reverse read (PNG top-left -> OpenGL bottom-left origin)
@@ -224,7 +224,7 @@ public class PNGImage {
private final boolean isGLOriented;
private final double[] dpi;
private final ByteBuffer data;
-
+
/** Returns the width of the image. */
public int getWidth() { return pixelWidth; }
@@ -233,23 +233,23 @@ public class PNGImage {
/** Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected. */
public boolean getHasReversedChannels() { return reversedChannels; }
-
+
/**
- * Returns <code>true</code> if the drawable is rendered in
+ * Returns <code>true</code> if the drawable is rendered in
* OpenGL's coordinate system, <i>origin at bottom left</i>.
* Otherwise returns <code>false</code>, i.e. <i>origin at top left</i>.
* <p>
* Default impl. is <code>true</code>, i.e. OpenGL coordinate system.
- * </p>
+ * </p>
*/
public boolean isGLOriented() { return isGLOriented; }
-
+
/** Returns the dpi of the image. */
public double[] getDpi() { return dpi; }
-
+
/** Returns the OpenGL format for this texture; e.g. GL.GL_LUMINANCE, GL.GL_RGB or GL.GL_RGBA. */
public int getGLFormat() { return glFormat; }
-
+
/** Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE. */
public int getGLType() { return GL.GL_UNSIGNED_BYTE; }
@@ -260,12 +260,12 @@ public class PNGImage {
(bottom-to-top) order for calls to glTexImage2D. */
public ByteBuffer getData() { return data; }
- public void write(File out, boolean allowOverwrite) throws IOException {
- final ImageInfo imi = new ImageInfo(pixelWidth, pixelHeight, 8, (4 == bytesPerPixel) ? true : false); // 8 bits per channel, no alpha
+ public void write(File out, boolean allowOverwrite) throws IOException {
+ final ImageInfo imi = new ImageInfo(pixelWidth, pixelHeight, 8, (4 == bytesPerPixel) ? true : false); // 8 bits per channel, no alpha
// open image for writing to a output stream
final OutputStream outs = new BufferedOutputStream(IOUtil.getFileOutputStream(out, allowOverwrite));
try {
- final PngWriter png = new PngWriter(outs, imi);
+ final PngWriter png = new PngWriter(outs, imi);
// add some optional metadata (chunks)
png.getMetadata().setDpi(dpi[0], dpi[1]);
png.getMetadata().setTimeNow(0); // 0 seconds fron now = now
@@ -275,7 +275,7 @@ public class PNGImage {
final ImageLine l1 = new ImageLine(imi);
if( isGLOriented ) {
// start at last pixel at end-of-buffer, reverse read (OpenGL bottom-left -> PNG top-left origin)
- int dataOff = ( pixelWidth * bytesPerPixel * ( pixelHeight - 1 ) ) + // full lines - 1 line
+ int dataOff = ( pixelWidth * bytesPerPixel * ( pixelHeight - 1 ) ) + // full lines - 1 line
( ( pixelWidth - 1 ) * bytesPerPixel ); // one line - 1 pixel
for (int row = 0; row < pixelHeight; row++) {
int lineOff = ( pixelWidth - 1 ) * bytesPerPixel ; // start w/ last pixel in line, reverse store (OpenGL bottom-left -> PNG top-left origin)
@@ -306,13 +306,13 @@ public class PNGImage {
}
}
png.writeRow(l1, row);
- }
+ }
}
png.end();
} finally {
IOUtil.close(outs, false);
}
}
-
- public String toString() { return "PNGImage["+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+" x "+dpi[1]+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+data+"]"; }
+
+ public String toString() { return "PNGImage["+pixelWidth+"x"+pixelHeight+", dpi "+dpi[0]+" x "+dpi[1]+", bytesPerPixel "+bytesPerPixel+", reversedChannels "+reversedChannels+", "+data+"]"; }
}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
index d35330f58..fd96fba80 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
@@ -1,21 +1,21 @@
/*
* Portions Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -72,15 +72,15 @@ public class SGIImage {
byte storage; // Storage format
// 0 for uncompressed
// 1 for RLE compression
- byte bpc; // Number of bytes per pixel channel
+ byte bpc; // Number of bytes per pixel channel
// Legally 1 or 2
short dimension; // Number of dimensions
// Legally 1, 2, or 3
// 1 means a single row, XSIZE long
// 2 means a single 2D image
// 3 means multiple 2D images
- short xsize; // X size in pixels
- short ysize; // Y size in pixels
+ short xsize; // X size in pixels
+ short ysize; // Y size in pixels
short zsize; // Number of channels
// 1 indicates greyscale
// 3 indicates RGB
@@ -233,7 +233,7 @@ public class SGIImage {
//----------------------------------------------------------------------
// Internals only below this point
//
-
+
private void decodeImage(DataInputStream in) throws IOException {
if (header.storage == 1) {
// Read RLE compression data; row starts and sizes
@@ -478,7 +478,7 @@ public class SGIImage {
for (int z = 0; z < zsize; z++) {
for (int y = ystart; y != yend; y += yincr) {
// RLE-compress each row.
-
+
int x = 0;
byte count = 0;
boolean repeat_mode = false;
@@ -486,7 +486,7 @@ public class SGIImage {
int start_ptr = ptr;
int num_ptr = ptr++;
byte repeat_val = 0;
-
+
while (x < xsize) {
// see if we should switch modes
should_switch = false;
@@ -503,7 +503,7 @@ public class SGIImage {
if (DEBUG)
System.err.println("left side was " + ((int) imgref(data, x, y, z, xsize, ysize, zsize)) +
", right side was " + (int)imgref(data, x+i, y, z, xsize, ysize, zsize));
-
+
if (imgref(data, x, y, z, xsize, ysize, zsize) !=
imgref(data, x+i, y, z, xsize, ysize, zsize))
should_switch = false;
@@ -531,7 +531,7 @@ public class SGIImage {
repeat_mode = true;
repeat_val = imgref(data, x, y, z, xsize, ysize, zsize);
}
-
+
if (x > 0) {
// reset the number pointer
num_ptr = ptr++;
@@ -539,7 +539,7 @@ public class SGIImage {
count = 0;
}
}
-
+
// if not in repeat mode, copy element to ptr
if (!repeat_mode) {
rlebuf[ptr++] = imgref(data, x, y, z, xsize, ysize, zsize);
@@ -581,8 +581,8 @@ public class SGIImage {
// Now we have the offset tables computed, as well as the RLE data.
// Output this information to the file.
total_size = ptr;
-
- if (DEBUG)
+
+ if (DEBUG)
System.err.println("total_size was " + total_size);
DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(IOUtil.getFileOutputStream(file, true)));
@@ -604,7 +604,7 @@ public class SGIImage {
byte[] dest = new byte[16384];
int pos = 0;
int numRead = 0;
-
+
boolean done = false;
do {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
index 2ff3b9cf0..df9430a26 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -146,9 +146,9 @@ public class TGAImage {
tgaType = TYPE_OLD; // dont try and get footer.
// initial header fields
- idLength = in.readUnsignedByte();
+ idLength = in.readUnsignedByte();
colorMapType = in.readUnsignedByte();
- imageType = in.readUnsignedByte();
+ imageType = in.readUnsignedByte();
// color map header fields
firstEntryIndex = in.readUnsignedShort();
@@ -288,14 +288,14 @@ public class TGAImage {
throw new IOException("TGADecoder Compressed Grayscale images not supported");
}
}
-
+
/**
* This assumes that the body is for a 24 bit or 32 bit for a
* RGB or ARGB image respectively.
*/
private void decodeRGBImageU24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
setupImage24_32(glp);
-
+
int i; // row index
int y; // output row index
int rawWidth = header.width() * bpp;
@@ -317,14 +317,14 @@ public class TGAImage {
swapBGR(tmpData, rawWidth, header.height(), bpp);
data = ByteBuffer.wrap(tmpData);
}
-
+
/**
* This assumes that the body is for a 24 bit or 32 bit for a
* RGB or ARGB image respectively.
*/
private void decodeRGBImageRLE24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
setupImage24_32(glp);
-
+
byte[] pixel = new byte[bpp];
int rawWidth = header.width() * bpp;
byte[] tmpData = new byte[rawWidth * header.height()];
@@ -341,17 +341,17 @@ public class TGAImage {
dIn.read(tmpData, i, len * bpp);
i += bpp * len;
}
-
+
if(format == GL.GL_RGB || format == GL.GL_RGBA)
swapBGR(tmpData, rawWidth, header.height(), bpp);
data = ByteBuffer.wrap(tmpData);
}
-
+
private void setupImage24_32(GLProfile glp) {
bpp = header.pixelDepth / 8;
switch (header.pixelDepth) {
- case 24:
- format = glp.isGL2GL3() ? GL2GL3.GL_BGR : GL.GL_RGB;
+ case 24:
+ format = glp.isGL2GL3() ? GL2GL3.GL_BGR : GL.GL_RGB;
break;
case 32:
boolean useBGRA = glp.isGL2GL3();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java
index 88018edbe..0299531b1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureProvider.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java
index 55527cef5..35b8efa72 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TextureWriter.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
index 6e2f1b992..f23cb74bf 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
index 89d0d20a1..438ab6cc2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -113,7 +113,7 @@ public class IIOTextureWriter implements TextureWriter {
return ImageIO.write(image, IOUtil.getFileSuffix(file), file);
}
-
+
throw new IOException("ImageIO writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
}
}