[−][src]Enum icns::PixelFormat
Formats for storing pixel data in an image.
This type determines how the raw data array of an
Image
is to be interpreted.
Regardless of format, pixel data for an image is always stored one complete pixel at a time, in row-major order (that is, the top-left pixel comes first, followed by the rest of the top row from left to right; then comes the second row down, again from left to right, and so on until finally the bottom-right pixel comes last).
Variants
32-bit color with alpha channel. Each pixel is four bytes, with red first and alpha last.
24-bit color with no alpha. Each pixel is three bytes, with red first and blue last.
16-bit grayscale-with-alpha. Each pixel is two bytes, with the grayscale value first and alpha second.
8-bit grayscale with no alpha. Each pixel is one byte (0=black, 255=white).
8-bit alpha mask with no color. Each pixel is one byte (0=transparent, 255=opaque).
Implementations
impl PixelFormat
[src]
pub fn bits_per_pixel(self) -> u32
[src]
Returns the number of bits needed to store a single pixel in this format.
Trait Implementations
impl Clone for PixelFormat
[src]
fn clone(&self) -> PixelFormat
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PixelFormat
[src]
impl Debug for PixelFormat
[src]
impl Eq for PixelFormat
[src]
impl Hash for PixelFormat
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<PixelFormat> for PixelFormat
[src]
fn eq(&self, other: &PixelFormat) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for PixelFormat
[src]
impl StructuralPartialEq for PixelFormat
[src]
Auto Trait Implementations
impl RefUnwindSafe for PixelFormat
impl Send for PixelFormat
impl Sync for PixelFormat
impl Unpin for PixelFormat
impl UnwindSafe for PixelFormat
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,