Enum ddsfile::D3DFormat

source ·
pub enum D3DFormat {
Show 37 variants A8B8G8R8, G16R16, A2B10G10R10, A1R5G5B5, R5G6B5, A8, A8R8G8B8, X8R8G8B8, X8B8G8R8, A2R10G10B10, R8G8B8, X1R5G5B5, A4R4G4B4, X4R4G4B4, A8R3G3B2, A8L8, L16, L8, A4L4, DXT1, DXT3, DXT5, R8G8_B8G8, G8R8_G8B8, A16B16G16R16, Q16W16V16U16, R16F, G16R16F, A16B16G16R16F, R32F, G32R32F, A32B32G32R32F, DXT2, DXT4, UYVY, YUY2, CXV8U8,
}

Variants§

§

A8B8G8R8

§

G16R16

§

A2B10G10R10

§

A1R5G5B5

§

R5G6B5

§

A8

§

A8R8G8B8

§

X8R8G8B8

§

X8B8G8R8

§

A2R10G10B10

§

R8G8B8

§

X1R5G5B5

§

A4R4G4B4

§

X4R4G4B4

§

A8R3G3B2

§

A8L8

§

L16

§

L8

§

A4L4

§

DXT1

§

DXT3

§

DXT5

§

R8G8_B8G8

§

G8R8_G8B8

§

A16B16G16R16

§

Q16W16V16U16

§

R16F

§

G16R16F

§

A16B16G16R16F

§

R32F

§

G32R32F

§

A32B32G32R32F

§

DXT2

§

DXT4

§

UYVY

§

YUY2

§

CXV8U8

Implementations§

source§

impl D3DFormat

source

pub fn r_bit_mask(&self) -> Option<u32>

This gets the bitmask for the red channel pixels

source

pub fn g_bit_mask(&self) -> Option<u32>

This gets the bitmask for the green channel pixels

source

pub fn b_bit_mask(&self) -> Option<u32>

This gets the bitmask for the blue channel pixels

source

pub fn a_bit_mask(&self) -> Option<u32>

This gets the bitmask for the alpha channel pixels

source

pub fn try_from_pixel_format(pixel_format: &PixelFormat) -> Option<D3DFormat>

This attempts to use PixelFormat data (e.g. from the dds.header.spf field) to determine the D3DFormat.

Trait Implementations§

source§

impl Clone for D3DFormat

source§

fn clone(&self) -> D3DFormat

Returns a copy 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 DataFormat for D3DFormat

source§

fn get_pitch(&self, width: u32) -> Option<u32>

This gets the number of bytes required to store one row of data
source§

fn get_bits_per_pixel(&self) -> Option<u8>

This gets the number of bits required to store a single pixel. It is only defined for uncompressed formats
source§

fn get_block_size(&self) -> Option<u32>

This gets a block compression format’s block size, and is only defined for compressed formats
source§

fn get_fourcc(&self) -> Option<FourCC>

Get the fourcc code for this format, if known
source§

fn requires_extension(&self) -> bool

Returns true if the DX10 extention is required to use this format.
source§

fn get_pitch_height(&self) -> u32

This gets the height of each row of data. Normally it is 1, but for block compressed textures, each row is 4 pixels high.
source§

fn get_minimum_mipmap_size_in_bytes(&self) -> Option<u32>

This gets the minimum mipmap size in bytes. Even if they go all the way down to 1x1, there is a minimum number of bytes based on bits per pixel or blocksize.
source§

impl Debug for D3DFormat

source§

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

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

impl From<D3DFormat> for PixelFormat

source§

fn from(format: D3DFormat) -> PixelFormat

Converts to this type from the input type.
source§

impl Hash for D3DFormat

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 PartialEq for D3DFormat

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for D3DFormat

source§

impl Eq for D3DFormat

source§

impl StructuralEq for D3DFormat

source§

impl StructuralPartialEq for D3DFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.