#[repr(u8)]pub enum DataFormat {
Intensity4 = 0,
Intensity8 = 1,
IntensityA4 = 2,
IntensityA8 = 3,
Rgb565 = 4,
Rgb5a3 = 5,
Argb8888 = 6,
Index4 = 8,
Index8 = 9,
Dxt1 = 14,
}Expand description
This enum specifies the format for which a GVR texture should be encoded in.
Most formats are to be used in accordance with crate::TextureEncoder::new_gcix() or
crate::TextureEncoder::new_gbix(). If you wish to use DataFormat::Index4 or
DataFormat::Index8, then use crate::TextureEncoder::new_gcix_palettized() or
crate::TextureEncoder::new_gbix_palettized(). That way you can specify the color format for
the color palette alongside the data format.
Variants§
Intensity4 = 0
Stores 4-bit intensity values (each pixel is composed of just one value). This makes the image look grayscale. This format stores no alpha channel.
Intensity8 = 1
Stores 8-bit intensity values (each pixel is composed of just one value). This makes the image look grayscale. This format stores no alpha channel.
IntensityA4 = 2
Stores 4-bit intensity values (each pixel is composed of just one value) along with an alpha channel. This makes the image look grayscale.
IntensityA8 = 3
Stores 8-bit intensity values (each pixel is composed of just one value) along with an alpha channel. This makes the image look grayscale.
Rgb565 = 4
Stores 16-bit color values, but does not save an alpha channel.
Rgb5a3 = 5
Stores 16-bit color values, but saves the alpha channel as well.
Argb8888 = 6
Stores 24-bit depth true color (1 byte per color). It also stores an 8-bit alpha channel.
This format is by far the one with the largest filesize, although the most accurate in terms of color.
Index4 = 8
Stores 4-bit indices into a quantized color palette.
The color palette can only encode a maximum of 16 colors, which means images with a larger variety of colors will not look that great.
Index8 = 9
Stores 8-bit indices into a quantized color palette.
The color palette can encode a maximum of 256 colors, which means images preserve a decent
amount of their color quality, as opposed to the DataFormat::Index4 format.
Dxt1 = 14
Encodes the image using a DXT1 compression algorithm, also known as BC1 (Block Compression 1).
Works well in environments where the texture cannot be easily viewed (like a 3D model in motion), but not that well in other cases (like on a 2D menu), as the compression artifacts can be quite visible at times.
Trait Implementations§
Source§impl Clone for DataFormat
impl Clone for DataFormat
Source§fn clone(&self) -> DataFormat
fn clone(&self) -> DataFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DataFormat
Source§impl Default for DataFormat
impl Default for DataFormat
Source§fn default() -> DataFormat
fn default() -> DataFormat
Source§impl From<DataFormat> for u8
impl From<DataFormat> for u8
Source§fn from(value: DataFormat) -> Self
fn from(value: DataFormat) -> Self
Source§impl From<PixelFormat> for DataFormat
impl From<PixelFormat> for DataFormat
Source§fn from(value: PixelFormat) -> Self
fn from(value: PixelFormat) -> Self
Auto Trait Implementations§
impl Freeze for DataFormat
impl RefUnwindSafe for DataFormat
impl Send for DataFormat
impl Sync for DataFormat
impl Unpin for DataFormat
impl UnsafeUnpin for DataFormat
impl UnwindSafe for DataFormat
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
ReadEndian::read_from_little_endian().