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
impl D3DFormat
sourcepub fn r_bit_mask(&self) -> Option<u32>
pub fn r_bit_mask(&self) -> Option<u32>
This gets the bitmask for the red channel pixels
sourcepub fn g_bit_mask(&self) -> Option<u32>
pub fn g_bit_mask(&self) -> Option<u32>
This gets the bitmask for the green channel pixels
sourcepub fn b_bit_mask(&self) -> Option<u32>
pub fn b_bit_mask(&self) -> Option<u32>
This gets the bitmask for the blue channel pixels
sourcepub fn a_bit_mask(&self) -> Option<u32>
pub fn a_bit_mask(&self) -> Option<u32>
This gets the bitmask for the alpha channel pixels
sourcepub fn try_from_pixel_format(pixel_format: &PixelFormat) -> Option<D3DFormat>
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 DataFormat for D3DFormat
impl DataFormat for D3DFormat
source§fn get_pitch(&self, width: u32) -> Option<u32>
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>
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>
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>
fn get_fourcc(&self) -> Option<FourCC>
Get the fourcc code for this format, if known
source§fn requires_extension(&self) -> bool
fn requires_extension(&self) -> bool
Returns true if the DX10 extention is required to use this format.
source§fn get_pitch_height(&self) -> u32
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>
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 From<D3DFormat> for PixelFormat
impl From<D3DFormat> for PixelFormat
source§fn from(format: D3DFormat) -> PixelFormat
fn from(format: D3DFormat) -> PixelFormat
Converts to this type from the input type.
source§impl PartialEq for D3DFormat
impl PartialEq for D3DFormat
impl Copy for D3DFormat
impl Eq for D3DFormat
impl StructuralEq for D3DFormat
impl StructuralPartialEq for D3DFormat
Auto Trait Implementations§
impl RefUnwindSafe for D3DFormat
impl Send for D3DFormat
impl Sync for D3DFormat
impl Unpin for D3DFormat
impl UnwindSafe for D3DFormat
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