[−][src]Struct image::SubImage
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]
I::Pixel: 'static,
<I::Pixel as Pixel>::Subpixel: 'static,
pub fn new(
image: &mut I,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<I>
[src]
image: &mut I,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<I>
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]
&self
) -> ImageBuffer<I::Pixel, Vec<<I::Pixel as 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 as Pixel>::Subpixel: 'static,
[src]
I::Pixel: 'static,
<I::Pixel as Pixel>::Subpixel: 'static,
type Pixel = I::Pixel
The type of pixel.
fn dimensions(&self) -> (u32, u32)
[src]
fn bounds(&self) -> (u32, u32, u32, u32)
[src]
fn get_pixel(&self, x: u32, y: u32) -> I::Pixel
[src]
fn put_pixel(&mut self, x: u32, y: u32, pixel: I::Pixel)
[src]
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 get_pixel_mut(&mut self, x: u32, y: u32) -> &mut I::Pixel
[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]
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
ⓘImportant traits for Pixels<'a, I>fn pixels(&self) -> Pixels<Self>
[src]
ⓘImportant traits for Pixels<'a, I>
ⓘImportant traits for MutPixels<'a, I>fn pixels_mut(&mut self) -> MutPixels<Self>
[src]
ⓘImportant traits for MutPixels<'a, I>
fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> bool where
O: GenericImage<Pixel = Self::Pixel>,
[src]
O: GenericImage<Pixel = Self::Pixel>,
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]
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<Self> where
Self: 'static,
<Self::Pixel as Pixel>::Subpixel: 'static,
Self::Pixel: 'static,
Auto Trait Implementations
impl<'a, I> Send for SubImage<'a, I> where
I: Send,
I: Send,
impl<'a, I> Sync for SubImage<'a, I> where
I: Sync,
I: Sync,
impl<'a, I> Unpin for SubImage<'a, I>
impl<'a, I> !UnwindSafe for SubImage<'a, I>
impl<'a, I> RefUnwindSafe for SubImage<'a, I> where
I: RefUnwindSafe,
I: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,