[−][src]Trait purrmitive::GenericImage
A trait for manipulating images.
Associated Types
type InnerImage: GenericImage
[src]
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.
Required methods
pub fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut Self::Pixel
[src]
pub fn put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
pub fn blend_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
Put a pixel at location (x, y), taking into account alpha channels
DEPRECATED: This method will be removed. Blend the pixel directly instead.
pub fn inner_mut(&mut self) -> &mut Self::InnerImage
[src]
Returns a mutable reference to the underlying image.
Provided methods
pub unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
Puts a pixel at location (x, y)
This function can be implemented in a way that ignores bounds checking.
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>,
Copies all of the pixels from another image into this image.
The other image is copied with the top-left corner of the other image placed at (x, y).
In order to copy only a piece of the other image, use GenericImageView::view
.
You can use FlatSamples
to source pixels from an arbitrary regular raster of channel
values, for example from a foreign interface or a fixed image.
Returns
Returns an error if the image is too large to be copied at the given position
pub fn copy_within(&mut self, source: Rect, x: u32, y: u32) -> bool
[src]
Copies all of the pixels from one part of this image to another part of this image.
The destination rectangle of the copy is specified with the top-left corner placed at (x, y).
Returns
true
if the copy was successful, false
if the image could not
be copied due to size constraints.
pub 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>
Returns a mutable subimage that is a view into this image.
If you want an immutable subimage instead, use GenericImageView::view
Implementors
impl GenericImage for DynamicImage
[src]
type InnerImage = DynamicImage
pub fn put_pixel(&mut self, x: u32, y: u32, pixel: Rgba<u8>)
[src]
pub fn blend_pixel(&mut self, x: u32, y: u32, pixel: Rgba<u8>)
[src]
DEPRECATED: Use iterator pixels_mut
to blend the pixels directly.
pub fn get_pixel_mut(&mut self, u32, u32) -> &mut Rgba<u8>
[src]
DEPRECATED: Do not use is function: It is unimplemented!
pub fn inner_mut(&mut self) -> &mut <DynamicImage as GenericImage>::InnerImage
[src]
impl<Buffer, P> GenericImage for ViewMut<Buffer, P> where
P: Pixel,
Buffer: AsMut<[<P as Pixel>::Subpixel]> + AsRef<[<P as Pixel>::Subpixel]>,
[src]
P: Pixel,
Buffer: AsMut<[<P as Pixel>::Subpixel]> + AsRef<[<P as Pixel>::Subpixel]>,
type InnerImage = ViewMut<Buffer, P>
pub fn get_pixel_mut(
&mut self,
x: u32,
y: u32
) -> &mut <ViewMut<Buffer, P> as GenericImageView>::Pixel
[src]
&mut self,
x: u32,
y: u32
) -> &mut <ViewMut<Buffer, P> as GenericImageView>::Pixel
pub fn put_pixel(
&mut self,
x: u32,
y: u32,
pixel: <ViewMut<Buffer, P> as GenericImageView>::Pixel
)
[src]
&mut self,
x: u32,
y: u32,
pixel: <ViewMut<Buffer, P> as GenericImageView>::Pixel
)
pub fn blend_pixel(
&mut self,
x: u32,
y: u32,
pixel: <ViewMut<Buffer, P> as GenericImageView>::Pixel
)
[src]
&mut self,
x: u32,
y: u32,
pixel: <ViewMut<Buffer, P> as GenericImageView>::Pixel
)
pub fn inner_mut(&mut self) -> &mut ViewMut<Buffer, P>
[src]
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
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]
impl<P, Container> GenericImage for ImageBuffer<P, Container> where
P: Pixel + 'static,
Container: Deref<Target = [<P as Pixel>::Subpixel]> + DerefMut,
<P as Pixel>::Subpixel: 'static,
[src]
P: Pixel + 'static,
Container: Deref<Target = [<P as Pixel>::Subpixel]> + DerefMut,
<P as Pixel>::Subpixel: 'static,
type InnerImage = ImageBuffer<P, Container>
pub fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut P
[src]
pub fn put_pixel(&mut self, x: u32, y: u32, pixel: P)
[src]
pub unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: P)
[src]
Puts a pixel at location (x, y), ignoring bounds checking.
pub fn blend_pixel(&mut self, x: u32, y: u32, p: P)
[src]
Put a pixel at location (x, y), taking into account alpha channels
DEPRECATED: This method will be removed. Blend the pixel directly instead.
pub fn copy_within(&mut self, source: Rect, x: u32, y: u32) -> bool
[src]
pub fn inner_mut(
&mut self
) -> &mut <ImageBuffer<P, Container> as GenericImage>::InnerImage
[src]
&mut self
) -> &mut <ImageBuffer<P, Container> as GenericImage>::InnerImage