Enum webrender_api::ImageFormat
source · #[repr(u8)]pub enum ImageFormat {
R8,
R16,
BGRA8,
RGBAF32,
RG8,
RG16,
RGBAI32,
RGBA8,
}
Expand description
Specifies the format of a series of pixels, in driver terms.
Variants§
R8
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
One-channel, short storage
BGRA8
Four channels, byte storage.
RGBAF32
Four channels, float storage.
RG8
Two-channels, byte storage. Similar to R8
, this just means
“two channels” rather than “red and green”.
RG16
Two-channels, short storage. Similar to R16
, this just means
“two channels” rather than “red and green”.
RGBAI32
Four channels, signed integer storage.
RGBA8
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<ImageFormat> for ImageFormat
impl PartialEq<ImageFormat> for ImageFormat
source§fn eq(&self, other: &ImageFormat) -> bool
fn eq(&self, other: &ImageFormat) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ImageFormat
impl Serialize for ImageFormat
impl Copy for ImageFormat
impl Eq for ImageFormat
impl StructuralEq for ImageFormat
impl StructuralPartialEq for ImageFormat
Auto Trait Implementations§
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