|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
Utility to read out the current FB to TextureData, optionally writing the data back to a texture object. More...
Public Member Functions | |
| GLReadBufferUtil (final boolean requestAlpha, final boolean write2Texture) | |
Using the default GLPixelBuffer: GLPixelBuffer#defaultProviderNoRowStride. More... | |
| GLReadBufferUtil (final GLPixelBufferProvider pixelBufferProvider, final boolean requestAlpha, final boolean write2Texture) | |
| void | setReadBuffer (final int name) |
| GLPixelBufferProvider | getPixelBufferProvider () |
Returns the GLPixelBufferProvider used by this instance. More... | |
| boolean | isValid () |
| boolean | hasAlpha () |
| Returns true if the OpenGL read data contains alpha. More... | |
| GLPixelStorageModes | getGLPixelStorageModes () |
| GLPixelBuffer | getPixelBuffer () |
Returns the GLPixelBuffer, created and filled by readPixels(GLAutoDrawable, boolean). More... | |
| void | rewindPixelBuffer () |
| rewind the raw pixel ByteBuffer More... | |
| TextureData | getTextureData () |
| Texture | getTexture () |
| void | write (final File dest) |
Write the TextureData filled by readPixels(GLAutoDrawable, boolean) to file. More... | |
| boolean | readPixels (final GL gl, final boolean mustFlipVertically) |
| Read the drawable's pixels to TextureData and Texture, if requested at construction. More... | |
| boolean | readPixels (final GL gl, final int inX, final int inY, final int inWidth, final int inHeight, final boolean mustFlipVertically) |
| Read the drawable's pixels to TextureData and Texture, if requested at construction. More... | |
| void | dispose (final GL gl) |
Protected Member Functions | |
| boolean | readPixelsImpl (final GLDrawable drawable, final GL gl, final int inX, final int inY, final int width, final int height, final boolean mustFlipVertically) |
Protected Attributes | |
| final GLPixelBufferProvider | pixelBufferProvider |
| final Texture | readTexture |
| final GLPixelStorageModes | psm |
| final boolean | alphaRequested |
| boolean | hasAlpha |
| GLPixelBuffer | readPixelBuffer = null |
| TextureData | readTextureData = null |
| int | readBuffer = -1 |
Utility to read out the current FB to TextureData, optionally writing the data back to a texture object.
May be used directly to write the TextureData to file (screenshot).
Definition at line 53 of file GLReadBufferUtil.java.
| com.jogamp.opengl.util.GLReadBufferUtil.GLReadBufferUtil | ( | final boolean | requestAlpha, |
| final boolean | write2Texture | ||
| ) |
Using the default GLPixelBuffer: GLPixelBuffer#defaultProviderNoRowStride.
| requestAlpha | true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: hasAlpha()==true maybe forced depending on the used GLPixelBufferProvider, i.e. on ES platforms, when calling readPixels. |
| write2Texture | true if readPixel's TextureData shall be written to a 2d Texture |
Definition at line 70 of file GLReadBufferUtil.java.
| com.jogamp.opengl.util.GLReadBufferUtil.GLReadBufferUtil | ( | final GLPixelBufferProvider | pixelBufferProvider, |
| final boolean | requestAlpha, | ||
| final boolean | write2Texture | ||
| ) |
| pixelBufferProvider | custom GLPixelBuffer |
| requestAlpha | true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: hasAlpha()==true maybe forced depending on the used GLPixelBufferProvider, i.e. on ES platforms, when calling readPixels. |
| write2Texture | true if readPixel's TextureData shall be written to a 2d Texture |
Definition at line 79 of file GLReadBufferUtil.java.
| void com.jogamp.opengl.util.GLReadBufferUtil.dispose | ( | final GL | gl | ) |
Definition at line 281 of file GLReadBufferUtil.java.
| GLPixelStorageModes com.jogamp.opengl.util.GLReadBufferUtil.getGLPixelStorageModes | ( | ) |
Definition at line 99 of file GLReadBufferUtil.java.
| GLPixelBuffer com.jogamp.opengl.util.GLReadBufferUtil.getPixelBuffer | ( | ) |
Returns the GLPixelBuffer, created and filled by readPixels(GLAutoDrawable, boolean).
Definition at line 104 of file GLReadBufferUtil.java.
| GLPixelBufferProvider com.jogamp.opengl.util.GLReadBufferUtil.getPixelBufferProvider | ( | ) |
Returns the GLPixelBufferProvider used by this instance.
Definition at line 90 of file GLReadBufferUtil.java.
| Texture com.jogamp.opengl.util.GLReadBufferUtil.getTexture | ( | ) |
readPixels(GLAutoDrawable, boolean), if this instance writes to a 2d Texture, otherwise null. Definition at line 121 of file GLReadBufferUtil.java.
| TextureData com.jogamp.opengl.util.GLReadBufferUtil.getTextureData | ( | ) |
readPixels(GLAutoDrawable, boolean) Definition at line 114 of file GLReadBufferUtil.java.
| boolean com.jogamp.opengl.util.GLReadBufferUtil.hasAlpha | ( | ) |
Returns true if the OpenGL read data contains alpha.
This value is lazily determined after the first call of readPixels
Definition at line 97 of file GLReadBufferUtil.java.
| boolean com.jogamp.opengl.util.GLReadBufferUtil.isValid | ( | ) |
Definition at line 92 of file GLReadBufferUtil.java.
| boolean com.jogamp.opengl.util.GLReadBufferUtil.readPixels | ( | final GL | gl, |
| final boolean | mustFlipVertically | ||
| ) |
Read the drawable's pixels to TextureData and Texture, if requested at construction.
| gl | the current GL context object. It's read drawable is being used as the pixel source. |
| mustFlipVertically | indicates whether to flip the data vertically or not. 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). |
Definition at line 147 of file GLReadBufferUtil.java.
| boolean com.jogamp.opengl.util.GLReadBufferUtil.readPixels | ( | final GL | gl, |
| final int | inX, | ||
| final int | inY, | ||
| final int | inWidth, | ||
| final int | inHeight, | ||
| final boolean | mustFlipVertically | ||
| ) |
Read the drawable's pixels to TextureData and Texture, if requested at construction.
| gl | the current GL context object. It's read drawable is being used as the pixel source. |
| inX | readPixel x offset |
| inY | readPixel y offset |
| inWidth | optional readPixel width value, used if [1 .. drawable.width], otherwise using drawable.width |
| inHeight | optional readPixel height, used if [1 .. drawable.height], otherwise using drawable.height |
| mustFlipVertically | indicates whether to flip the data vertically or not. 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). |
Definition at line 166 of file GLReadBufferUtil.java.
|
protected |
Definition at line 182 of file GLReadBufferUtil.java.
| void com.jogamp.opengl.util.GLReadBufferUtil.rewindPixelBuffer | ( | ) |
rewind the raw pixel ByteBuffer
Definition at line 109 of file GLReadBufferUtil.java.
| void com.jogamp.opengl.util.GLReadBufferUtil.setReadBuffer | ( | final int | name | ) |
Definition at line 87 of file GLReadBufferUtil.java.
| void com.jogamp.opengl.util.GLReadBufferUtil.write | ( | final File | dest | ) |
Write the TextureData filled by readPixels(GLAutoDrawable, boolean) to file.
Definition at line 126 of file GLReadBufferUtil.java.
|
protected |
Definition at line 57 of file GLReadBufferUtil.java.
|
protected |
Definition at line 59 of file GLReadBufferUtil.java.
|
protected |
Definition at line 54 of file GLReadBufferUtil.java.
|
protected |
Definition at line 56 of file GLReadBufferUtil.java.
|
protected |
Definition at line 62 of file GLReadBufferUtil.java.
|
protected |
Definition at line 60 of file GLReadBufferUtil.java.
|
protected |
Definition at line 55 of file GLReadBufferUtil.java.
|
protected |
Definition at line 61 of file GLReadBufferUtil.java.