public enum PixelFormat extends Enum<PixelFormat>
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 and Description |
---|
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).
|
Modifier and Type | Field and Description |
---|---|
int |
bitsPerPixel
Number of bits per pixel, e.g.
|
int |
componentCount
Number of components per pixel, e.g.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final PixelFormat LUMINANCE
public static final PixelFormat RGB888
The components are interleaved in the order:
Compatible with:
public static final PixelFormat BGR888
The components are interleaved in the order:
Compatible with:
TYPE_3BYTE_BGR
public static final PixelFormat RGBA8888
The components are interleaved in the order:
Compatible with:
public static final PixelFormat ABGR8888
The components are interleaved in the order:
Compatible with:
TYPE_4BYTE_ABGR
public static final PixelFormat ARGB8888
The components are interleaved in the order:
Compatible with:
public static final PixelFormat BGRA8888
The components are interleaved in the order:
Compatible with:
TYPE_INT_ARGB
public final int componentCount
public final int bitsPerPixel
public static PixelFormat[] values()
for (PixelFormat c : PixelFormat.values()) System.out.println(c);
public static PixelFormat valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic final int bytesPerPixel()
Copyright 2010 JogAmp Community.