public static class AWTGLPixelBuffer.SingleAWTGLPixelBufferProvider extends AWTGLPixelBuffer.AWTGLPixelBufferProvider implements GLPixelBuffer.SingletonGLPixelBufferProvider
AWTGLPixelBuffer instances.
Provider instance holds the last AWTGLPixelBuffer instance
allocated.
A new allocation
will return same instance, if a new buffer is not required.
The latter is true if size are compatible, hence allowRowStride should be enabled, if possible.
| Constructor and Description |
|---|
AWTGLPixelBuffer.SingleAWTGLPixelBufferProvider(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. |
AWTGLPixelBuffer |
getSingleBuffer(GLPixelBuffer.GLPixelAttributes pixelAttributes)
|
AWTGLPixelBuffer |
initSingleton(int componentCount,
int width,
int height,
int depth,
boolean pack)
Initializes the single
AWTGLPixelBuffer w/ a given size, if not yet allocated. |
getAllowRowStride, getAttributesequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllowRowStride, getAttributespublic AWTGLPixelBuffer.SingleAWTGLPixelBufferProvider(boolean allowRowStride)
allowRowStride - If true, allow row-stride, otherwise not. See GLPixelBuffer.requiresNewBuffer(GL, int, int, int).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.Returns an array backed
IntBufferof sizewidth*height*SIZEOF_INT.
allocate in interface GLPixelBuffer.GLPixelBufferProviderallocate in class AWTGLPixelBuffer.AWTGLPixelBufferProvidergl - the corresponding current GL context objectpixelAttributes - the desired GLPixelBuffer.GLPixelAttributeswidth - 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.public AWTGLPixelBuffer getSingleBuffer(GLPixelBuffer.GLPixelAttributes pixelAttributes)
getSingleBuffer in interface GLPixelBuffer.SingletonGLPixelBufferProviderpublic AWTGLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack)
AWTGLPixelBuffer w/ a given size, if not yet allocated.initSingleton in interface GLPixelBuffer.SingletonGLPixelBufferProviderAWTGLPixelBuffer, or null if already allocated.Copyright 2010 JogAmp Community.