javax.media.nativewindow.util
Enum PixelFormat

java.lang.Object
  extended by java.lang.Enum<PixelFormat>
      extended by javax.media.nativewindow.util.PixelFormat
All Implemented Interfaces:
Serializable, Comparable<PixelFormat>

public enum PixelFormat
extends Enum<PixelFormat>

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.


Enum Constant Summary
ABGR8888
          Pixel size is 4 bytes (32 bits) with each component of size 1 byte (8 bits).
ARGB8888
          Pixel size is 4 bytes (32 bits) with each component of size 1 byte (8 bits).
BGR888
          Pixel size is 3 bytes (24 bits) with each component of size 1 byte (8 bits).
BGRA8888
          Pixel size is 4 bytes (32 bits) with each component of size 1 byte (8 bits).
LUMINANCE
          Pixel size is 1 bytes (8 bits) with one component of size 1 byte (8 bits).
RGB888
          Pixel size is 3 bytes (24 bits) with each component of size 1 byte (8 bits).
RGBA8888
          Pixel size is 4 bytes (32 bits) with each component of size 1 byte (8 bits).
 
Field Summary
 int bitsPerPixel
          Number of bits per pixel, e.g.
 int componentCount
          Number of components per pixel, e.g.
 
Method Summary
 int bytesPerPixel()
          Number of bytes per pixel, e.g.
static PixelFormat valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PixelFormat[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

LUMINANCE

public static final PixelFormat LUMINANCE
Pixel size is 1 bytes (8 bits) with one component of size 1 byte (8 bits). Compatible with:


RGB888

public static final PixelFormat RGB888
Pixel size is 3 bytes (24 bits) with each component of size 1 byte (8 bits).

The components are interleaved in the order:

Compatible with:


BGR888

public static final PixelFormat BGR888
Pixel size is 3 bytes (24 bits) with each component of size 1 byte (8 bits).

The components are interleaved in the order:

Compatible with:


RGBA8888

public static final PixelFormat RGBA8888
Pixel size is 4 bytes (32 bits) with each component of size 1 byte (8 bits).

The components are interleaved in the order:

Compatible with:


ABGR8888

public static final PixelFormat ABGR8888
Pixel size is 4 bytes (32 bits) with each component of size 1 byte (8 bits).

The components are interleaved in the order:

Compatible with:


ARGB8888

public static final PixelFormat ARGB8888
Pixel size is 4 bytes (32 bits) with each component of size 1 byte (8 bits).

The components are interleaved in the order:

Compatible with:


BGRA8888

public static final PixelFormat BGRA8888
Pixel size is 4 bytes (32 bits) with each component of size 1 byte (8 bits).

The components are interleaved in the order:

Compatible with:

Field Detail

componentCount

public final int componentCount
Number of components per pixel, e.g. 4 for RGBA.


bitsPerPixel

public final int bitsPerPixel
Number of bits per pixel, e.g. 32 for RGBA.

Method Detail

values

public static PixelFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PixelFormat c : PixelFormat.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PixelFormat valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

bytesPerPixel

public final int bytesPerPixel()
Number of bytes per pixel, e.g. 4 for RGBA.



Copyright 2010 JogAmp Community.