From 7ade22d917152d9dec9721d772a5b31b27c768e9 Mon Sep 17 00:00:00 2001 From: Hannes Janetzek Date: Tue, 23 Jul 2013 21:43:31 +0200 Subject: [PATCH] fix for non-ARGB AWT bitmap --- vtm-gdx-desktop/src/org/oscim/awt/AwtBitmap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vtm-gdx-desktop/src/org/oscim/awt/AwtBitmap.java b/vtm-gdx-desktop/src/org/oscim/awt/AwtBitmap.java index e07d3623..fb30e3df 100644 --- a/vtm-gdx-desktop/src/org/oscim/awt/AwtBitmap.java +++ b/vtm-gdx-desktop/src/org/oscim/awt/AwtBitmap.java @@ -31,7 +31,7 @@ public class AwtBitmap implements Bitmap { this.bitmap = ImageIO.read(inputStream); this.width = this.bitmap.getWidth(); this.height = this.bitmap.getHeight(); - if (!this.bitmap.isAlphaPremultiplied()) + if (!this.bitmap.isAlphaPremultiplied() && this.bitmap.getType() == BufferedImage.TYPE_INT_ARGB) this.bitmap.coerceData(true); } @@ -71,6 +71,7 @@ public class AwtBitmap implements Bitmap { buffer = BufferUtils.newIntBuffer(width * height); } + // FIXME dont convert to argb when there data is greyscale bitmap.getRGB(0, 0, width, height, pixels, 0, width); for (int i = 0, n = width * height; i < n; i++){ @@ -90,6 +91,5 @@ public class AwtBitmap implements Bitmap { @Override public void recycle() { - // TODO Auto-generated method stub } }