From b464faaae70ba12e5842b901a6c6d1601af0e1c7 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Mon, 9 Jan 2006 02:37:43 +0000 Subject: Added output support to TGAImage, SGIImage and newly-renamed DDSImage classes. Added support to TextureIO for writing textures back to disk via new TextureWriter plug-in interface. Added TextureConvert demo which shows how an application might convert between arbitrary file formats using these APIs, including automatic compression to DXT3 format when available. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@525 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/utils/TextureData.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/classes/com/sun/opengl/utils/TextureData.java') diff --git a/src/classes/com/sun/opengl/utils/TextureData.java b/src/classes/com/sun/opengl/utils/TextureData.java index a6fcd9073..6bb459432 100755 --- a/src/classes/com/sun/opengl/utils/TextureData.java +++ b/src/classes/com/sun/opengl/utils/TextureData.java @@ -316,16 +316,7 @@ public class TextureData { private void createNIOBufferFromImage(BufferedImage image, boolean flipVertically) { if (flipVertically) { - WritableRaster raster = image.getRaster(); - Object scanline1 = null; - Object scanline2 = null; - - for (int i = 0; i < image.getHeight() / 2; i++) { - scanline1 = raster.getDataElements(0, i, image.getWidth(), 1, scanline1); - scanline2 = raster.getDataElements(0, image.getHeight() - i - 1, image.getWidth(), 1, scanline2); - raster.setDataElements(0, i, image.getWidth(), 1, scanline2); - raster.setDataElements(0, image.getHeight() - i - 1, image.getWidth(), 1, scanline1); - } + TextureIO.flipImageVertically(image); } // -- cgit v1.2.3