[−][src]Struct purrmitive::SubImage
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]
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, Global>> where
I: Deref,
<I as Deref>::Target: GenericImage,
<I as Deref>::Target: 'static,
[src]
&self
) -> ImageBuffer<<<I as Deref>::Target as GenericImageView>::Pixel, Vec<<<<I as Deref>::Target as GenericImageView>::Pixel as Pixel>::Subpixel, Global>> where
I: Deref,
<I as Deref>::Target: GenericImage,
<I as Deref>::Target: 'static,
Convert this subimage to an ImageBuffer
Trait Implementations
impl<I> GenericImage for SubImage<I> where
I: DerefMut,
<I as Deref>::Target: GenericImage,
<I as Deref>::Target: Sized,
[src]
I: DerefMut,
<I as Deref>::Target: GenericImage,
<I as Deref>::Target: Sized,
type InnerImage = <I as Deref>::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
pub fn get_pixel_mut(
&mut self,
x: u32,
y: u32
) -> &mut <SubImage<I> as GenericImageView>::Pixel
[src]
&mut self,
x: u32,
y: u32
) -> &mut <SubImage<I> as GenericImageView>::Pixel
pub fn put_pixel(
&mut self,
x: u32,
y: u32,
pixel: <SubImage<I> as GenericImageView>::Pixel
)
[src]
&mut self,
x: u32,
y: u32,
pixel: <SubImage<I> as GenericImageView>::Pixel
)
pub fn blend_pixel(
&mut self,
x: u32,
y: u32,
pixel: <SubImage<I> as GenericImageView>::Pixel
)
[src]
&mut self,
x: u32,
y: u32,
pixel: <SubImage<I> as GenericImageView>::Pixel
)
DEPRECATED: This method will be removed. Blend the pixel directly instead.
pub fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut <SubImage<I> as GenericImage>::InnerImage>
[src]
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut <SubImage<I> as GenericImage>::InnerImage>
pub fn inner_mut(&mut self) -> &mut <SubImage<I> as GenericImage>::InnerImage
[src]
pub unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
pub fn copy_from<O>(
&mut self,
other: &O,
x: u32,
y: u32
) -> Result<(), ImageError> where
O: GenericImageView<Pixel = Self::Pixel>,
[src]
&mut self,
other: &O,
x: u32,
y: u32
) -> Result<(), ImageError> where
O: GenericImageView<Pixel = Self::Pixel>,
pub fn copy_within(&mut self, source: Rect, x: u32, y: u32) -> bool
[src]
impl<I> GenericImageView for SubImage<I> where
I: Deref,
<I as Deref>::Target: GenericImageView,
<I as Deref>::Target: Sized,
[src]
I: Deref,
<I as Deref>::Target: GenericImageView,
<I as Deref>::Target: Sized,
type Pixel = <<I as Deref>::Target as GenericImageView>::Pixel
The type of pixel.
type InnerImageView = <I as Deref>::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
pub fn dimensions(&self) -> (u32, u32)
[src]
pub fn bounds(&self) -> (u32, u32, u32, u32)
[src]
pub fn get_pixel(
&self,
x: u32,
y: u32
) -> <SubImage<I> as GenericImageView>::Pixel
[src]
&self,
x: u32,
y: u32
) -> <SubImage<I> as GenericImageView>::Pixel
pub fn view(
&self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&<SubImage<I> as GenericImageView>::InnerImageView>
[src]
&self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&<SubImage<I> as GenericImageView>::InnerImageView>
pub fn inner(&self) -> &<SubImage<I> as GenericImageView>::InnerImageView
[src]
pub fn width(&self) -> u32
[src]
pub fn height(&self) -> u32
[src]
pub fn in_bounds(&self, x: u32, y: u32) -> bool
[src]
pub unsafe fn unsafe_get_pixel(&self, x: u32, y: u32) -> Self::Pixel
[src]
pub fn pixels(&self) -> Pixels<'_, Self>ⓘ
[src]
Auto Trait Implementations
impl<I> RefUnwindSafe for SubImage<I> where
I: RefUnwindSafe,
[src]
I: RefUnwindSafe,
impl<I> Send for SubImage<I> where
I: Send,
[src]
I: Send,
impl<I> Sync for SubImage<I> where
I: Sync,
[src]
I: Sync,
impl<I> Unpin for SubImage<I> where
I: Unpin,
[src]
I: Unpin,
impl<I> UnwindSafe for SubImage<I> where
I: UnwindSafe,
[src]
I: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
[src]
pub fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
[src]
T: Parameter<Self>,
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,