JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.util.awt.AWTGLPixelBuffer Class Reference

AWT GLPixelBuffer backed by an BufferedImage of type BufferedImage#TYPE_INT_ARGB or BufferedImage#TYPE_INT_RGB. More...

Inheritance diagram for com.jogamp.opengl.util.awt.AWTGLPixelBuffer:
Collaboration diagram for com.jogamp.opengl.util.awt.AWTGLPixelBuffer:

Classes

class  AWTGLPixelBufferProvider
 Provider for AWTGLPixelBuffer instances. More...
 
class  SingleAWTGLPixelBufferProvider
 Provider for singleton AWTGLPixelBuffer instances. More...
 

Public Member Functions

 AWTGLPixelBuffer (final PixelFormat.Composition hostPixelComp, final GLPixelAttributes pixelAttributes, final boolean pack, final int awtFormat, final int width, final int height, final int depth, final BufferedImage image, final Buffer buffer, final boolean allowRowStride)
 
final PixelFormat.Composition getHostPixelComp ()
 
final int getAWTFormat ()
 
void dispose ()
 Dispose resources. More...
 
BufferedImage getAlignedImage (final int width, final int height) throws IllegalArgumentException
 Returns a width- and height-aligned image representation sharing data w/ image. More...
 
final boolean isDataBufferSource (final BufferedImage imageU)
 
StringBuilder toString (StringBuilder sb)
 
String toString ()
 
- Public Member Functions inherited from com.jogamp.opengl.util.GLPixelBuffer
StringBuilder toString (StringBuilder sb)
 
String toString ()
 
 GLPixelBuffer (final GLPixelAttributes pixelAttributes, final boolean pack, final int width, final int height, final int depth, final Buffer buffer, final boolean allowRowStride)
 
final boolean getAllowRowStride ()
 Allow GL2ES3#GL_PACK_ROW_LENGTH, or GL2ES2#GL_UNPACK_ROW_LENGTH. More...
 
boolean isValid ()
 Is not disposed and has byteSize > 0. More...
 
Buffer rewind ()
 See Buffer#rewind(). More...
 
int position ()
 Returns the byte position of the buffer. More...
 
Buffer position (final int bytePos)
 Sets the byte position of the buffer. More...
 
int capacity ()
 Returns the byte capacity of the buffer. More...
 
int limit ()
 Returns the byte limit of the buffer. More...
 
Buffer flip ()
 See Buffer#flip(). More...
 
Buffer clear ()
 See Buffer#clear(). More...
 
boolean requiresNewBuffer (final GL gl, final int newWidth, final int newHeight, int newByteSize)
 Returns true, if invalid or implementation requires a new buffer based on the new size due to pixel alignment or byte size, otherwise false. More...
 
void dispose ()
 Dispose resources. More...
 

Public Attributes

final BufferedImage image
 The underlying BufferedImage. More...
 
- Public Attributes inherited from com.jogamp.opengl.util.GLPixelBuffer
final GLPixelAttributes pixelAttributes
 The GLPixelAttributes. More...
 
final int width
 Width in pixels, representing buffer's byteSize. More...
 
final int height
 Height in pixels, representing buffer's byteSize. More...
 
final int depth
 Depth in pixels. More...
 
final boolean pack
 Data packing direction. More...
 
final int byteSize
 Byte size of the buffer. More...
 
final Buffer buffer
 Buffer holding the pixel data. More...
 
final int bufferElemSize
 Buffer element size in bytes. More...
 
final boolean allowRowStride
 Allow GL2ES3#GL_PACK_ROW_LENGTH, or GL2ES2#GL_UNPACK_ROW_LENGTH. More...
 

Additional Inherited Members

- Static Public Attributes inherited from com.jogamp.opengl.util.GLPixelBuffer
static final GLPixelBufferProvider defaultProviderNoRowStride = new DefaultGLPixelBufferProvider(false)
 Default GLPixelBufferProvider with GLPixelBufferProvider#getAllowRowStride() == false, utilizing best match for GLPixelAttributes and allocating a ByteBuffer. More...
 
static final GLPixelBufferProvider defaultProviderWithRowStride = new DefaultGLPixelBufferProvider(true)
 Default GLPixelBufferProvider with GLPixelBufferProvider#getAllowRowStride() == true, utilizing best match for GLPixelAttributes and allocating a ByteBuffer. More...
 

