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
SingleGLPixelBufferprovider.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GLPixelBufferallocate(GL gl, PixelFormat.Composition hostPixComp, GLPixelBuffer.GLPixelAttributes pixelAttributes, boolean pack, int width, int height, int depth, int minByteSize)Allocates a newGLPixelBufferobject.voiddispose()Dispose all resources.GLPixelBuffergetSingleBuffer(PixelFormat.Composition hostPixelComp, GLPixelBuffer.GLPixelAttributes pixelAttributes, boolean pack)Return the lastallocatedGLPixelBuffermatching the given parameter.GLPixelBufferinitSingleton(GLProfile glp, int componentCount, boolean pack, int width, int height, int depth)Initializes the singleGLPixelBufferw/ 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 newGLPixelBufferobject.The minimum required
remainingbyte 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 replacementGLPixelBufferifGLPixelBuffer.requiresNewBuffer(GL, int, int, int).- Specified by:
allocatein interfaceGLPixelBuffer.GLPixelBufferProvider- Parameters:
gl- the corresponding currentGLcontext objecthostPixComp- hostpixel format, i.e. of the source or sink depending onpack, e.g. fetched viaGLPixelBuffer.GLPixelBufferProvider.getHostPixelComp(GLProfile, int). Ifnull,pixelAttributesinstance 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-truefor read mode GPU -> CPU, e.g.glReadPixels.falsefor 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 lastallocatedGLPixelBuffermatching the given parameter.May return
nullif none has been allocated yet.Returned
GLPixelBuffermay beinvalid.- Parameters:
hostPixComp- hostpixel format, i.e. of the source or sink depending onpack, e.g. fetched viaGLPixelBuffer.GLPixelBufferProvider.getHostPixelComp(GLProfile, int). Ifnull,pixelAttributesinstance 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-truefor read mode GPU -> CPU, e.g.glReadPixels.falsefor write mode CPU -> GPU, e.g.glTexImage2D.
-
initSingleton
GLPixelBuffer initSingleton(GLProfile glp, int componentCount, boolean pack, int width, int height, int depth)
Initializes the singleGLPixelBufferw/ 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-truefor read mode GPU -> CPU, e.g.glReadPixels.falsefor 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.
-
-