Format

Struct Format 

Source
pub struct Format(/* private fields */);
Expand description

[docs.microsoft.com] D3DFORMAT

Enumeration cases are labeled in native endian.

§RGBA Color Formats

FormatBits/PixelBack BufferDisplayNative Endian Bits
Format::UNKNOWNN/AN/AN/AN/A
Format::R8G8B824rrrrrrrrggggggggbbbbbbbb
Format::A8R8G8B832✔️aaaaaaaarrrrrrrrggggggggbbbbbbbb
Format::X8R8G8B832✔️✔️xxxxxxxxrrrrrrrrggggggggbbbbbbbb
Format::R5G6B516✔️✔️rrrrrggggggbbbbb
Format::X1R5G5B516✔️✔️xrrrrrgggggbbbbb
Format::A1R5G5B516✔️arrrrrgggggbbbbb
Format::A4R4G4B416aaaarrrrggggbbbb
Format::R3G3B28rrrgggbb
Format::A88aaaaaaaa
Format::A8R3G3B216aaaaaaaarrrgggbb
Format::X4R4G4B416xxxxrrrrggggbbbb
Format::A2B10G10R1032aabbbbbbbbbbggggggggggrrrrrrrrrr
Format::A8B8G8R832aaaaaaaabbbbbbbbggggggggrrrrrrrr
Format::X8B8G8R832xxxxxxxxbbbbbbbbggggggggrrrrrrrr
Format::G16R1632ggggggggggggggggrrrrrrrrrrrrrrrr
Format::A2R10G10B1032✔️✔️aarrrrrrrrrrggggggggggbbbbbbbbbb
Format::A16B16G16R1664AAAARRRRGGGGBBBB16
[Direct3DEx] Only
Format::A11a
Format::A2B10G10R10_XR_BIAS32???
KeyDescription
rrrrRed channel bits
ggggGreen channel bits
bbbbBlue channel bits
aaaaAlpha channel bits
xxxxUnused channel bits

§Non-RGBA Color Formats

FormatBits/PixelNative Endian Bits
Format::A8P816aaaaaaaapppppppp
Format::P88pppppppp
Format::L88llllllll
Format::A8L816aaaaaaaallllllll
Format::A4L48aaaallll
Format::L1616llllllllllllllll
KeyDescription
aaaaAlpha channel bits
ppppPallete index bits
llllLuminance bits (red+green+blue?)

§Compressed Color Formats

X3TC FormatsBits/BlockBlockBC#Alpha
Format::DXT1644x4BC11-bit
Format::DXT21284x4BC2Sharp, premul
Format::DXT31284x4BC2Sharp, non-premul
Format::DXT41284x4BC3Gradient, premul
Format::DXT51284x4BC3Gradient, non-premul

§Depth/Stencil Formats

FormatBits/PixelNative Endian Bits
Format::D16_LOCKABLE16dddddddddddddddd
Format::D3232dddddddddddddddddddddddddddddddd
Format::D15S116ddddddddddddddds
Format::D24S832ddddddddddddddddddddddddssssssss
Format::D24X832ddddddddddddddddddddddddxxxxxxxx
Format::D24X4S432ddddddddddddddddddddddddxxxxssss
Format::D1616dddddddddddddddd
Format::D32F_LOCKABLE32dddddddddddddddddddddddddddddddd
Format::D24FS832ddddddddddddddddddddddddssssssss
[Direct3DEx] Only
Format::D32_LOCKABLE32dddddddddddddddddddddddddddddddd
Format::X8_LOCKABLE8ssssssss

§Data Formats

§Uncategorized Formats

Implementations§

Source§

impl Format

Source

pub const fn from_unchecked(format: D3DFORMAT) -> Self

Convert a raw D3DFORMAT value into a Format. This is probably safe… probably…

Source

pub const fn into(self) -> D3DFORMAT

Convert a Format back into a D3DFORMAT.

