Struct image::SubImage [] [src]

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

A View into another image

Methods

impl<'a, I: GenericImage + 'static> SubImage<'a, I> where I::Pixel: 'static, I::Pixel::Subpixel: 'static

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

Construct a new subimage

fn inner_mut(&mut self) -> &mut I

Returns a mutable reference to the wrapped image.

fn change_bounds(&mut self, x: u32, y: u32, width: u32, height: u32)

Change the coordinates of this subimage.

fn to_image(&self) -> ImageBuffer<I::Pixel, Vec<I::Pixel::Subpixel>>

Convert this subimage to an ImageBuffer

Trait Implementations

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

type Pixel = I::Pixel

fn dimensions(&self) -> (u32, u32)

fn bounds(&self) -> (u32, u32, u32, u32)

fn get_pixel(&self, x: u32, y: u32) -> I::Pixel

fn put_pixel(&mut self, x: u32, y: u32, pixel: I::Pixel)

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

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

fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut I::Pixel

fn width(&self) -> u32

fn height(&self) -> u32

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

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

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

fn pixels(&self) -> Pixels<Self>

fn pixels_mut(&mut self) -> MutPixels<Self>

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

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