Package com.jogamp.opengl.util
Class GLPixelBuffer.GLPixelAttributes
java.lang.Object
com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes
- Enclosing class:
- GLPixelBuffer
Pixel attributes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
The OpenGL pixel data formatfinal PixelFormat
PixelFormat
describing thecomponent
layoutfinal int
The OpenGL pixel data typestatic final GLPixelBuffer.GLPixelAttributes
Undefined instance ofGLPixelBuffer.GLPixelAttributes
, having componentCount:=0, format:=0 and type:= 0. -
Constructor Summary
ConstructorsConstructorDescriptionGLPixelAttributes
(int dataFormat, int dataType) Create a newGLPixelBuffer.GLPixelAttributes
instance based on GL format and type.GLPixelAttributes
(GLProfile glp, PixelFormat pixFmt, boolean pack) -
Method Summary
Modifier and TypeMethodDescriptionReturns the matchingGLPixelBuffer.GLPixelAttributes
for the given byte sized RGBAcomponentCount
andGL
if exists, otherwise returnsnull
.static final GLPixelBuffer.GLPixelAttributes
convert
(GLProfile glp, PixelFormat pixFmt, boolean pack) Returns the matchingGLPixelBuffer.GLPixelAttributes
for the givenGLProfile
,PixelFormat
andpack
if exists, otherwise returnsnull
.final boolean
static final PixelFormat
getPixelFormat
(int glFormat, int glDataType) Returns the matchingPixelFormat
for the given GL format and type if exists, otherwise returnsnull
.final int
hashCode()
toString()
-
Field Details
-
UNDEF
Undefined instance ofGLPixelBuffer.GLPixelAttributes
, having componentCount:=0, format:=0 and type:= 0. -
format
public final int formatThe OpenGL pixel data format -
type
public final int typeThe OpenGL pixel data type -
pfmt
PixelFormat
describing thecomponent
layout
-
-
Constructor Details
-
GLPixelAttributes
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
- 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 Details
-
getPixelFormat
Returns the matchingPixelFormat
for the given GL format and type if exists, otherwise returnsnull
. -
convert
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
.
-
hashCode
public final int hashCode() -
equals
-
toString
-