|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.opengl.util.GLPixelBuffer
public class GLPixelBuffer
OpenGL pixel data buffer, allowing user to provide buffers via their GLPixelBuffer.GLPixelBufferProvider implementation.
GLPixelBuffer.GLPixelBufferProvider produces a GLPixelBuffer.
You may use defaultProvider.
| Nested Class Summary | |
|---|---|
static class |
GLPixelBuffer.GLPixelAttributes
Pixel attributes. |
static interface |
GLPixelBuffer.GLPixelBufferProvider
Allows user to interface with another toolkit to define GLPixelBuffer.GLPixelAttributes and memory buffer to produce TextureData. |
static interface |
GLPixelBuffer.SingletonGLPixelBufferProvider
Single GLPixelBuffer provider. |
| Field Summary | |
|---|---|
Buffer |
buffer
Buffer holding the pixel data. |
int |
bufferElemSize
Buffer element size in bytes. |
int |
byteSize
Byte size of the buffer. |
static GLPixelBuffer.GLPixelBufferProvider |
defaultProvider
Default GLPixelBuffer.GLPixelBufferProvider utilizing best match for GLPixelBuffer.GLPixelAttributes
and allocating a ByteBuffer. |
int |
depth
Depth in pixels. |
int |
height
Height in pixels. |
boolean |
pack
Data packing direction. |
GLPixelBuffer.GLPixelAttributes |
pixelAttributes
The GLPixelBuffer.GLPixelAttributes. |
int |
width
Width in pixels. |
| Constructor Summary | |
|---|---|
GLPixelBuffer(GLPixelBuffer.GLPixelAttributes pixelAttributes,
int width,
int height,
int depth,
boolean pack,
Buffer buffer)
|
|
| Method Summary | |
|---|---|
Buffer |
clear()
|
void |
dispose()
Dispose resources. |
Buffer |
flip()
|
boolean |
isValid()
Is not disposed and has byteSize > 0. |
int |
position()
Returns the byte position of the buffer. |
Buffer |
position(int bytePos)
Sets the byte position of the buffer. |
boolean |
requiresNewBuffer(GL gl,
int newWidth,
int newHeight,
int minByteSize)
Returns true, if invalid or implementation requires a new buffer based on the new size
due to pixel alignment or byte size, otherwise false. |
Buffer |
rewind()
|
String |
toString()
|
StringBuffer |
toString(StringBuffer sb)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static GLPixelBuffer.GLPixelBufferProvider defaultProvider
GLPixelBuffer.GLPixelBufferProvider utilizing best match for GLPixelBuffer.GLPixelAttributes
and allocating a ByteBuffer.
public final GLPixelBuffer.GLPixelAttributes pixelAttributes
GLPixelBuffer.GLPixelAttributes.
public final int width
public final int height
public final int depth
public final boolean pack
true for read mode GPU -> CPU, false for write mode CPU -> GPU.
public final int byteSize
Buffer.remaining() bytes when passed in ctor.
public final Buffer buffer
rewind(), it holds byteSize Buffer.remaining() bytes.
By default the Buffer is a ByteBuffer, due to DefProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int).
However, other GLPixelBuffer.GLPixelBufferProvider may utilize different Buffer types.
public final int bufferElemSize
| Constructor Detail |
|---|
public GLPixelBuffer(GLPixelBuffer.GLPixelAttributes pixelAttributes,
int width,
int height,
int depth,
boolean pack,
Buffer buffer)
| Method Detail |
|---|
public StringBuffer toString(StringBuffer sb)
public String toString()
toString in class Objectpublic boolean isValid()
disposed and has byteSize > 0.
public Buffer rewind()
public int position()
buffer.
public Buffer position(int bytePos)
buffer.
public Buffer flip()
public Buffer clear()
public boolean requiresNewBuffer(GL gl,
int newWidth,
int newHeight,
int minByteSize)
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 utilize GLBuffers.sizeof(..)
to calculate it.
gl - the corresponding current GL context objectnewWidth - new width in pixelsnewHeight - new height in pixelsminByteSize - if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int)public void dispose()
isValid().
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||