#[repr(u8)]pub enum ResourceTextureFormat {
R = 0,
Rg = 1,
Rgba = 2,
Bc4 = 3,
Bc5 = 4,
Bc7 = 5,
Astc4x4 = 6,
}Expand description
Defines what format a texture is in.
R,Rg,Rgbaare uncompressed formats.Bc4,Bc5,Bc7,Astc4x4are compressed formats.
Normally, these are decompressed on the GPU, but CPU implementations are here for convenience.
Especially, Astc is a poorly supported format on desktops, so a CPU “polyfill” is required.
Variants§
Trait Implementations§
Source§impl BinRead for ResourceTextureFormat
impl BinRead for ResourceTextureFormat
Source§fn read_options<R: Read + Seek>(
__binrw_generated_var_reader: &mut R,
__binrw_generated_var_endian: Endian,
__binrw_generated_var_arguments: Self::Args<'_>,
) -> BinResult<Self>
fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Read
Self from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
Read
T from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Read
Self from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§impl Clone for ResourceTextureFormat
impl Clone for ResourceTextureFormat
Source§fn clone(&self) -> ResourceTextureFormat
fn clone(&self) -> ResourceTextureFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ResourceTextureFormat
Source§impl Debug for ResourceTextureFormat
impl Debug for ResourceTextureFormat
Source§impl From<ResourceTextureFormat> for u8
impl From<ResourceTextureFormat> for u8
Source§fn from(enum_value: ResourceTextureFormat) -> Self
fn from(enum_value: ResourceTextureFormat) -> Self
Converts to this type from the input type.
Source§impl ReadEndian for ResourceTextureFormat
impl ReadEndian for ResourceTextureFormat
Source§const ENDIAN: EndianKind = <u8 as binrw::meta::ReadEndian>::ENDIAN
const ENDIAN: EndianKind = <u8 as binrw::meta::ReadEndian>::ENDIAN
The endianness of the type.
Source§impl TryFrom<u8> for ResourceTextureFormat
impl TryFrom<u8> for ResourceTextureFormat
Source§type Error = TryFromPrimitiveError<ResourceTextureFormat>
type Error = TryFromPrimitiveError<ResourceTextureFormat>
The type returned in the event of a conversion error.
Source§impl TryFromPrimitive for ResourceTextureFormat
impl TryFromPrimitive for ResourceTextureFormat
const NAME: &'static str = "ResourceTextureFormat"
type Primitive = u8
type Error = TryFromPrimitiveError<ResourceTextureFormat>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
Auto Trait Implementations§
impl Freeze for ResourceTextureFormat
impl RefUnwindSafe for ResourceTextureFormat
impl Send for ResourceTextureFormat
impl Sync for ResourceTextureFormat
impl Unpin for ResourceTextureFormat
impl UnsafeUnpin for ResourceTextureFormat
impl UnwindSafe for ResourceTextureFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more