public static interface GLPixelBuffer.SingletonGLPixelBufferProvider extends GLPixelBuffer.GLPixelBufferProvider
GLPixelBuffer
provider.Modifier and Type | Method and Description |
---|---|
GLPixelBuffer |
allocate(GL gl,
PixelFormat.Composition hostPixComp,
GLPixelBuffer.GLPixelAttributes pixelAttributes,
boolean pack,
int width,
int height,
int depth,
int minByteSize)
Allocates a new
GLPixelBuffer object. |
void |
dispose()
Dispose all resources.
|
GLPixelBuffer |
getSingleBuffer(PixelFormat.Composition hostPixelComp,
GLPixelBuffer.GLPixelAttributes pixelAttributes,
boolean pack)
Return the last
allocated GLPixelBuffer
matching the given parameter. |
GLPixelBuffer |
initSingleton(GLProfile glp,
int componentCount,
boolean pack,
int width,
int height,
int depth)
Initializes the single
GLPixelBuffer w/ a given size,
if not yet allocated . |
getAllowRowStride, getAttributes, getHostPixelComp
GLPixelBuffer allocate(GL gl, PixelFormat.Composition hostPixComp, GLPixelBuffer.GLPixelAttributes pixelAttributes, boolean pack, int width, int height, int depth, int minByteSize)
GLPixelBuffer
object.
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.
Being called to gather the initial GLPixelBuffer
,
or a new replacement GLPixelBuffer
if GLPixelBuffer.requiresNewBuffer(GL, int, int, int)
.
allocate
in interface GLPixelBuffer.GLPixelBufferProvider
gl
- the corresponding current GL
context objecthostPixComp
- host pixel format
, i.e. of the source or sink depending on pack
,
e.g. fetched via GLPixelBuffer.GLPixelBufferProvider.getHostPixelComp(GLProfile, int)
.
If null
, pixelAttributes
instance maybe used or an exception is thrown,
depending on implementation semantics.pixelAttributes
- the desired GLPixelBuffer.GLPixelAttributes
, e.g. fetched via GLPixelBuffer.GLPixelBufferProvider.getAttributes(GL, int, boolean)
pack
- true
for read mode GPU -> CPU, e.g. glReadPixels
.
false
for write mode CPU -> GPU, e.g. glTexImage2D
.width
- in pixelsheight
- in pixelsdepth
- in pixelsminByteSize
- if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.GLPixelBuffer.GLPixelBufferProvider.getHostPixelComp(GLProfile, int)
,
GLPixelBuffer.GLPixelBufferProvider.getAttributes(GL, int, boolean)
GLPixelBuffer getSingleBuffer(PixelFormat.Composition hostPixelComp, GLPixelBuffer.GLPixelAttributes pixelAttributes, boolean pack)
allocated
GLPixelBuffer
matching the given parameter.
May return null
if none has been allocated yet.
Returned GLPixelBuffer
may be invalid
.
hostPixComp
- host pixel format
, i.e. of the source or sink depending on pack
,
e.g. fetched via GLPixelBuffer.GLPixelBufferProvider.getHostPixelComp(GLProfile, int)
.
If null
, pixelAttributes
instance maybe used or an exception is thrown,
depending on implementation semantics.pixelAttributes
- the desired GLPixelBuffer.GLPixelAttributes
, e.g. fetched via GLPixelBuffer.GLPixelBufferProvider.getAttributes(GL, int, boolean)
pack
- true
for read mode GPU -> CPU, e.g. glReadPixels
.
false
for write mode CPU -> GPU, e.g. glTexImage2D
.GLPixelBuffer initSingleton(GLProfile glp, int componentCount, boolean pack, int width, int height, int depth)
GLPixelBuffer
w/ a given size,
if not yet allocated
.glp
- componentCount
- RGBA component count, i.e. 1 (luminance, alpha or red), 3 (RGB) or 4 (RGBA)pack
- true
for read mode GPU -> CPU, e.g. glReadPixels
.
false
for write mode CPU -> GPU, e.g. glTexImage2D
.width
- height
- depth
- GLPixelBuffer
, or null if already allocated.void dispose()
Copyright 2010 JogAmp Community.