Package com.jogamp.opengl.util
Interface GLPixelBuffer.SingletonGLPixelBufferProvider
-
- All Superinterfaces:
GLPixelBuffer.GLPixelBufferProvider
- All Known Implementing Classes:
AWTGLPixelBuffer.SingleAWTGLPixelBufferProvider
- Enclosing class:
- GLPixelBuffer
public static interface GLPixelBuffer.SingletonGLPixelBufferProvider extends GLPixelBuffer.GLPixelBufferProvider
SingleGLPixelBuffer
provider.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GLPixelBuffer
allocate(GL gl, PixelFormat.Composition hostPixComp, GLPixelBuffer.GLPixelAttributes pixelAttributes, boolean pack, int width, int height, int depth, int minByteSize)
Allocates a newGLPixelBuffer
object.void
dispose()
Dispose all resources.GLPixelBuffer
getSingleBuffer(PixelFormat.Composition hostPixelComp, GLPixelBuffer.GLPixelAttributes pixelAttributes, boolean pack)
Return the lastallocated
GLPixelBuffer
matching the given parameter.GLPixelBuffer
initSingleton(GLProfile glp, int componentCount, boolean pack, int width, int height, int depth)
Initializes the singleGLPixelBuffer
w/ a given size, if not yetallocated
.-
Methods inherited from interface com.jogamp.opengl.util.GLPixelBuffer.GLPixelBufferProvider
getAllowRowStride, getAttributes, getHostPixelComp
-
-
-
-
Method Detail
-
allocate
GLPixelBuffer allocate(GL gl, PixelFormat.Composition hostPixComp, GLPixelBuffer.GLPixelAttributes pixelAttributes, boolean pack, int width, int height, int depth, int minByteSize)
Allocates a newGLPixelBuffer
object.The minimum required
remaining
byte size equals tominByteSize
, if > 0, otherwise utilizeGLBuffers.sizeof(GL, int[], int, int, int, int, int, boolean)
to calculate it.Being called to gather the initial
GLPixelBuffer
, or a new replacementGLPixelBuffer
ifGLPixelBuffer.requiresNewBuffer(GL, int, int, int)
.- Specified by:
allocate
in interfaceGLPixelBuffer.GLPixelBufferProvider
- Parameters:
gl
- the corresponding currentGL
context objecthostPixComp
- hostpixel format
, i.e. of the source or sink depending onpack
, e.g. fetched viaGLPixelBuffer.GLPixelBufferProvider.getHostPixelComp(GLProfile, int)
. Ifnull
,pixelAttributes
instance maybe used or an exception is thrown, depending on implementation semantics.pixelAttributes
- the desiredGLPixelBuffer.GLPixelAttributes
, e.g. fetched viaGLPixelBuffer.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.- See Also:
GLPixelBuffer.GLPixelBufferProvider.getHostPixelComp(GLProfile, int)
,GLPixelBuffer.GLPixelBufferProvider.getAttributes(GL, int, boolean)
-
getSingleBuffer
GLPixelBuffer getSingleBuffer(PixelFormat.Composition hostPixelComp, GLPixelBuffer.GLPixelAttributes pixelAttributes, boolean pack)
Return the lastallocated
GLPixelBuffer
matching the given parameter.May return
null
if none has been allocated yet.Returned
GLPixelBuffer
may beinvalid
.- Parameters:
hostPixComp
- hostpixel format
, i.e. of the source or sink depending onpack
, e.g. fetched viaGLPixelBuffer.GLPixelBufferProvider.getHostPixelComp(GLProfile, int)
. Ifnull
,pixelAttributes
instance maybe used or an exception is thrown, depending on implementation semantics.pixelAttributes
- the desiredGLPixelBuffer.GLPixelAttributes
, e.g. fetched viaGLPixelBuffer.GLPixelBufferProvider.getAttributes(GL, int, boolean)
pack
-true
for read mode GPU -> CPU, e.g.glReadPixels
.false
for write mode CPU -> GPU, e.g.glTexImage2D
.
-
initSingleton
GLPixelBuffer initSingleton(GLProfile glp, int componentCount, boolean pack, int width, int height, int depth)
Initializes the singleGLPixelBuffer
w/ a given size, if not yetallocated
.- Parameters:
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
-- Returns:
- the newly initialized single
GLPixelBuffer
, or null if already allocated.
-
dispose
void dispose()
Dispose all resources.
-
-