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)
Public / Constants
A16B16G16R16
16-bit channels for alpha, red, green and blue (64 bits per texel, uncompressed).
This texture format generalizes to:
A16R16G16B16
16-bit channels for alpha, red, green and blue (64 bits per texel, uncompressed).
This texture format generalizes to:
A1B5G5R5
1-bit channel for alpha, 5-bit channels for red, green and blue (16 bits per texel, uncompressed).
This texture format generalizes to:
A1R5G5B5
1-bit channel for alpha, 5-bit channels for red, green and blue (16 bits per texel, uncompressed).
This texture format generalizes to:
A2B10G10R10
2-bit channel for alpha, 10-bit channels for red, green and blue (32 bits per texel, uncompressed).
This texture format generalizes to:
A2R10G10B10
2-bit channel for alpha, 10-bit channels for red, green and blue (32 bits per texel, uncompressed).
This texture format generalizes to:
A4B4G4R4
4-bit channels for alpha, red, green and blue (16 bits per texel, uncompressed).
This texture format generalizes to:
A4R4G4B4
4-bit channels for alpha, red, green and blue (16 bits per texel, uncompressed).
This texture format generalizes to:
A8B8G8R8
8-bit channels for alpha, red, green and blue (32 bits per texel, uncompressed).
This texture format generalizes to:
A8L8
8-bit channels for alpha and luminance resp. grayscale (16 bits per texel, 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, 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, uncompressed).
This texture format generalizes to:
The normalized alpha channel value is 1
.
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 channels for red and green (32bits per texel, 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, 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, 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, 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 channel for red (16 bits per texel, 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, uncompressed).
This texture format generalizes to:
The normalized alpha channel value is 1
.
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.