Struct image::SubImage[][src]

pub struct SubImage<I> { /* fields omitted */ }

A View into another image

Instances of this struct can be created using:

Implementations

impl<I> SubImage<I>[src]

pub fn new(image: I, x: u32, y: u32, width: u32, height: u32) -> SubImage<I>[src]

Construct a new subimage

pub fn change_bounds(&mut self, x: u32, y: u32, width: u32, height: u32)[src]

Change the coordinates of this subimage.

pub fn to_image(
    &self
) -> ImageBuffer<<<I as Deref>::Target as GenericImageView>::Pixel, Vec<<<<I as Deref>::Target as GenericImageView>::Pixel as Pixel>::Subpixel>> where
    I: Deref,
    I::Target: GenericImage + 'static, 
[src]

Convert this subimage to an ImageBuffer

Trait Implementations

impl<I> GenericImage for SubImage<I> where
    I: DerefMut,
    I::Target: GenericImage + Sized
[src]

type InnerImage = I::Target

Underlying image type. This is mainly used by SubImages in order to always have a reference to the original image. This allows for less indirections and it eases the use of nested SubImages. Read more

fn blend_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)[src]

DEPRECATED: This method will be removed. Blend the pixel directly instead.

impl<I> GenericImageView for SubImage<I> where
    I: Deref,
    I::Target: GenericImageView + Sized
[src]

type Pixel = <<I as Deref>::Target as GenericImageView>::Pixel

The type of pixel.

type InnerImageView = I::Target

Underlying image type. This is mainly used by SubImages in order to always have a reference to the original image. This allows for less indirections and it eases the use of nested SubImages. Read more

Auto Trait Implementations

impl<I> RefUnwindSafe for SubImage<I> where
    I: RefUnwindSafe

impl<I> Send for SubImage<I> where
    I: Send

impl<I> Sync for SubImage<I> where
    I: Sync

impl<I> Unpin for SubImage<I> where
    I: Unpin

impl<I> UnwindSafe for SubImage<I> where
    I: 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, 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.