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 intThe OpenGL pixel data formatfinal PixelFormatPixelFormatdescribing thecomponentlayoutfinal intThe OpenGL pixel data typestatic final GLPixelBuffer.GLPixelAttributesUndefined instance ofGLPixelBuffer.GLPixelAttributes, having componentCount:=0, format:=0 and type:= 0. -
Constructor Summary
ConstructorsConstructorDescriptionGLPixelAttributes(int dataFormat, int dataType) Create a newGLPixelBuffer.GLPixelAttributesinstance based on GL format and type.GLPixelAttributes(GLProfile glp, PixelFormat pixFmt, boolean pack) -
Method Summary
Modifier and TypeMethodDescriptionReturns the matchingGLPixelBuffer.GLPixelAttributesfor the given byte sized RGBAcomponentCountandGLif exists, otherwise returnsnull.static final GLPixelBuffer.GLPixelAttributesconvert(GLProfile glp, PixelFormat pixFmt, boolean pack) Returns the matchingGLPixelBuffer.GLPixelAttributesfor the givenGLProfile,PixelFormatandpackif exists, otherwise returnsnull.final booleanstatic final PixelFormatgetPixelFormat(int glFormat, int glDataType) Returns the matchingPixelFormatfor the given GL format and type if exists, otherwise returnsnull.final inthashCode()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
PixelFormatdescribing thecomponentlayout
-
-
Constructor Details
-
GLPixelAttributes
Create 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
- 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 Details
-
getPixelFormat
Returns the matchingPixelFormatfor the given GL format and type if exists, otherwise returnsnull. -
convert
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.
-
hashCode
public final int hashCode() -
equals
-
toString
-