pub struct Format(/* private fields */);Expand description
[docs.microsoft.com] D3DFORMAT
Enumeration cases are labeled in native endian.
§RGBA Color Formats
| Format | Bits/Pixel | Back Buffer | Display | Native Endian Bits |
|---|---|---|---|---|
Format::UNKNOWN | N/A | N/A | N/A | N/A |
Format::R8G8B8 | 24 | rrrrrrrrggggggggbbbbbbbb | ||
Format::A8R8G8B8 | 32 | ✔️ | ❌ | aaaaaaaarrrrrrrrggggggggbbbbbbbb |
Format::X8R8G8B8 | 32 | ✔️ | ✔️ | xxxxxxxxrrrrrrrrggggggggbbbbbbbb |
Format::R5G6B5 | 16 | ✔️ | ✔️ | rrrrrggggggbbbbb |
Format::X1R5G5B5 | 16 | ✔️ | ✔️ | xrrrrrgggggbbbbb |
Format::A1R5G5B5 | 16 | ✔️ | ❌ | arrrrrgggggbbbbb |
Format::A4R4G4B4 | 16 | aaaarrrrggggbbbb | ||
Format::R3G3B2 | 8 | rrrgggbb | ||
Format::A8 | 8 | aaaaaaaa | ||
Format::A8R3G3B2 | 16 | aaaaaaaarrrgggbb | ||
Format::X4R4G4B4 | 16 | xxxxrrrrggggbbbb | ||
Format::A2B10G10R10 | 32 | aabbbbbbbbbbggggggggggrrrrrrrrrr | ||
Format::A8B8G8R8 | 32 | aaaaaaaabbbbbbbbggggggggrrrrrrrr | ||
Format::X8B8G8R8 | 32 | xxxxxxxxbbbbbbbbggggggggrrrrrrrr | ||
Format::G16R16 | 32 | ggggggggggggggggrrrrrrrrrrrrrrrr | ||
Format::A2R10G10B10 | 32 | ✔️ | ✔️ | aarrrrrrrrrrggggggggggbbbbbbbbbb |
Format::A16B16G16R16 | 64 | AAAARRRRGGGGBBBB16 | ||
| [Direct3DEx] Only | ||||
Format::A1 | 1 | a | ||
Format::A2B10G10R10_XR_BIAS | 32 | ??? |
| Key | Description |
|---|---|
rrrr | Red channel bits |
gggg | Green channel bits |
bbbb | Blue channel bits |
aaaa | Alpha channel bits |
xxxx | Unused channel bits |
§Non-RGBA Color Formats
| Format | Bits/Pixel | Native Endian Bits |
|---|---|---|
Format::A8P8 | 16 | aaaaaaaapppppppp |
Format::P8 | 8 | pppppppp |
Format::L8 | 8 | llllllll |
Format::A8L8 | 16 | aaaaaaaallllllll |
Format::A4L4 | 8 | aaaallll |
Format::L16 | 16 | llllllllllllllll |
| Key | Description |
|---|---|
aaaa | Alpha channel bits |
pppp | Pallete index bits |
llll | Luminance bits (red+green+blue?) |
§Compressed Color Formats
| X3TC Formats | Bits/Block | Block | BC# | Alpha |
|---|---|---|---|---|
Format::DXT1 | 64 | 4x4 | BC1 | 1-bit |
Format::DXT2 | 128 | 4x4 | BC2 | Sharp, premul |
Format::DXT3 | 128 | 4x4 | BC2 | Sharp, non-premul |
Format::DXT4 | 128 | 4x4 | BC3 | Gradient, premul |
Format::DXT5 | 128 | 4x4 | BC3 | Gradient, non-premul |
§Depth/Stencil Formats
| Format | Bits/Pixel | Native Endian Bits |
|---|---|---|
Format::D16_LOCKABLE | 16 | dddddddddddddddd |
Format::D32 | 32 | dddddddddddddddddddddddddddddddd |
Format::D15S1 | 16 | ddddddddddddddds |
Format::D24S8 | 32 | ddddddddddddddddddddddddssssssss |
Format::D24X8 | 32 | ddddddddddddddddddddddddxxxxxxxx |
Format::D24X4S4 | 32 | ddddddddddddddddddddddddxxxxssss |
Format::D16 | 16 | dddddddddddddddd |
Format::D32F_LOCKABLE | 32 | dddddddddddddddddddddddddddddddd |
Format::D24FS8 | 32 | ddddddddddddddddddddddddssssssss |
| [Direct3DEx] Only | ||
Format::D32_LOCKABLE | 32 | dddddddddddddddddddddddddddddddd |
Format::X8_LOCKABLE | 8 | ssssssss |
§Data Formats
| Format | Bits/Element |
|---|---|
Format::BINARYBUFFER | N/A |
Format::VERTEXDATA | N/A |
Format::INDEX16 | 16 |
Format::INDEX32 | 32 |
§Uncategorized Formats
Implementations§
Source§impl Format
impl Format
pub const Unknown: Format = Format::UNKNOWN
pub const R8G8B8: Format
pub const A8R8G8B8: Format
pub const X8R8G8B8: Format
pub const R5G6B5: Format
pub const X1R5G5B5: Format
pub const A1R5G5B5: Format
pub const A4R4G4B4: Format
pub const R3G3B2: Format
pub const A8: Format
pub const A8R3G3B2: Format
pub const X4R4G4B4: Format
pub const A2B10G10R10: Format
pub const A8B8G8R8: Format
pub const X8B8G8R8: Format
pub const G16R16: Format
pub const A2R10G10B10: Format
pub const A16B16G16R16: Format
pub const A8P8: Format
pub const P8: Format
pub const L8: Format
pub const A8L8: Format
pub const A4L4: Format
pub const V8U8: Format
pub const L6V5U5: Format
pub const X8L8V8U8: Format
pub const Q8W8V8U8: Format
pub const V16U16: Format
pub const A2W10V10U10: Format
pub const UYVY: Format
pub const R8G8_B8G8: Format
pub const YUY2: Format
pub const G8R8_G8B8: Format
pub const DXT1: Format
pub const DXT2: Format
pub const DXT3: Format
pub const DXT4: Format
pub const DXT5: Format
pub const D16_LOCKABLE: Format
pub const D32: Format
pub const D15S1: Format
pub const D24S8: Format
pub const D24X8: Format
pub const D24X4S4: Format
pub const D16: Format
pub const D32F_LOCKABLE: Format
pub const D24FS8: Format
Sourcepub const D32_LOCKABLE: Format
pub const D32_LOCKABLE: Format
Direct3D 9Ex Only
Sourcepub const X8_LOCKABLE: Format
pub const X8_LOCKABLE: Format
Direct3D 9Ex Only
pub const L16: Format
pub const VERTEXDATA: Format
pub const INDEX16: Format
pub const INDEX32: Format
pub const VertexData: Format = Format::VERTEXDATA
pub const Index16: Format = Format::INDEX16
pub const Index32: Format = Format::INDEX32
pub const Q16W16V16U16: Format
pub const MULTI2_ARGB8: Format
pub const R16F: Format
pub const G16R16F: Format
pub const A16B16G16R16F: Format
pub const R32F: Format
pub const G32R32F: Format
pub const A32B32G32R32F: Format
pub const CxV8U8: Format
Sourcepub const A2B10G10R10_XR_BIAS: Format
pub const A2B10G10R10_XR_BIAS: Format
2.8-biased fixed point.
Direct3D 9Ex Only
Sourcepub const BINARYBUFFER: Format
pub const BINARYBUFFER: Format
Binary format indicating that the data has no inherent type.
Direct3D 9Ex Only
Sourcepub const BinaryBuffer: Format = Format::BINARYBUFFER
pub const BinaryBuffer: Format = Format::BINARYBUFFER
Binary format indicating that the data has no inherent type.
Direct3D 9Ex Only
Trait Implementations§
Source§impl Ord for Format
impl Ord for Format
Source§impl PartialOrd for Format
impl PartialOrd for Format
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnwindSafe for Format
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more