|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
OpenGL pixel data buffer, allowing user to provide buffers via their GLPixelBufferProvider implementation.
More...
Classes | |
| class | DefaultGLPixelBufferProvider |
| class | GLPixelAttributes |
| Pixel attributes. More... | |
| interface | GLPixelBufferProvider |
Allows user to interface with another toolkit to define GLPixelAttributes and memory buffer to produce TextureData. More... | |
| interface | SingletonGLPixelBufferProvider |
Single GLPixelBuffer provider. More... | |
Public Member Functions | |
| 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 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... | |
Static Public Attributes | |
| 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... | |
OpenGL pixel data buffer, allowing user to provide buffers via their GLPixelBufferProvider implementation.
GLPixelBufferProvider produces a GLPixelBuffer.
You may use defaultProviderNoRowStride.
Definition at line 54 of file GLPixelBuffer.java.
| com.jogamp.opengl.util.GLPixelBuffer.GLPixelBuffer | ( | final GLPixelAttributes | pixelAttributes, |
| final boolean | pack, | ||
| final int | width, | ||
| final int | height, | ||
| final int | depth, | ||
| final Buffer | buffer, | ||
| final boolean | allowRowStride | ||
| ) |
| pixelAttributes | the desired GLPixelAttributes |
| pack | true for read mode GPU -> CPU, e.g. glReadPixels. false for write mode CPU -> GPU, e.g. glTexImage2D. |
| width | in pixels |
| height | in pixels |
| depth | in pixels |
| buffer | the backing array |
| allowRowStride | If true, allow row-stride, otherwise not. See requiresNewBuffer(GL, int, int, int). |
| hostPixelComp | the host PixelFormat.Composition |
Definition at line 592 of file GLPixelBuffer.java.
| int com.jogamp.opengl.util.GLPixelBuffer.capacity | ( | ) |
Returns the byte capacity of the buffer.
Definition at line 628 of file GLPixelBuffer.java.
| Buffer com.jogamp.opengl.util.GLPixelBuffer.clear | ( | ) |
See Buffer#clear().
Definition at line 643 of file GLPixelBuffer.java.
| void com.jogamp.opengl.util.GLPixelBuffer.dispose | ( | ) |
Dispose resources.
See isValid().
Reimplemented in com.jogamp.opengl.util.awt.AWTGLPixelBuffer.
Definition at line 689 of file GLPixelBuffer.java.
| Buffer com.jogamp.opengl.util.GLPixelBuffer.flip | ( | ) |
See Buffer#flip().
Definition at line 638 of file GLPixelBuffer.java.
| final boolean com.jogamp.opengl.util.GLPixelBuffer.getAllowRowStride | ( | ) |
Allow GL2ES3#GL_PACK_ROW_LENGTH, or GL2ES2#GL_UNPACK_ROW_LENGTH.
Definition at line 605 of file GLPixelBuffer.java.
| boolean com.jogamp.opengl.util.GLPixelBuffer.isValid | ( | ) |
Is not disposed and has byteSize > 0.
Definition at line 608 of file GLPixelBuffer.java.
| int com.jogamp.opengl.util.GLPixelBuffer.limit | ( | ) |
Returns the byte limit of the buffer.
Definition at line 633 of file GLPixelBuffer.java.
| int com.jogamp.opengl.util.GLPixelBuffer.position | ( | ) |
Returns the byte position of the buffer.
Definition at line 618 of file GLPixelBuffer.java.
| Buffer com.jogamp.opengl.util.GLPixelBuffer.position | ( | final int | bytePos | ) |
Sets the byte position of the buffer.
Definition at line 623 of file GLPixelBuffer.java.
| boolean com.jogamp.opengl.util.GLPixelBuffer.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.
It is assumed that pixelAttributes, depth and pack stays the same!
The minimum required byte size equals to minByteSize, if > 0, otherwise GLBuffers.sizeof(..) is being used to calculate it. This value is referred to newByteSize.
If , method returns allowRowStride = falsetrue if the newByteSize > currentByteSize or the newWidth != currentWidth.
If , see allowRowStride = trueGLPixelBufferProvider#getAllowRowStride(), method returns true only if the newByteSize > currentByteSize. Assuming user utilizes the row-stride when dealing w/ the data, i.e. GL2ES3#GL_PACK_ROW_LENGTH.
| gl | the corresponding current GL context object |
| newWidth | new width in pixels |
| newHeight | new height in pixels |
| newByteSize | if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore. |
Definition at line 674 of file GLPixelBuffer.java.
| Buffer com.jogamp.opengl.util.GLPixelBuffer.rewind | ( | ) |
See Buffer#rewind().
Definition at line 613 of file GLPixelBuffer.java.
| String com.jogamp.opengl.util.GLPixelBuffer.toString | ( | ) |
Reimplemented in com.jogamp.opengl.util.awt.AWTGLPixelBuffer.
Definition at line 577 of file GLPixelBuffer.java.
| StringBuilder com.jogamp.opengl.util.GLPixelBuffer.toString | ( | StringBuilder | sb | ) |
Reimplemented in com.jogamp.opengl.util.awt.AWTGLPixelBuffer.
Definition at line 567 of file GLPixelBuffer.java.
| final boolean com.jogamp.opengl.util.GLPixelBuffer.allowRowStride |
Allow GL2ES3#GL_PACK_ROW_LENGTH, or GL2ES2#GL_UNPACK_ROW_LENGTH.
See requiresNewBuffer(GL, int, int, int).
Definition at line 563 of file GLPixelBuffer.java.
| final Buffer com.jogamp.opengl.util.GLPixelBuffer.buffer |
Buffer holding the pixel data.
If rewind(), it holds byteSize Buffer#remaining() bytes.
By default the Buffer is a ByteBuffer, due to DefProvider#allocate(GL, PixelFormat.Composition, GLPixelAttributes, boolean, int, int, int, int). However, other GLPixelBufferProvider may utilize different Buffer types.
Definition at line 558 of file GLPixelBuffer.java.
| final int com.jogamp.opengl.util.GLPixelBuffer.bufferElemSize |
Buffer element size in bytes.
Definition at line 560 of file GLPixelBuffer.java.
| final int com.jogamp.opengl.util.GLPixelBuffer.byteSize |
Byte size of the buffer.
Actually the number of Buffer#remaining() bytes when passed in ctor.
Definition at line 550 of file GLPixelBuffer.java.
|
static |
Default GLPixelBufferProvider with GLPixelBufferProvider#getAllowRowStride() == false, utilizing best match for GLPixelAttributes and allocating a ByteBuffer.
Definition at line 217 of file GLPixelBuffer.java.
|
static |
Default GLPixelBufferProvider with GLPixelBufferProvider#getAllowRowStride() == true, utilizing best match for GLPixelAttributes and allocating a ByteBuffer.
Definition at line 224 of file GLPixelBuffer.java.
| final int com.jogamp.opengl.util.GLPixelBuffer.depth |
Depth in pixels.
Definition at line 542 of file GLPixelBuffer.java.
| final int com.jogamp.opengl.util.GLPixelBuffer.height |
Height in pixels, representing buffer's byteSize.
May not represent actual image height as user may re-use buffer for different dimensions, see requiresNewBuffer(GL, int, int, int).
Definition at line 540 of file GLPixelBuffer.java.
| final boolean com.jogamp.opengl.util.GLPixelBuffer.pack |
Data packing direction.
true for read mode GPU -> CPU, e.g. glReadPixels.
false for write mode CPU -> GPU, e.g. glTexImage2D.
Definition at line 548 of file GLPixelBuffer.java.
| final GLPixelAttributes com.jogamp.opengl.util.GLPixelBuffer.pixelAttributes |
The GLPixelAttributes.
Definition at line 526 of file GLPixelBuffer.java.
| final int com.jogamp.opengl.util.GLPixelBuffer.width |
Width in pixels, representing buffer's byteSize.
May not represent actual image width as user may re-use buffer for different dimensions, see requiresNewBuffer(GL, int, int, int).
Definition at line 533 of file GLPixelBuffer.java.