public class AWTGLReadBufferUtil extends GLReadBufferUtil
GLReadBufferUtil
specialization allowing to
read out a frambuffer to an AWT BufferedImage
utilizing AWTPixelBufferProviderInt
for further AWT processing.Constructor and Description |
---|
AWTGLReadBufferUtil(GLProfile glp,
boolean alpha) |
Modifier and Type | Method and Description |
---|---|
AWTGLPixelBuffer |
getAWTGLPixelBuffer()
Returns the
AWTGLPixelBuffer , as filled by previous call to GLReadBufferUtil.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 aligned
BufferedImage . |
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 aligned
BufferedImage . |
dispose, getGLPixelStorageModes, getPixelBuffer, getPixelBufferProvider, getTexture, getTextureData, hasAlpha, isValid, readPixels, readPixels, rewindPixelBuffer, write
public AWTGLReadBufferUtil(GLProfile glp, boolean alpha)
alpha
- public AWTGLPixelBuffer getAWTGLPixelBuffer()
AWTGLPixelBuffer
, as filled by previous call to GLReadBufferUtil.readPixels(GL, int, int, int, int, boolean)
.public BufferedImage readPixelsToBufferedImage(GL gl, boolean awtOrientation)
BufferedImage
.gl
- the current GL context object. It's read drawable is being used as the pixel source.awtOrientation
- flips the data vertically if true
.
The context's drawable GLDrawable.isGLOriented()
state
is taken into account.
Vertical flipping is propagated to TextureData
and handled in a efficient manner there (TextureCoordinates and TextureIO writer).AWTGLReadBufferUtil(GLProfile, boolean)
public BufferedImage readPixelsToBufferedImage(GL gl, int inX, int inY, int inWidth, int inHeight, boolean awtOrientation)
BufferedImage
.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 if true
.
The context's drawable GLDrawable.isGLOriented()
state
is taken into account.
Vertical flipping is propagated to TextureData
and handled in a efficient manner there (TextureCoordinates and TextureIO writer).AWTGLReadBufferUtil(GLProfile, boolean)
Copyright 2010 JogAmp Community.