|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.opengl.util.GLPixelBuffer
com.jogamp.opengl.util.awt.AWTGLPixelBuffer
public class AWTGLPixelBuffer
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 AWTGLPixelBuffer.AWTGLPixelBufferProvider's
allocate(..).
See requiresNewBuffer(GL, int, int, int) for allowRowStride details.
| Nested Class Summary | |
|---|---|
static class |
AWTGLPixelBuffer.AWTGLPixelBufferProvider
Provider for AWTGLPixelBuffer instances. |
static class |
AWTGLPixelBuffer.SingleAWTGLPixelBufferProvider
Provider for singleton AWTGLPixelBuffer instances. |
| Nested classes/interfaces inherited from class com.jogamp.opengl.util.GLPixelBuffer |
|---|
GLPixelBuffer.GLPixelAttributes, GLPixelBuffer.GLPixelBufferProvider, GLPixelBuffer.SingletonGLPixelBufferProvider |
| Field Summary | |
|---|---|
boolean |
allowRowStride
Allow GL2GL3.GL_PACK_ROW_LENGTH, or GL2ES2.GL_UNPACK_ROW_LENGTH. |
static GLPixelBuffer.GLPixelAttributes |
awtPixelAttributesIntRGB3
|
static GLPixelBuffer.GLPixelAttributes |
awtPixelAttributesIntRGBA4
|
BufferedImage |
image
The underlying BufferedImage. |
| Fields inherited from class com.jogamp.opengl.util.GLPixelBuffer |
|---|
buffer, bufferElemSize, byteSize, defaultProvider, depth, height, pack, pixelAttributes, width |
| Constructor Summary | |
|---|---|
AWTGLPixelBuffer(GLPixelBuffer.GLPixelAttributes pixelAttributes,
int width,
int height,
int depth,
boolean pack,
BufferedImage image,
Buffer buffer,
boolean allowRowStride)
|
|
| Method Summary | |
|---|---|
void |
dispose()
Dispose resources. |
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. |
String |
toString()
|
StringBuffer |
toString(StringBuffer sb)
|
| Methods inherited from class com.jogamp.opengl.util.GLPixelBuffer |
|---|
clear, flip, isValid, position, position, rewind |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final GLPixelBuffer.GLPixelAttributes awtPixelAttributesIntRGBA4
public static final GLPixelBuffer.GLPixelAttributes awtPixelAttributesIntRGB3
public final boolean allowRowStride
GL2GL3.GL_PACK_ROW_LENGTH, or GL2ES2.GL_UNPACK_ROW_LENGTH. See requiresNewBuffer(GL, int, int, int).
public final BufferedImage image
BufferedImage.
| Constructor Detail |
|---|
public AWTGLPixelBuffer(GLPixelBuffer.GLPixelAttributes pixelAttributes,
int width,
int height,
int depth,
boolean pack,
BufferedImage image,
Buffer buffer,
boolean allowRowStride)
pixelAttributes - the desired GLPixelBuffer.GLPixelAttributeswidth - in pixelsheight - in pixelsdepth - in pixelspack - true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPUimage - the AWT imagebuffer - the backing arrayallowRowStride - If true, allow row-stride, otherwise not. See requiresNewBuffer(GL, int, int, int).| Method Detail |
|---|
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.
If ,
method returns allowRowStride = falsetrue if the new size ≠ current size.
If , see allowRowStride = trueAWTGLPixelBufferProvider#AWTGLPixelBufferProvider(boolean),
method returns true only if the new size > current size. Assuming user utilizes the row-stride
when dealing w/ the data, i.e. GL2GL3.GL_PACK_ROW_LENGTH.
requiresNewBuffer in class GLPixelBuffergl - 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()
GLPixelBufferGLPixelBuffer.isValid().
dispose in class GLPixelBufferpublic StringBuffer toString(StringBuffer sb)
toString in class GLPixelBufferpublic String toString()
toString in class GLPixelBuffer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||