Detailed Description

AWT GLPixelBuffer backed by an BufferedImage of type BufferedImage#TYPE_INT_ARGB or BufferedImage#TYPE_INT_RGB.

Implementation uses an array backed IntBuffer.

AWTGLPixelBuffer can be produced via AWTGLPixelBufferProvider's allocate(..).

See AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int) for allowRowStride details.

If using allowRowStride == true, user may needs to get the aligned image since requiresNewBuffer(GL, int, int, int) will allow different width in this case.

Definition at line 67 of file AWTGLPixelBuffer.java.

Constructor & Destructor Documentation

◆ AWTGLPixelBuffer()

com.jogamp.opengl.util.awt.AWTGLPixelBuffer.AWTGLPixelBuffer ( final PixelFormat.Composition  hostPixelComp,
final GLPixelAttributes  pixelAttributes,
final boolean  pack,
final int  awtFormat,
final int  width,
final int  height,
final int  depth,
final BufferedImage  image,
final Buffer  buffer,
final boolean  allowRowStride 
)
Parameters
hostPixelCompthe host PixelFormat.Composition
pixelAttributesthe desired GLPixelAttributes
packtrue for read mode GPU -> CPU, e.g. glReadPixels. false for write mode CPU -> GPU, e.g. glTexImage2D.
awtFormatthe used AWT format, i.e. AWTGLPixelBufferProvider#getAWTFormat(GLProfile, int)
widthin pixels
heightin pixels
depthin pixels
imagethe AWT image
bufferthe backing array
allowRowStrideIf true, allow row-stride, otherwise not. See requiresNewBuffer(GL, int, int, int). If true, user shall decide whether to use a width-aligned image.

Definition at line 97 of file AWTGLPixelBuffer.java.

Here is the caller graph for this function:

Member Function Documentation

◆ dispose()

void com.jogamp.opengl.util.awt.AWTGLPixelBuffer.dispose ( )

Dispose resources.

See isValid().

Reimplemented from com.jogamp.opengl.util.GLPixelBuffer.

Definition at line 112 of file AWTGLPixelBuffer.java.

Here is the caller graph for this function:

◆ getAlignedImage()

BufferedImage com.jogamp.opengl.util.awt.AWTGLPixelBuffer.getAlignedImage ( final int  width,
final int  height 
) throws IllegalArgumentException

Returns a width- and height-aligned image representation sharing data w/ image.

Parameters
width
height
Returns
Exceptions
IllegalArgumentExceptionif requested size exceeds image size

Definition at line 124 of file AWTGLPixelBuffer.java.

Here is the caller graph for this function:

◆ getAWTFormat()

final int com.jogamp.opengl.util.awt.AWTGLPixelBuffer.getAWTFormat ( )

Definition at line 109 of file AWTGLPixelBuffer.java.

◆ getHostPixelComp()

final PixelFormat.Composition com.jogamp.opengl.util.awt.AWTGLPixelBuffer.getHostPixelComp ( )

Definition at line 108 of file AWTGLPixelBuffer.java.

◆ isDataBufferSource()

final boolean com.jogamp.opengl.util.awt.AWTGLPixelBuffer.isDataBufferSource ( final BufferedImage  imageU)

Definition at line 142 of file AWTGLPixelBuffer.java.

◆ toString() [1/2]

String com.jogamp.opengl.util.awt.AWTGLPixelBuffer.toString ( )

Reimplemented from com.jogamp.opengl.util.GLPixelBuffer.

Definition at line 155 of file AWTGLPixelBuffer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString() [2/2]

StringBuilder com.jogamp.opengl.util.awt.AWTGLPixelBuffer.toString ( StringBuilder  sb)

Reimplemented from com.jogamp.opengl.util.GLPixelBuffer.

Definition at line 149 of file AWTGLPixelBuffer.java.

Member Data Documentation

◆ image

final BufferedImage com.jogamp.opengl.util.awt.AWTGLPixelBuffer.image

The underlying BufferedImage.

Definition at line 78 of file AWTGLPixelBuffer.java.


The documentation for this class was generated from the following file: