TextureFormat
Description
- Derived from
-
SerializableBase abstract
IConfigurable - Extended by
-
Example_TextureFormat sealed
A TextureFormat object represents a binary texel format.
A custom implementation must override the FormatIdentifier methods and should provide meaningful mappings in Generalize. The following texture formats are the most common ones and will usually be supported by most graphics contexts:
-
A16B16G16R16 (linear)
-
A2B10G10R10 (linear)
-
A8B8G8R8 (sRGB + linear)
-
BC1 (sRGB + linear)
-
BC3 (sRGB + linear)
-
G16R16 (linear)
-
G8R8 (linear)
-
R16 (linear)
-
R8 (linear)
The names of the pre-defined texture formats follow this Grammar:
format := uncompressed | compressed ; compressed := 'BC' '1'..'5' ; uncompressed := part[1..4] float? ; float := 'F' ; part := channel bits ; bits := '0'..'9'+ ; channel := alpha | color | luminance ; alpha := 'A' ; color := [BGR] ; luminance := 'L' ;
The texture format names may be interpreted as follows:
-
Names matching
compresseddepict a block-compressed texture format (see BlockSize). -
Uncompressed texture formats (see
uncompressed) have a block size of 1. -
The texture format parts (see
part) appear reverse order: the last part represents the least significant bits in the texel word or the texel word at the lowest memory address. Texel words use the native host byte order (see ByteBuffer.NativeOrder). -
For each part,
channelandbitsspecify the texel channel and precision. -
The
floatsuffix indicates that a floating-point format is used, instead of a normalized integer format.
Public / Constants
A16B16G16R16
16-bit unsigned integer channels for alpha, red, green and blue (64 bits per texel, 4 texel words, uncompressed).
This texture format generalizes to:
A16B16G16R16F
16-bit floating-point channels for alpha, red, green and blue (64 bits per texel, 4 texel words, uncompressed).
This texture format generalizes to:
- See also
A16R16G16B16
16-bit unsigned integer channels for alpha, red, green and blue (64 bits per texel, 4 texel words, uncompressed).
This texture format generalizes to:
A16R16G16B16F
16-bit floating-point channels for alpha, red, green and blue (64 bits per texel, 4 texel words, uncompressed).
This texture format generalizes to:
- See also
A1B5G5R5
1-bit channel for alpha, 5-bit channels for red, green and blue (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
A1R5G5B5
1-bit channel for alpha, 5-bit channels for red, green and blue (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
A2B10G10R10
2-bit channel for alpha, 10-bit channels for red, green and blue (32 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
A2R10G10B10
2-bit channel for alpha, 10-bit channels for red, green and blue (32 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
A32B32G32R32F
32-bit floating-point channels for alpha, red, green and blue (128 bits per texel, 4 texel words, uncompressed).
This texture format generalizes to:
A32R32G32B32F
32-bit floating-point channels for alpha, red, green and blue (128 bits per texel, 4 texel words, uncompressed).
This texture format generalizes to:
A4B4G4R4
4-bit channels for alpha, red, green and blue (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
A4R4G4B4
4-bit channels for alpha, red, green and blue (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
A8B8G8R8
8-bit channels for alpha, red, green and blue (32 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
A8L8
8-bit channels for alpha and luminance resp. grayscale (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
The luminance value is replicated into the red, green and blue channels.
A8R8G8B8
8-bit channels for alpha, red, green and blue (32 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
B5G6R5
5-bit channel for red, 6-bit channel for green, 5-bit channel for blue (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
The normalized alpha channel value is 1.
- See also
BC1
1-bit channel for alpha, 5-bit channels for red and blue, 5-bit channel for green (4 bits per texel, using 4x4 block compression).
This texture format generalizes to:
BC3
8-bit channel for alpha, 5-bit channels for red and blue, 5-bit channel for green (8 bits per texel, using 4x4 block compression).
This texture format generalizes to:
BC4
8-bit channel for red (4 bits per texel, using 4x4 block compression).
This texture format generalizes to:
The normalized alpha channel value is 1.
BC5
8-bit channels for red and green (8 bits per texel, using 4x4 block compression).
This texture format generalizes to:
The normalized alpha channel value is 1.
G16R16
16-bit unsigned integer channels for red and green (32 bits per texel, 2 texel words, uncompressed).
This texture format generalizes to:
The blue channel values are undefined.
The normalized alpha channel value is 1.
G16R16F
16-bit floating-point channels for red and green (32 bits per texel, 2 texel words, uncompressed).
This texture format generalizes to:
The blue channel values are undefined.
The normalized alpha channel value is 1.
G32R32F
32-bit floating-point channels for red and green (64 bits per texel, 2 texel words, uncompressed).
This texture format generalizes to:
The blue channel values are undefined.
The normalized alpha channel value is 1.
G8R8
8-bit channels for red and green (16 bits per texel, 2 texel words, uncompressed).
This texture format generalizes to:
The blue channel values are undefined.
The normalized alpha channel value is 1.
L16
16-bit channel for luminance resp. grayscale (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
The luminance value is replicated into the red, green and blue channels.
The normalized alpha channel value is 1.
L8
8-bit channel for luminance resp. grayscale (8 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
The luminance value is replicated into the red, green and blue channels.
The normalized alpha channel value is 1.
R16
16-bit unsigned integer channel for red (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
The green and blue channel values are undefined.
The normalized alpha channel value is 1.
R16F
16-bit floating-point channel for red (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
The green and blue channel values are undefined.
The normalized alpha channel value is 1.
- See also
R32F
32-bit floating-point channel for red (32 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
The green and blue channel values are undefined.
The normalized alpha channel value is 1.
R5G6B5
5-bit channel for red, 6-bit channel for green, 5-bit channel for blue (16 bits per texel, 1 texel word, uncompressed).
This texture format generalizes to:
The normalized alpha channel value is 1.
- See also
Public / Methods
BitsPerComponent
Returns the effective number of bits that are used to encode the given texel component.
This value represents the number of bits that are used to encode component in as input to a possible texel compression scheme (for example BC1). In this case, the sum of BitsPerComponent will be greater than BitsPerTexel.
CheckBlockSizeAlignment
2 overloads
Checks if the given texel location is aligned to this texture formats block size.
Checks if the given texel rectangle is aligned to this texture formats block size.
FormatIdentifier
Returns the identifier for this texture format, as defined by the graphics API that is associated with the given texture factory.
Custom implementations of TextureFormat must override this method, in order to provide the correct format identifier.
The default implementation returns -1.
Public / Attributes
BitsPerTexel
The number of bits that must be stored per texture pixel.
This values represents the number of bits that result from applying a possible texel compression scheme (for example BC1). In this case, this value will be less than the sum of BitsPerComponent.