#[repr(u8)]pub enum ImageFormat {
R8 = 1,
R16 = 2,
BGRA8 = 3,
RGBAF32 = 4,
RG8 = 5,
RG16 = 6,
RGBAI32 = 7,
RGBA8 = 8,
}
Expand description
Specifies the format of a series of pixels, in driver terms.
Variants§
R8 = 1
One-channel, byte storage. The “red” doesn’t map to the color red per se, and is just the way that OpenGL has historically referred to single-channel buffers.
R16 = 2
One-channel, short storage
BGRA8 = 3
Four channels, byte storage.
RGBAF32 = 4
Four channels, float storage.
RG8 = 5
Two-channels, byte storage. Similar to R8
, this just means
“two channels” rather than “red and green”.
RG16 = 6
Two-channels, byte storage. Similar to R16
, this just means
“two channels” rather than “red and green”.
RGBAI32 = 7
Four channels, signed integer storage.
RGBA8 = 8
Four channels, byte storage.
Implementations§
Source§impl ImageFormat
impl ImageFormat
Sourcepub fn bytes_per_pixel(self) -> i32
pub fn bytes_per_pixel(self) -> i32
Returns the number of bytes per pixel for the given format.
Trait Implementations§
Source§impl Clone for ImageFormat
impl Clone for ImageFormat
Source§fn clone(&self) -> ImageFormat
fn clone(&self) -> ImageFormat
Returns a copy 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 ImageFormat
impl Debug for ImageFormat
Source§impl<'de> Deserialize<'de> for ImageFormat
impl<'de> Deserialize<'de> for ImageFormat
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 Hash for ImageFormat
impl Hash for ImageFormat
Source§impl PartialEq for ImageFormat
impl PartialEq for ImageFormat
Source§impl Serialize for ImageFormat
impl Serialize for ImageFormat
impl Copy for ImageFormat
impl Eq for ImageFormat
impl StructuralPartialEq for ImageFormat
Auto Trait Implementations§
impl Freeze for ImageFormat
impl RefUnwindSafe for ImageFormat
impl Send for ImageFormat
impl Sync for ImageFormat
impl Unpin for ImageFormat
impl UnwindSafe for ImageFormat
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