Source§

impl Format

Source

pub const UNKNOWN: Format

Surface format is unknown

Source

pub const Unknown: Format = Format::UNKNOWN

Source

pub const R8G8B8: Format

Source

pub const A8R8G8B8: Format

Source

pub const X8R8G8B8: Format

Source

pub const R5G6B5: Format

Source

pub const X1R5G5B5: Format

Source

pub const A1R5G5B5: Format

Source

pub const A4R4G4B4: Format

Source

pub const R3G3B2: Format

Source

pub const A8: Format

Source

pub const A8R3G3B2: Format

Source

pub const X4R4G4B4: Format

Source

pub const A2B10G10R10: Format

Source

pub const A8B8G8R8: Format

Source

pub const X8B8G8R8: Format

Source

pub const G16R16: Format

Source

pub const A2R10G10B10: Format

Source

pub const A16B16G16R16: Format

Source

pub const A8P8: Format

Source

pub const P8: Format

Source

pub const L8: Format

Source

pub const A8L8: Format

Source

pub const A4L4: Format

Source

pub const V8U8: Format

Source

pub const L6V5U5: Format

Source

pub const X8L8V8U8: Format

Source

pub const Q8W8V8U8: Format

Source

pub const V16U16: Format

Source

pub const A2W10V10U10: Format

Source

pub const UYVY: Format

Source

pub const R8G8_B8G8: Format

Source

pub const YUY2: Format

Source

pub const G8R8_G8B8: Format

Source

pub const DXT1: Format

Source

pub const DXT2: Format

Source

pub const DXT3: Format

Source

pub const DXT4: Format

Source

pub const DXT5: Format

Source

pub const D16_LOCKABLE: Format

Source

pub const D32: Format

Source

pub const D15S1: Format

Source

pub const D24S8: Format

Source

pub const D24X8: Format

Source

pub const D24X4S4: Format

Source

pub const D16: Format

Source

pub const D32F_LOCKABLE: Format

Source

pub const D24FS8: Format

Source

pub const D32_LOCKABLE: Format

Direct3D 9Ex Only

Source

pub const X8_LOCKABLE: Format

Direct3D 9Ex Only

Source

pub const L16: Format

Source

pub const VERTEXDATA: Format

Source

pub const INDEX16: Format

Source

pub const INDEX32: Format

Source

pub const VertexData: Format = Format::VERTEXDATA

Source

pub const Index16: Format = Format::INDEX16

Source

pub const Index32: Format = Format::INDEX32

Source

pub const Q16W16V16U16: Format

Source

pub const MULTI2_ARGB8: Format

Source

pub const R16F: Format

Source

pub const G16R16F: Format

Source

pub const A16B16G16R16F: Format

Source

pub const R32F: Format

Source

pub const G32R32F: Format

Source

pub const A32B32G32R32F: Format

Source

pub const CxV8U8: Format

Source

pub const A1: Format

1-bit monochrome.

Direct3D 9Ex Only

Source

pub const A2B10G10R10_XR_BIAS: Format

2.8-biased fixed point.

Direct3D 9Ex Only

Source

pub const BINARYBUFFER: Format

Binary format indicating that the data has no inherent type.

Direct3D 9Ex Only

Source

pub const BinaryBuffer: Format = Format::BINARYBUFFER

Binary format indicating that the data has no inherent type.

Direct3D 9Ex Only

Trait Implementations§

Source§

impl Clone for Format

Source§

fn clone(&self) -> Format

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Format

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Format

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<Format> for D3DFORMAT

Source§

fn from(value: Format) -> Self

Converts to this type from the input type.
Source§

impl Hash for Format

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Format

Source§

fn cmp(&self, other: &Format) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Format

Source§

fn eq(&self, other: &Format) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Format

Source§

fn partial_cmp(&self, other: &Format) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for Format

Source§

impl Eq for Format

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.