Top Description Inners Fields Constructors Methods
com.jogamp.nativewindow.util

public final Enum PixelFormat

extends Enum<PixelFormat>
Class Inheritance
Imports
java.util.Arrays, com.jogamp.common.util.Bitfield

Basic pixel formats

Notation follows OpenGL notation, i.e. name consist of all it's component names followed by their bit size.

Order of component names is from lowest-bit to highest-bit.

In case component-size is 1 byte (e.g. OpenGL data-type GL_UNSIGNED_BYTE), component names are ordered from lowest-byte to highest-byte. Note that OpenGL applies special interpretation if data-type is e.g. GL_UNSIGNED_8_8_8_8_REV or GL_UNSIGNED_8_8_8_8_REV.

PixelFormat can be converted to OpenGL GLPixelAttributes via

 GLPixelAttributes glpa = GLPixelAttributes.convert(PixelFormat pixFmt, GLProfile glp);

See OpenGL Specification 4.3 - February 14, 2013, Core Profile, Section 8.4.4 Transfer of Pixel Rectangles, p. 161-174.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
PixelFormat.Composition

Pixel composition, i.e. layout of its components.

public static enum
PixelFormat.CType

Component types

public static class
PixelFormat.PackedComposition

Packed pixel composition, see Composition.

Field Summary

Modifier and TypeField and Description
public static final PixelFormat
ABGR1555

Stride is 16 bits, 16 bits per pixel, 4 discrete components.

public static final PixelFormat
ABGR8888

Stride is 32 bits, 32 bits per pixel, 4 uniform components of 8 bits.

public static final PixelFormat
ARGB8888

Stride is 32 bits, 32 bits per pixel, 4 uniform components of 8 bits.

public static final PixelFormat
BGR565

Stride is 16 bits, 16 bits per pixel, 3 discrete components.

public static final PixelFormat
BGR888

Stride is 24 bits, 24 bits per pixel, 3 uniform components of of 8 bits.

public static final PixelFormat
BGRA8888

Stride is 32 bits, 32 bits per pixel, 4 uniform components of 8 bits.

public static final PixelFormat
BGRx8888

Stride is 32 bits, 24 bits per pixel, 3 uniform components of 8 bits.

public final PixelFormat.Composition
comp

Unique Pixel Composition, i.e. layout of its components.

public static final PixelFormat
LUMINANCE

Stride is 8 bits, 8 bits per pixel, 1 component of 8 bits.

public static final PixelFormat
RGB565

Stride is 16 bits, 16 bits per pixel, 3 discrete components.

public static final PixelFormat
RGB888

Stride 24 bits, 24 bits per pixel, 3 uniform components of 8 bits.

public static final PixelFormat
RGBA5551

Stride is 16 bits, 16 bits per pixel, 4 discrete components.

public static final PixelFormat
RGBA8888

Stride is 32 bits, 32 bits per pixel, 4 uniform components of 8 bits.

public static final PixelFormat
RGBx8888

Stride is 32 bits, 24 bits per pixel, 3 uniform components of 8 bits.

Constructor Summary

AccessConstructor and Description
private
PixelFormat(final PixelFormat.CType[]
Component type order of all components, see Composition#componentBitMask().
componentOrder
,
final int
number of components
componentCount
,
final int
bits per component
bpc
,
final int
stride bits to next pixel
bitStride
)

private
PixelFormat(final PixelFormat.CType[]
Component type order of all components, see Composition#componentBitMask().
componentOrder
,
final int[]
bit-mask of of all components, see Composition#componentBitMask().
componentMask
,
final int[]
bit-shift of all components, see Composition#componentBitMask().
componentBitShift
,
final int
stride bits to next pixel
bitStride
)

Method Summary

Modifier and TypeMethod and Description
private static String
toHexString(final int[] bitCount, final int[] mask, final int[] shift)

public static PixelFormat
public static PixelFormat
valueOf(final PixelFormat.Composition comp)

Returns the unique matching PixelFormat of the given Composition or null if none is available.

public static PixelFormat[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf