Package com.jogamp.opengl.util.awt
Class AWTGLReadBufferUtil
- java.lang.Object
-
- com.jogamp.opengl.util.GLReadBufferUtil
-
- com.jogamp.opengl.util.awt.AWTGLReadBufferUtil
-
public class AWTGLReadBufferUtil extends GLReadBufferUtil
GLReadBufferUtil
specialization allowing to read out a frambuffer to an AWT BufferedImage utilizingAWTPixelBufferProviderInt
for further AWT processing.
-
-
Constructor Summary
Constructors Constructor Description AWTGLReadBufferUtil(GLProfile glp, boolean requestAlpha)
Using the AWTGLPixelBuffer
:AWTGLPixelBuffer.AWTGLPixelBufferProvider
, always using alpha on OpenGL operations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AWTGLPixelBuffer
getAWTGLPixelBuffer()
Returns theAWTGLPixelBuffer
, as filled by previous call toGLReadBufferUtil.readPixels(GL, int, int, int, int, boolean)
.BufferedImage
readPixelsToBufferedImage(GL gl, boolean awtOrientation)
Read the drawable's pixels to TextureData and Texture, if requested at construction, and returns an alignedBufferedImage
.BufferedImage
readPixelsToBufferedImage(GL gl, int inX, int inY, int inWidth, int inHeight, boolean awtOrientation)
Read the drawable's pixels to TextureData and Texture, if requested at construction, and returns an alignedBufferedImage
.-
Methods inherited from class com.jogamp.opengl.util.GLReadBufferUtil
dispose, getGLPixelStorageModes, getPixelBuffer, getPixelBufferProvider, getTexture, getTextureData, hasAlpha, isValid, readPixels, readPixels, rewindPixelBuffer, write
-
-
-
-
Constructor Detail
-
AWTGLReadBufferUtil
public AWTGLReadBufferUtil(GLProfile glp, boolean requestAlpha)
Using the AWTGLPixelBuffer
:AWTGLPixelBuffer.AWTGLPixelBufferProvider
, always using alpha on OpenGL operations.The host
PixelFormat
will be a 32bit INT compatible to AWT, capable to store the GL RGBA read data, regardless whether AWT utilizes the alpha component.- Parameters:
requestAlpha
- true for RGBA readPixels, otherwise RGB readPixels. Disclaimer:GLReadBufferUtil.hasAlpha()
==true is forced due to the usedAWTGLPixelBuffer.AWTGLPixelBufferProvider
when callingreadPixels
.
-
-
Method Detail
-
getAWTGLPixelBuffer
public AWTGLPixelBuffer getAWTGLPixelBuffer()
Returns theAWTGLPixelBuffer
, as filled by previous call toGLReadBufferUtil.readPixels(GL, int, int, int, int, boolean)
.
-
readPixelsToBufferedImage
public BufferedImage readPixelsToBufferedImage(GL gl, boolean awtOrientation)
Read the drawable's pixels to TextureData and Texture, if requested at construction, and returns an alignedBufferedImage
.- Parameters:
gl
- the current GL context object. It's read drawable is being used as the pixel source.awtOrientation
- flips the data vertically iftrue
. The context's drawableGLDrawable.isGLOriented()
state is taken into account. Vertical flipping is propagated to TextureData and handled in a efficient manner there (TextureCoordinates and TextureIO writer).- See Also:
AWTGLReadBufferUtil(GLProfile, boolean)
-
readPixelsToBufferedImage
public BufferedImage readPixelsToBufferedImage(GL gl, int inX, int inY, int inWidth, int inHeight, boolean awtOrientation)
Read the drawable's pixels to TextureData and Texture, if requested at construction, and returns an alignedBufferedImage
.- Parameters:
gl
- the current GL context object. It's read drawable is being used as the pixel source.inX
- readPixel x offsetinY
- readPixel y offsetinWidth
- optional readPixel width value, used if [1 .. drawable.width], otherwise using drawable.widthinHeight
- optional readPixel height, used if [1 .. drawable.height], otherwise using drawable.heightawtOrientation
- flips the data vertically iftrue
. The context's drawableGLDrawable.isGLOriented()
state is taken into account. Vertical flipping is propagated to TextureData and handled in a efficient manner there (TextureCoordinates and TextureIO writer).- See Also:
AWTGLReadBufferUtil(GLProfile, boolean)
-
-