#[repr(i32)]pub enum TextureFormat {
Show 52 variants
Alpha8 = 1,
ARGB4444 = 2,
RGB24 = 3,
RGBA32 = 4,
ARGB32 = 5,
RGB565 = 7,
R16 = 9,
DXT1 = 10,
DXT5 = 12,
RGBA4444 = 13,
BGRA32 = 14,
RHalf = 15,
RGHalf = 16,
RGBAHalf = 17,
RFloat = 18,
RGFloat = 19,
RGBAFloat = 20,
YUY2 = 21,
RGB9e5Float = 22,
BC6H = 24,
BC7 = 25,
BC4 = 26,
BC5 = 27,
DXT1Crunched = 28,
DXT5Crunched = 29,
PVRTC_RGB2 = 30,
PVRTC_RGBA2 = 31,
PVRTC_RGB4 = 32,
PVRTC_RGBA4 = 33,
ETC_RGB4 = 34,
EAC_R = 41,
EAC_R_SIGNED = 42,
EAC_RG = 43,
EAC_RG_SIGNED = 44,
ETC2_RGB = 45,
ETC2_RGBA1 = 46,
ETC2_RGBA8 = 47,
ASTC_RGB_4x4 = 48,
ASTC_RGB_5x5 = 49,
ASTC_RGB_6x6 = 50,
ASTC_RGB_8x8 = 51,
ASTC_RGB_10x10 = 52,
ASTC_RGB_12x12 = 53,
ASTC_RGBA_4x4 = 54,
ASTC_RGBA_5x5 = 55,
ASTC_RGBA_6x6 = 56,
ASTC_RGBA_8x8 = 57,
ASTC_RGBA_10x10 = 58,
ASTC_RGBA_12x12 = 59,
ETC_RGB4Crunched = 64,
ETC2_RGBA8Crunched = 65,
Unknown = -1,
}Expand description
Unity texture formats
This enum represents all texture formats supported by Unity. Values match Unity’s internal TextureFormat enum.
Variants§
Alpha8 = 1
ARGB4444 = 2
RGB24 = 3
RGBA32 = 4
ARGB32 = 5
RGB565 = 7
R16 = 9
DXT1 = 10
DXT5 = 12
RGBA4444 = 13
BGRA32 = 14
RHalf = 15
RGHalf = 16
RGBAHalf = 17
RFloat = 18
RGFloat = 19
RGBAFloat = 20
YUY2 = 21
RGB9e5Float = 22
BC6H = 24
BC7 = 25
BC4 = 26
BC5 = 27
DXT1Crunched = 28
DXT5Crunched = 29
PVRTC_RGB2 = 30
PVRTC_RGBA2 = 31
PVRTC_RGB4 = 32
PVRTC_RGBA4 = 33
ETC_RGB4 = 34
EAC_R = 41
EAC_R_SIGNED = 42
EAC_RG = 43
EAC_RG_SIGNED = 44
ETC2_RGB = 45
ETC2_RGBA1 = 46
ETC2_RGBA8 = 47
ASTC_RGB_4x4 = 48
ASTC_RGB_5x5 = 49
ASTC_RGB_6x6 = 50
ASTC_RGB_8x8 = 51
ASTC_RGB_10x10 = 52
ASTC_RGB_12x12 = 53
ASTC_RGBA_4x4 = 54
ASTC_RGBA_5x5 = 55
ASTC_RGBA_6x6 = 56
ASTC_RGBA_8x8 = 57
ASTC_RGBA_10x10 = 58
ASTC_RGBA_12x12 = 59
ETC_RGB4Crunched = 64
ETC2_RGBA8Crunched = 65
Unknown = -1
Implementations§
Source§impl TextureFormat
impl TextureFormat
Sourcepub fn info(&self) -> TextureFormatInfo
pub fn info(&self) -> TextureFormatInfo
Get format information
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Check if format is supported for decoding
Sourcepub fn calculate_data_size(&self, width: u32, height: u32) -> u32
pub fn calculate_data_size(&self, width: u32, height: u32) -> u32
Get expected data size for given dimensions
Sourcepub fn is_crunch_compressed(&self) -> bool
pub fn is_crunch_compressed(&self) -> bool
Check if format uses Crunch compression
Sourcepub fn is_basic_format(&self) -> bool
pub fn is_basic_format(&self) -> bool
Check if format is a basic uncompressed format
Sourcepub fn is_compressed_format(&self) -> bool
pub fn is_compressed_format(&self) -> bool
Check if format is a compressed format
Sourcepub fn is_mobile_format(&self) -> bool
pub fn is_mobile_format(&self) -> bool
Check if format is a mobile-specific format
Trait Implementations§
Source§impl Clone for TextureFormat
impl Clone for TextureFormat
Source§fn clone(&self) -> TextureFormat
fn clone(&self) -> TextureFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextureFormat
impl Debug for TextureFormat
Source§impl Default for TextureFormat
impl Default for TextureFormat
Source§fn default() -> TextureFormat
fn default() -> TextureFormat
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TextureFormat
impl<'de> Deserialize<'de> for TextureFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<i32> for TextureFormat
impl From<i32> for TextureFormat
Source§impl Hash for TextureFormat
impl Hash for TextureFormat
Source§impl PartialEq for TextureFormat
impl PartialEq for TextureFormat
Source§impl Serialize for TextureFormat
impl Serialize for TextureFormat
impl Copy for TextureFormat
impl Eq for TextureFormat
impl StructuralPartialEq for TextureFormat
Auto Trait Implementations§
impl Freeze for TextureFormat
impl RefUnwindSafe for TextureFormat
impl Send for TextureFormat
impl Sync for TextureFormat
impl Unpin for TextureFormat
impl UnwindSafe for TextureFormat
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().