Bug 192 - Add Alpha to com.sun.opengl.utils.Screenshot.java
Summary: Add Alpha to com.sun.opengl.utils.Screenshot.java
Status: VERIFIED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All all
: P3 normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2006-01-17 11:26 CET by Sven Gothel
Modified: 2015-09-27 03:09 CEST (History)
0 users

See Also:
Type: DEFECT
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2010-03-24 07:48:17 CET


---- Reported by jburks 2006-01-17 11:26:28 ----

Be able to capture using the com.sun.opengl.utils.Screenshot with an alpha value

Inside the readToBufferedImage method change:

BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_3BYTE_BGR);

to

BufferedImage image = new BufferedImage(width,
height,BufferedImage.TYPE_4BYTE_ABGR);

And 

gl.glReadPixels(0, 0, width, height, GL.GL_BGR,
GL.GL_UNSIGNED_BYTE,ByteBuffer.wrap(((DataBufferByte)image.getRaster().getDataBuffer()).getData()));

to

gl.glReadPixels(0, 0, width,
height,GL.GL_ABGR_EXT,GL.GL_UNSIGNED_BYTE,ByteBuffer.wrap(((DataBufferByte)image.getRaster().getDataBuffer()).getData()));



---- Additional Comments From kbr 2006-01-22 13:49:29 ----

Added variants to all screenshot functions taking boolean alpha. Rewrote
original entry points in terms of new ones passing false for alpha parameter.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:48 EDT  ---

This bug was previously known as _bug_ 192 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=192