Struct turbojpeg::Image[][src]

pub struct Image<T> {
    pub pixels: T,
    pub width: usize,
    pub pitch: usize,
    pub height: usize,
    pub format: PixelFormat,
}

An image with pixels of type T (typically &[u8] or &mut [u8]).

Data for pixel in row x and column y is stored in pixels at offset y*pitch + x*format.size().

Fields

pixels: T

Pixel data of the image (typically &[u8] or &mut [u8]).

width: usize

Width of the image in pixels (number of columns).

pitch: usize

Pitch (stride) defines the size of one image row in bytes. Overlapping rows are not supported, so we require that pitch >= width * format.size().

height: usize

Height of the image in pixels (number of rows).

format: PixelFormat

Format of pixels in memory, determines the color format (RGB, RGBA, grayscale or CMYK) and the memory layout (RGB, BGR, RGBA, …).

Trait Implementations

impl<T: Clone> Clone for Image<T>[src]

impl<T: Copy> Copy for Image<T>[src]

impl<T: Debug> Debug for Image<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Image<T> where
    T: RefUnwindSafe

impl<T> Send for Image<T> where
    T: Send

impl<T> Sync for Image<T> where
    T: Sync

impl<T> Unpin for Image<T> where
    T: Unpin

impl<T> UnwindSafe for Image<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.