JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.nativewindow.util.PixelFormat Enum Reference

Basic pixel formats. More...

Collaboration diagram for com.jogamp.nativewindow.util.PixelFormat:

Classes

interface  Composition
 Pixel composition, i.e. More...
 
enum  CType
 Component types. More...
 
class  PackedComposition
 Packed pixel composition, see Composition. More...
 

Static Public Member Functions

static PixelFormat valueOf (final Composition comp)
 Returns the unique matching PixelFormat of the given Composition or null if none is available. More...
 

Public Attributes

 LUMINANCE =(new CType[]{ CType.Y }, 1, 8, 8)
 Stride is 8 bits, 8 bits per pixel, 1 component of 8 bits. More...
 
 RGB565
 Stride is 16 bits, 16 bits per pixel, 3 discrete components. More...
 
 BGR565
 Stride is 16 bits, 16 bits per pixel, 3 discrete components. More...
 
 RGBA5551
 Stride is 16 bits, 16 bits per pixel, 4 discrete components. More...
 
 ABGR1555
 Stride is 16 bits, 16 bits per pixel, 4 discrete components. More...
 
 RGB888 =(new CType[]{ CType.R, CType.G, CType.B }, 3, 8, 24)
 Stride 24 bits, 24 bits per pixel, 3 uniform components of 8 bits. More...
 
 BGR888 =(new CType[]{ CType.B, CType.G, CType.R }, 3, 8, 24)
 Stride is 24 bits, 24 bits per pixel, 3 uniform components of of 8 bits. More...
 
 RGBx8888 =(new CType[]{ CType.R, CType.G, CType.B }, 3, 8, 32)
 Stride is 32 bits, 24 bits per pixel, 3 uniform components of 8 bits. More...
 
 BGRx8888 =(new CType[]{ CType.B, CType.G, CType.R }, 3, 8, 32)
 Stride is 32 bits, 24 bits per pixel, 3 uniform components of 8 bits. More...
 
 RGBA8888 =(new CType[]{ CType.R, CType.G, CType.B, CType.A }, 4, 8, 32)
 Stride is 32 bits, 32 bits per pixel, 4 uniform components of 8 bits. More...
 
 ABGR8888 =(new CType[]{ CType.A, CType.B, CType.G, CType.R }, 4, 8, 32)
 Stride is 32 bits, 32 bits per pixel, 4 uniform components of 8 bits. More...
 
 ARGB8888 =(new CType[]{ CType.A, CType.R, CType.G, CType.B }, 4, 8, 32)
 Stride is 32 bits, 32 bits per pixel, 4 uniform components of 8 bits. More...
 
 BGRA8888 =(new CType[]{ CType.B, CType.G, CType.R, CType.A }, 4, 8, 32)
 Stride is 32 bits, 32 bits per pixel, 4 uniform components of 8 bits. More...
 
final Composition comp
 Unique Pixel Composition, i.e. More...
 

Detailed Description

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.

Definition at line 65 of file PixelFormat.java.

Member Function Documentation

◆ valueOf()

static PixelFormat com.jogamp.nativewindow.util.PixelFormat.valueOf ( final Composition  comp)
static

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

Definition at line 379 of file PixelFormat.java.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ABGR1555

com.jogamp.nativewindow.util.PixelFormat.ABGR1555
Initial value:
=(new CType[]{ CType.A, CType.B, CType.G, CType.R },
new int[]{ 0x01, 0x1F, 0x1F, 0x1F },
new int[]{ 0, 1, 1+5, 1+5+5 },
16 )

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

The discrete components are interleaved in the order Low to High:

  1. A: 0x01 << 0
  2. B: 0x1F << 1
  3. G: 0x1F << 6
  4. R: 0x1F << 11

Compatible with:

  • OpenGL: data-format GL_RGBA, data-type GL_UNSIGNED_SHORT_5_5_5_1
  • AWT: None

Definition at line 173 of file PixelFormat.java.

◆ ABGR8888

com.jogamp.nativewindow.util.PixelFormat.ABGR8888 =(new CType[]{ CType.A, CType.B, CType.G, CType.R }, 4, 8, 32)

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

The uniform components are interleaved in the order Low to High:

  1. A: 0xFF << 0
  2. B: 0xFF << 8
  3. G: 0xFF << 16
  4. R: 0xFF << 24

Compatible with:

  • OpenGL: data-format GL_RGBA, data-type GL_UNSIGNED_INT_8_8_8_8
  • AWT: TYPE_4BYTE_ABGR

Definition at line 304 of file PixelFormat.java.

◆ ARGB8888

com.jogamp.nativewindow.util.PixelFormat.ARGB8888 =(new CType[]{ CType.A, CType.R, CType.G, CType.B }, 4, 8, 32)

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

The uniform components are interleaved in the order Low to High:

  1. A: 0xFF << 0
  2. R: 0xFF << 8
  3. G: 0xFF << 16
  4. B: 0xFF << 24

Compatible with:

  • OpenGL: data-format GL_BGRA, data-type GL_UNSIGNED_INT_8_8_8_8
  • AWT: None

Definition at line 326 of file PixelFormat.java.

◆ BGR565

com.jogamp.nativewindow.util.PixelFormat.BGR565
Initial value:
=(new CType[]{ CType.B, CType.G, CType.R},
new int[]{ 0x1F, 0x3F, 0x1F },
new int[]{ 0, 5, 5+6 },
16 )

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

The discrete components are interleaved in the order Low to High:

  1. B: 0x1F << 0
  2. G: 0x3F << 5
  3. R: 0x1F << 11

Compatible with:

  • OpenGL: data-format GL_RGB, data-type GL_UNSIGNED_SHORT_5_6_5
  • AWT: None

