Package com.jogamp.opengl.util
Class GLPixelBuffer.DefaultGLPixelBufferProvider
- java.lang.Object
-
- com.jogamp.opengl.util.GLPixelBuffer.DefaultGLPixelBufferProvider
-
- All Implemented Interfaces:
GLPixelBuffer.GLPixelBufferProvider
- Enclosing class:
- GLPixelBuffer
public static class GLPixelBuffer.DefaultGLPixelBufferProvider extends Object implements GLPixelBuffer.GLPixelBufferProvider
-
-
Constructor Summary
Constructors Constructor Description DefaultGLPixelBufferProvider(boolean allowRowStride)
-
Method Summary
All Methods Instance Methods Concrete 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.boolean
getAllowRowStride()
GLPixelBuffer.GLPixelAttributes
getAttributes(GL gl, int componentCount, boolean pack)
PixelFormat.Composition
getHostPixelComp(GLProfile glp, int componentCount)
Returns the hostPixelFormat.Composition
matchingGL
andcomponentCount
if required by implementation, otherwisenull
.
-
-
-
Constructor Detail
-
DefaultGLPixelBufferProvider
public DefaultGLPixelBufferProvider(boolean allowRowStride)
- Parameters:
allowRowStride
- Iftrue
, allow row-stride, otherwise not. SeegetAllowRowStride()
andGLPixelBuffer.requiresNewBuffer(GL, int, int, int)
.
-
-
Method Detail
-
getAllowRowStride
public boolean getAllowRowStride()
Description copied from interface:GLPixelBuffer.GLPixelBufferProvider
- Specified by:
getAllowRowStride
in interfaceGLPixelBuffer.GLPixelBufferProvider
-
getAttributes
public GLPixelBuffer.GLPixelAttributes getAttributes(GL gl, int componentCount, boolean pack)
Description copied from interface:GLPixelBuffer.GLPixelBufferProvider
- Specified by:
getAttributes
in interfaceGLPixelBuffer.GLPixelBufferProvider
- Parameters:
gl
- the corresponding currentGL
context objectcomponentCount
- 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
.
-
getHostPixelComp
public PixelFormat.Composition getHostPixelComp(GLProfile glp, int componentCount)
Returns the hostPixelFormat.Composition
matchingGL
andcomponentCount
if required by implementation, otherwisenull
.Returns
null
!- Specified by:
getHostPixelComp
in interfaceGLPixelBuffer.GLPixelBufferProvider
- Parameters:
glp
- the corresponding currentGL
context objectcomponentCount
- RGBA component count, i.e. 1 (luminance, alpha or red), 3 (RGB) or 4 (RGBA)
-
allocate
public 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.Returns an NIO
ByteBuffer
.- 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)
-
-