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
Auto Trait Implementations
impl<T> RefUnwindSafe for Image<T> where
T: RefUnwindSafe,
impl<T> RefUnwindSafe for Image<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Image<T> where
T: UnwindSafe,
impl<T> UnwindSafe for Image<T> where
T: UnwindSafe,