Definition at line 123 of file PixelFormat.java.

◆ BGR888

com.jogamp.nativewindow.util.PixelFormat.BGR888 =(new CType[]{ CType.B, CType.G, CType.R }, 3, 8, 24)

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

The uniform components are interleaved in the order Low to High:

  1. B: 0xFF << 0
  2. G: 0xFF << 8
  3. R: 0xFF << 16

Compatible with:

  • OpenGL: data-format GL_BGR (>= GL2), data-type GL_UNSIGNED_BYTE
  • AWT: TYPE_3BYTE_BGR

Definition at line 215 of file PixelFormat.java.

◆ BGRA8888

com.jogamp.nativewindow.util.PixelFormat.BGRA8888 =(new CType[]{ CType.B, CType.G, CType.R, CType.A }, 4, 8, 32)

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

The uniform components are interleaved in the order Low to High:

  1. B: 0xFF << 0
  2. G: 0xFF << 8
  3. R: 0xFF << 16
  4. A: 0xFF << 24

Compatible with:

  • OpenGL: data-format GL_BGRA, data-type GL_UNSIGNED_BYTE
  • AWT: TYPE_INT_ARGB
  • PointerIcon: X11 (XCURSOR), Win32, AWT
  • Window Icon: X11, Win32

Definition at line 350 of file PixelFormat.java.

◆ BGRx8888

com.jogamp.nativewindow.util.PixelFormat.BGRx8888 =(new CType[]{ CType.B, CType.G, CType.R }, 3, 8, 32)

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

The uniform components are interleaved in the order Low to High:

  1. B: 0xFF << 0
  2. G: 0xFF << 8
  3. R: 0xFF << 16

Compatible with:

  • OpenGL: data-format GL_BGRA, data-type GL_UNSIGNED_BYTE - with alpha discarded!
  • AWT: TYPE_INT_RGB

Definition at line 257 of file PixelFormat.java.

◆ comp

final Composition com.jogamp.nativewindow.util.PixelFormat.comp

Unique Pixel Composition, i.e.

layout of its components.

Definition at line 353 of file PixelFormat.java.

◆ LUMINANCE

com.jogamp.nativewindow.util.PixelFormat.LUMINANCE =(new CType[]{ CType.Y }, 1, 8, 8)

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

Compatible with:

  • OpenGL: data-format GL_ALPHA (< GL3), GL_RED (>= GL3), data-type GL_UNSIGNED_BYTE
  • AWT: none

Definition at line 75 of file PixelFormat.java.

◆ RGB565

com.jogamp.nativewindow.util.PixelFormat.RGB565
Initial value:
=(new CType[]{ CType.R, CType.G, CType.B },
new int[]{ 0x1F, 0x3F, 0x1F },
new int[]{ 0, 5, 5+6 },
16 )

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

The discrete components are interleaved in the order Low to High:

  1. R: 0x1F << 0
  2. G: 0x3F << 5
  3. B: 0x1F << 11

Compatible with:

  • OpenGL: data-format GL_RGB, data-type GL_UNSIGNED_SHORT_5_6_5_REV
  • AWT: None

Definition at line 99 of file PixelFormat.java.

◆ RGB888

com.jogamp.nativewindow.util.PixelFormat.RGB888 =(new CType[]{ CType.R, CType.G, CType.B }, 3, 8, 24)

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

The uniform components are interleaved in the order Low to High:

  1. R: 0xFF << 0
  2. G: 0xFF << 8
  3. B: 0xFF << 16

Compatible with:

  • OpenGL: data-format GL_RGB, data-type GL_UNSIGNED_BYTE
  • AWT: None

Definition at line 194 of file PixelFormat.java.

◆ RGBA5551

com.jogamp.nativewindow.util.PixelFormat.RGBA5551
Initial value:
=(new CType[]{ CType.R, CType.G, CType.B, CType.A},
new int[]{ 0x1F, 0x1F, 0x1F, 0x01 },
new int[]{ 0, 5, 5+5, 5+5+5 },
16 )

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

The discrete components are interleaved in the order Low to High:

  1. R: 0x1F << 0
  2. G: 0x1F << 5
  3. B: 0x1F << 10
  4. A: 0x01 << 15

Compatible with:

  • OpenGL: data-format GL_RGBA, data-type GL_UNSIGNED_SHORT_1_5_5_5_REV
  • AWT: None

Definition at line 148 of file PixelFormat.java.

◆ RGBA8888

com.jogamp.nativewindow.util.PixelFormat.RGBA8888 =(new CType[]{ CType.R, CType.G, CType.B, CType.A }, 4, 8, 32)

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

The uniform components are interleaved in the order Low to High:

  1. R: 0xFF << 0
  2. G: 0xFF << 8
  3. B: 0xFF << 16
  4. A: 0xFF << 24

Compatible with:

  • OpenGL: data-format GL_RGBA, data-type GL_UNSIGNED_BYTE
  • AWT: None
  • PointerIcon: OSX (NSBitmapImageRep)
  • Window Icon: OSX (NSBitmapImageRep)
  • PNGJ: Scanlines

Definition at line 282 of file PixelFormat.java.

◆ RGBx8888

com.jogamp.nativewindow.util.PixelFormat.RGBx8888 =(new CType[]{ CType.R, CType.G, CType.B }, 3, 8, 32)

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

The uniform components are interleaved in the order Low to High:

  1. R: 0xFF << 0
  2. G: 0xFF << 8
  3. B: 0xFF << 16

Compatible with:

  • OpenGL: data-format GL_RGBA, data-type GL_UNSIGNED_BYTE, with alpha discarded!
  • AWT: TYPE_INT_BGR

Definition at line 236 of file PixelFormat.java.


The documentation for this enum was generated from the following file: