Enum Format

Source
#[repr(u32)]
pub enum Format {
Show 21 variants Unknown = 0, L8 = 4_400, A8 = 4_401, Rgba4 = 5_184, Rgb5a1 = 5_185, Argb8 = 5_200, Rgbx8 = 5_201, Argb82 = 5_202, R32F = 8_528, Rg16F = 8_784, Rgba16F = 9_312, Rgba32F = 9_328, Dxt1 = 13_344, Dxt3 = 13_360, Dxt5 = 13_361, D16 = 16_704, D24S8 = 16_976, Rgba8 = 17_409, Null = 20_736, Shadow16 = 20_800, Shadow24 = 20_816,
}
Available on crate feature tex only.
Expand description

Pixel format of a texture.

Variants§

§

Unknown = 0

§

L8 = 4_400

§

A8 = 4_401

§

Rgba4 = 5_184

§

Rgb5a1 = 5_185

§

Argb8 = 5_200

§

Rgbx8 = 5_201

§

Argb82 = 5_202

§

R32F = 8_528

§

Rg16F = 8_784

§

Rgba16F = 9_312

§

Rgba32F = 9_328

§

Dxt1 = 13_344

§

Dxt3 = 13_360

§

Dxt5 = 13_361

§

D16 = 16_704

§

D24S8 = 16_976

§

Rgba8 = 17_409

§

Null = 20_736

§

Shadow16 = 20_800

§

Shadow24 = 20_816

Implementations§

Source§

impl Format

Source

pub fn kind(&self) -> FormatKind

Texture format kind.

Source

pub fn components(&self) -> u8

Channel or component count.

Source

pub fn bits_per_pixel(&self) -> u8

Bits per pixel.

Trait Implementations§

Source§

impl BinRead for Format

Source§

type Args = ()

The type used for the args parameter of read_args() and read_options(). Read more
Source§

fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_options: &ReadOptions, __binrw_generated_var_arguments: Self::Args, ) -> BinResult<Self>

Read Self from the reader using the given ReadOptions and arguments.
Source§

fn read<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args: Default,

Read Self from the reader using default arguments.
Source§

fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader using the given arguments.
Source§

fn after_parse<R>( &mut self, _: &mut R, _: &ReadOptions, _: Self::Args, ) -> Result<(), Error>
where R: Read + Seek,

Runs any post-processing steps required to finalize construction of the object.
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 From<Format> for u32

Source§

fn from(enum_value: Format) -> Self

Converts to this type from the input type.
Source§

impl Copy 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.