[][src]Struct image::SubImage

pub struct SubImage<'a, I: 'a> { /* fields omitted */ }

A View into another image

Methods

impl<'a, I: GenericImage + 'static> SubImage<'a, I> where
    I::Pixel: 'static,
    <I::Pixel as Pixel>::Subpixel: 'static, 
[src]

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

Construct a new subimage

pub fn inner_mut(&mut self) -> &mut I[src]

Returns a mutable reference to the wrapped image.

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::Pixel, Vec<<I::Pixel as Pixel>::Subpixel>>
[src]

Convert this subimage to an ImageBuffer

Trait Implementations

impl<'a, I: GenericImage + 'static> GenericImage for SubImage<'a, I> where
    I::Pixel: 'static,
    <I::Pixel as Pixel>::Subpixel: 'static, 
[src]

type Pixel = I::Pixel

The type of pixel.

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

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

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

The width of this image.

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

The height of this image.

fn in_bounds(&self, x: u32, y: u32) -> bool[src]

Returns true if this x, y coordinate is contained inside the image.

unsafe fn unsafe_get_pixel(&self, x: u32, y: u32) -> Self::Pixel[src]

Returns the pixel located at (x, y) Read more

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

Puts a pixel at location (x, y) Read more

Important traits for Pixels<'a, I>
fn pixels(&self) -> Pixels<Self>[src]

Returns an Iterator over the pixels of this image. The iterator yields the coordinates of each pixel along with their value Read more

Important traits for MutPixels<'a, I>
fn pixels_mut(&mut self) -> MutPixels<Self>[src]

Deprecated:

This cannot be implemented safely in Rust. Please use the image buffer directly.

Returns an Iterator over mutable pixels of this image. The iterator yields the coordinates of each pixel along with a mutable reference to them. Read more

fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> bool where
    O: GenericImage<Pixel = Self::Pixel>, 
[src]

Copies all of the pixels from another image into this image. Read more

fn sub_image(
    &mut self,
    x: u32,
    y: u32,
    width: u32,
    height: u32
) -> SubImage<Self> where
    Self: 'static,
    <Self::Pixel as Pixel>::Subpixel: 'static,
    Self::Pixel: 'static, 
[src]

Returns a subimage that is a view into this image.

Auto Trait Implementations

impl<'a, I> Send for SubImage<'a, I> where
    I: Send

impl<'a, I> Sync for SubImage<'a, I> where
    I: Sync

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.