Struct image::SubImage [−][src]
pub struct SubImage<I> { /* fields omitted */ }
A View into another image
Instances of this struct can be created using:
GenericImage::sub_image
to create a mutable view,GenericImageView::view
to create an immutable view,SubImage::new
to instantiate the struct directly.
Implementations
impl<I> SubImage<I>
[src]
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]
&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,
Convert this subimage to an ImageBuffer
Trait Implementations
impl<I> GenericImage for SubImage<I> where
I: DerefMut,
I::Target: GenericImage + Sized,
[src]
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 get_pixel_mut(&mut self, x: u32, y: u32) -> &mut Self::Pixel
[src]
fn put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
fn blend_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
DEPRECATED: This method will be removed. Blend the pixel directly instead.
fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut Self::InnerImage>
[src]
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut Self::InnerImage>
fn inner_mut(&mut self) -> &mut Self::InnerImage
[src]
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> ImageResult<()> where
O: GenericImageView<Pixel = Self::Pixel>,
[src]
O: GenericImageView<Pixel = Self::Pixel>,
fn copy_within(&mut self, source: Rect, x: u32, y: u32) -> bool
[src]
impl<I> GenericImageView for SubImage<I> where
I: Deref,
I::Target: GenericImageView + Sized,
[src]
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
fn dimensions(&self) -> (u32, u32)
[src]
fn bounds(&self) -> (u32, u32, u32, u32)
[src]
fn get_pixel(&self, x: u32, y: u32) -> Self::Pixel
[src]
fn view(
&self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&Self::InnerImageView>
[src]
&self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&Self::InnerImageView>
fn inner(&self) -> &Self::InnerImageView
[src]
fn width(&self) -> u32
[src]
fn height(&self) -> u32
[src]
fn in_bounds(&self, x: u32, y: u32) -> bool
[src]
unsafe fn unsafe_get_pixel(&self, x: u32, y: u32) -> Self::Pixel
[src]
fn pixels(&self) -> Pixels<'_, Self>ⓘ
[src]
Auto Trait Implementations
impl<I> RefUnwindSafe for SubImage<I> where
I: RefUnwindSafe,
I: RefUnwindSafe,
impl<I> Send for SubImage<I> where
I: Send,
I: Send,
impl<I> Sync for SubImage<I> where
I: Sync,
I: Sync,
impl<I> Unpin for SubImage<I> where
I: Unpin,
I: Unpin,
impl<I> UnwindSafe for SubImage<I> where
I: UnwindSafe,
I: UnwindSafe,