Package com.jogamp.opengl.util
Class GLPixelBuffer.GLPixelAttributes
- java.lang.Object
-
- com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes
-
- Enclosing class:
- GLPixelBuffer
public static class GLPixelBuffer.GLPixelAttributes extends Object
Pixel attributes.
-
-
Field Summary
Fields Modifier and Type Field Description int
format
The OpenGL pixel data formatPixelFormat
pfmt
PixelFormat
describing thecomponent
layoutint
type
The OpenGL pixel data typestatic GLPixelBuffer.GLPixelAttributes
UNDEF
Undefined instance ofGLPixelBuffer.GLPixelAttributes
, having componentCount:=0, format:=0 and type:= 0.
-
Constructor Summary
Constructors Constructor Description GLPixelAttributes(int dataFormat, int dataType)
Create a newGLPixelBuffer.GLPixelAttributes
instance based on GL format and type.GLPixelAttributes(GLProfile glp, PixelFormat pixFmt, boolean pack)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GLPixelBuffer.GLPixelAttributes
convert(GL gl, int componentCount, boolean pack)
Returns the matchingGLPixelBuffer.GLPixelAttributes
for the given byte sized RGBAcomponentCount
andGL
if exists, otherwise returnsnull
.static GLPixelBuffer.GLPixelAttributes
convert(GLProfile glp, PixelFormat pixFmt, boolean pack)
Returns the matchingGLPixelBuffer.GLPixelAttributes
for the givenGLProfile
,PixelFormat
andpack
if exists, otherwise returnsnull
.boolean
equals(Object obj)
static PixelFormat
getPixelFormat(int glFormat, int glDataType)
Returns the matchingPixelFormat
for the given GL format and type if exists, otherwise returnsnull
.int
hashCode()
String
toString()
-
-
-
Field Detail
-
UNDEF
public static final GLPixelBuffer.GLPixelAttributes UNDEF
Undefined instance ofGLPixelBuffer.GLPixelAttributes
, having componentCount:=0, format:=0 and type:= 0.
-
format
public final int format
The OpenGL pixel data format
-
type
public final int type
The OpenGL pixel data type
-
pfmt
public final PixelFormat pfmt
PixelFormat
describing thecomponent
layout
-
-
Constructor Detail
-
GLPixelAttributes
public GLPixelAttributes(int dataFormat, int dataType) throws GLException
Create a newGLPixelBuffer.GLPixelAttributes
instance based on GL format and type.- Parameters:
dataFormat
- GL data formatdataType
- GL data type- Throws:
GLException
- ifPixelFormat
could not be determined, seegetPixelFormat(int, int)
.
-
GLPixelAttributes
public GLPixelAttributes(GLProfile glp, PixelFormat pixFmt, boolean pack) throws GLException
- Parameters:
glp
- the correspondingGLProfile
pixFmt
- the to be matchedpixel format
pack
-true
for read mode GPU -> CPU, e.g.glReadPixels
.false
for write mode CPU -> GPU, e.g.glTexImage2D
.- Throws:
GLException
- if GL format or type could not be determined, seeconvert(GLProfile, PixelFormat, boolean)
.
-
-
Method Detail
-
getPixelFormat
public static final PixelFormat getPixelFormat(int glFormat, int glDataType)
Returns the matchingPixelFormat
for the given GL format and type if exists, otherwise returnsnull
.
-
convert
public static GLPixelBuffer.GLPixelAttributes convert(GL gl, int componentCount, boolean pack)
Returns the matchingGLPixelBuffer.GLPixelAttributes
for the given byte sized RGBAcomponentCount
andGL
if exists, otherwise returnsnull
.- 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
.
-
convert
public static final GLPixelBuffer.GLPixelAttributes convert(GLProfile glp, PixelFormat pixFmt, boolean pack)
Returns the matchingGLPixelBuffer.GLPixelAttributes
for the givenGLProfile
,PixelFormat
andpack
if exists, otherwise returnsnull
.- Parameters:
glp
- the correspondingGLProfile
pixFmt
- the to be matchedpixel format
pack
-true
for read mode GPU -> CPU, e.g.glReadPixels
.false
for write mode CPU -> GPU, e.g.glTexImage2D
.
-
-