public static class AWTGLPixelBuffer.AWTGLPixelBufferProvider extends Object implements GLPixelBuffer.GLPixelBufferProvider
AWTGLPixelBuffer
instances.Constructor and Description |
---|
AWTGLPixelBuffer.AWTGLPixelBufferProvider(boolean allowRowStride) |
Modifier and Type | Method and Description |
---|---|
AWTGLPixelBuffer |
allocate(GL gl,
GLPixelBuffer.GLPixelAttributes pixelAttributes,
int width,
int height,
int depth,
boolean pack,
int minByteSize)
Allocates a new
GLPixelBuffer object. |
boolean |
getAllowRowStride()
|
GLPixelBuffer.GLPixelAttributes |
getAttributes(GL gl,
int componentCount)
Called first to determine
GLPixelBuffer.GLPixelAttributes . |
public AWTGLPixelBuffer.AWTGLPixelBufferProvider(boolean allowRowStride)
allowRowStride
- If true
, allow row-stride, otherwise not.
See getAllowRowStride()
and GLPixelBuffer.requiresNewBuffer(GL, int, int, int)
.
If true
, user shall decide whether to use a width-aligned image
.public boolean getAllowRowStride()
GLPixelBuffer.GLPixelBufferProvider
getAllowRowStride
in interface GLPixelBuffer.GLPixelBufferProvider
public GLPixelBuffer.GLPixelAttributes getAttributes(GL gl, int componentCount)
GLPixelBuffer.GLPixelBufferProvider
GLPixelBuffer.GLPixelAttributes
.getAttributes
in interface GLPixelBuffer.GLPixelBufferProvider
public AWTGLPixelBuffer allocate(GL gl, GLPixelBuffer.GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize)
GLPixelBuffer
object.
Being called to gather the initial GLPixelBuffer
,
or a new replacement GLPixelBuffer
if GLPixelBuffer.requiresNewBuffer(GL, int, int, int)
.
The minimum required remaining
byte size equals to minByteSize
, if > 0,
otherwise utilize GLBuffers.sizeof(GL, int[], int, int, int, int, int, boolean)
to calculate it.
Returns an array backed IntBuffer
of size
width*height*SIZEOF_INT
.
allocate
in interface GLPixelBuffer.GLPixelBufferProvider
gl
- the corresponding current GL context objectpixelAttributes
- the desired GLPixelBuffer.GLPixelAttributes
width
- in pixelsheight
- in pixelsdepth
- in pixelspack
- true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPUminByteSize
- if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.Copyright 2010 JogAmp Community.