[][src]Struct awmpde::RgbImage

pub struct RgbImage(pub ImageBuffer<Rgb<u8>, Vec<u8>>);

Methods from Deref<Target = ImageBuffer<Rgb<u8>, Vec<u8>>>

pub fn as_raw(&self) -> &Container[src]

Returns the underlying raw buffer

pub fn dimensions(&self) -> (u32, u32)[src]

The width and height of this image.

pub fn width(&self) -> u32[src]

The width of this image.

pub fn height(&self) -> u32[src]

The height of this image.

pub fn pixels(&self) -> Pixels<'_, P>[src]

Returns an iterator over the pixels of this image. The iteration order is x = 0 to width then y = 0 to height

pub fn rows(&self) -> Rows<'_, P>[src]

Returns an iterator over the rows of this image.

Only non-empty rows can be iterated in this manner. In particular the iterator will not yield any item when the width of the image is 0 or a pixel type without any channels is used. This ensures that its length can always be represented by usize.

pub fn enumerate_pixels(&self) -> EnumeratePixels<'_, P>[src]

Enumerates over the pixels of the image. The iterator yields the coordinates of each pixel along with a reference to them. The iteration order is x = 0 to width then y = 0 to height

pub fn enumerate_rows(&self) -> EnumerateRows<'_, P>[src]

Enumerates over the rows of the image. The iterator yields the y-coordinate of each row along with a reference to them.

pub fn get_pixel(&self, x: u32, y: u32) -> &P[src]

Gets a reference to the pixel at location (x, y)

Panics

Panics if (x, y) is out of the bounds (width, height).

pub fn sample_layout(&self) -> SampleLayout[src]

Get the format of the buffer when viewed as a matrix of samples.

pub fn as_flat_samples(&self) -> FlatSamples<&[<P as Pixel>::Subpixel]> where
    Container: AsRef<[<P as Pixel>::Subpixel]>, 
[src]

Return a view on the raw sample buffer.

See into_flat_samples for more details.

pub fn as_flat_samples_mut(
    &mut self
) -> FlatSamples<&mut [<P as Pixel>::Subpixel]> where
    Container: AsMut<[<P as Pixel>::Subpixel]>, 
[src]

Return a mutable view on the raw sample buffer.

See into_flat_samples for more details.

pub fn pixels_mut(&mut self) -> PixelsMut<'_, P>[src]

Returns an iterator over the mutable pixels of this image.

pub fn rows_mut(&mut self) -> RowsMut<'_, P>[src]

Returns an iterator over the mutable rows of this image.

Only non-empty rows can be iterated in this manner. In particular the iterator will not yield any item when the width of the image is 0 or a pixel type without any channels is used. This ensures that its length can always be represented by usize.

pub fn enumerate_pixels_mut(&mut self) -> EnumeratePixelsMut<'_, P>[src]

Enumerates over the pixels of the image. The iterator yields the coordinates of each pixel along with a mutable reference to them.

pub fn enumerate_rows_mut(&mut self) -> EnumerateRowsMut<'_, P>[src]

Enumerates over the rows of the image. The iterator yields the y-coordinate of each row along with a mutable reference to them.

pub fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut P[src]

Gets a reference to the mutable pixel at location (x, y)

Panics

Panics if (x, y) is out of the bounds (width, height).

pub fn put_pixel(&mut self, x: u32, y: u32, pixel: P)[src]

Puts a pixel at location (x, y)

Panics

Panics if (x, y) is out of the bounds (width, height).

pub fn save<Q>(&self, path: Q) -> Result<(), ImageError> where
    Q: AsRef<Path>, 
[src]

Saves the buffer to a file at the path specified.

The image format is derived from the file extension. Currently only jpeg and png files are supported.

pub fn save_with_format<Q>(
    &self,
    path: Q,
    format: ImageFormat
) -> Result<(), ImageError> where
    Q: AsRef<Path>, 
[src]

Saves the buffer to a file at the specified path in the specified format.

See save_buffer_with_format for supported types.

Trait Implementations

impl Debug for RgbImage[src]

impl Deref for RgbImage[src]

type Target = ImageBuffer<Rgb<u8>, Vec<u8>>

The resulting type after dereferencing.

impl DerefMut for RgbImage[src]

impl FromField for RgbImage[src]

type Error = Error

The associated error which can be returned.

type Future = Pin<Box<dyn Future<Output = Result<RgbImage, <RgbImage as FromField>::Error>> + 'static>>

Future that resolves to a Self

Auto Trait Implementations

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> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,