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 intformatThe OpenGL pixel data formatPixelFormatpfmtPixelFormatdescribing thecomponentlayoutinttypeThe OpenGL pixel data typestatic GLPixelBuffer.GLPixelAttributesUNDEFUndefined instance ofGLPixelBuffer.GLPixelAttributes, having componentCount:=0, format:=0 and type:= 0.
-
Constructor Summary
Constructors Constructor Description GLPixelAttributes(int dataFormat, int dataType)Create a newGLPixelBuffer.GLPixelAttributesinstance 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.GLPixelAttributesconvert(GL gl, int componentCount, boolean pack)Returns the matchingGLPixelBuffer.GLPixelAttributesfor the given byte sized RGBAcomponentCountandGLif exists, otherwise returnsnull.static GLPixelBuffer.GLPixelAttributesconvert(GLProfile glp, PixelFormat pixFmt, boolean pack)Returns the matchingGLPixelBuffer.GLPixelAttributesfor the givenGLProfile,PixelFormatandpackif exists, otherwise returnsnull.booleanequals(Object obj)static PixelFormatgetPixelFormat(int glFormat, int glDataType)Returns the matchingPixelFormatfor the given GL format and type if exists, otherwise returnsnull.inthashCode()StringtoString()
-
-
-
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
PixelFormatdescribing thecomponentlayout
-
-
Constructor Detail
-
GLPixelAttributes
public GLPixelAttributes(int dataFormat, int dataType) throws GLExceptionCreate a newGLPixelBuffer.GLPixelAttributesinstance based on GL format and type.- Parameters:
dataFormat- GL data formatdataType- GL data type- Throws:
GLException- ifPixelFormatcould not be determined, seegetPixelFormat(int, int).
-
GLPixelAttributes
public GLPixelAttributes(GLProfile glp, PixelFormat pixFmt, boolean pack) throws GLException
- Parameters:
glp- the correspondingGLProfilepixFmt- the to be matchedpixel formatpack-truefor read mode GPU -> CPU, e.g.glReadPixels.falsefor 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 matchingPixelFormatfor 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.GLPixelAttributesfor the given byte sized RGBAcomponentCountandGLif exists, otherwise returnsnull.- Parameters:
gl- the corresponding currentGLcontext objectcomponentCount- 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.
-
convert
public static final GLPixelBuffer.GLPixelAttributes convert(GLProfile glp, PixelFormat pixFmt, boolean pack)
Returns the matchingGLPixelBuffer.GLPixelAttributesfor the givenGLProfile,PixelFormatandpackif exists, otherwise returnsnull.- Parameters:
glp- the correspondingGLProfilepixFmt- the to be matchedpixel formatpack-truefor read mode GPU -> CPU, e.g.glReadPixels.falsefor write mode CPU -> GPU, e.g.glTexImage2D.
-
-