[−][src]Trait rin::graphics::image::GenericImage
A trait for manipulating images.
Associated Types
type InnerImage: GenericImage
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
fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut Self::Pixel
fn put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
fn blend_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
Put a pixel at location (x, y), taking into account alpha channels
DEPRECATED: This method will be removed. Blend the pixel directly instead.
fn inner_mut(&mut self) -> &mut Self::InnerImage
Returns a mutable reference to the underlying image.
Provided Methods
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
Puts a pixel at location (x, y)
This function can be implemented in a way that ignores bounds checking.
fn pixels_mut(&mut self) -> MutPixels<Self>
: This cannot be implemented safely in Rust. Please use the image buffer directly.
Returns an Iterator over mutable pixels of this image. The iterator yields the coordinates of each pixel along with a mutable reference to them.
fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> bool where
O: GenericImageView<Pixel = Self::Pixel>,
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 sub_image
.
Returns
true
if the copy was successful, false
if the image could not
be copied due to size constraints.
fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut Self::InnerImage>
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut Self::InnerImage>
Returns a subimage that is a view into this image.
Implementors
impl GenericImage for DynamicImage
[src]
impl GenericImage for DynamicImage
type InnerImage = DynamicImage
fn put_pixel(&mut self, x: u32, y: u32, pixel: Rgba<u8>)
[src]
fn put_pixel(&mut self, x: u32, y: u32, pixel: Rgba<u8>)
fn blend_pixel(&mut self, x: u32, y: u32, pixel: Rgba<u8>)
[src]
fn blend_pixel(&mut self, x: u32, y: u32, pixel: Rgba<u8>)
DEPRECATED: Use iterator pixels_mut
to blend the pixels directly.
fn get_pixel_mut(&mut self, u32, u32) -> &mut Rgba<u8>
[src]
fn get_pixel_mut(&mut self, u32, u32) -> &mut Rgba<u8>
DEPRECATED: Do not use is function: It is unimplemented!
fn inner_mut(&mut self) -> &mut <DynamicImage as GenericImage>::InnerImage
[src]
fn inner_mut(&mut self) -> &mut <DynamicImage as GenericImage>::InnerImage
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
ⓘImportant traits for MutPixels<'a, I>fn pixels_mut(&mut self) -> MutPixels<Self>
[src]
fn pixels_mut(&mut self) -> MutPixels<Self>
: This cannot be implemented safely in Rust. Please use the image buffer directly.
fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> bool where
O: GenericImageView<Pixel = Self::Pixel>,
[src]
fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> bool where
O: GenericImageView<Pixel = Self::Pixel>,
fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut Self::InnerImage>
[src]
fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut Self::InnerImage>
impl<I> GenericImage for SubImage<I> where
I: DerefMut,
<I as Deref>::Target: GenericImage,
<I as Deref>::Target: Sized,
[src]
impl<I> GenericImage for SubImage<I> where
I: DerefMut,
<I as Deref>::Target: GenericImage,
<I as Deref>::Target: Sized,
type InnerImage = <I as Deref>::Target
fn get_pixel_mut(
&mut self,
x: u32,
y: u32
) -> &mut <SubImage<I> as GenericImageView>::Pixel
[src]
fn get_pixel_mut(
&mut self,
x: u32,
y: u32
) -> &mut <SubImage<I> as GenericImageView>::Pixel
fn put_pixel(
&mut self,
x: u32,
y: u32,
pixel: <SubImage<I> as GenericImageView>::Pixel
)
[src]
fn put_pixel(
&mut self,
x: u32,
y: u32,
pixel: <SubImage<I> as GenericImageView>::Pixel
)
fn blend_pixel(
&mut self,
x: u32,
y: u32,
pixel: <SubImage<I> as GenericImageView>::Pixel
)
[src]
fn blend_pixel(
&mut self,
x: u32,
y: u32,
pixel: <SubImage<I> as GenericImageView>::Pixel
)
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 <SubImage<I> as GenericImage>::InnerImage>
[src]
fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut <SubImage<I> as GenericImage>::InnerImage>
fn inner_mut(&mut self) -> &mut <SubImage<I> as GenericImage>::InnerImage
[src]
fn inner_mut(&mut self) -> &mut <SubImage<I> as GenericImage>::InnerImage
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
[src]
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
ⓘImportant traits for MutPixels<'a, I>fn pixels_mut(&mut self) -> MutPixels<Self>
[src]
fn pixels_mut(&mut self) -> MutPixels<Self>
: This cannot be implemented safely in Rust. Please use the image buffer directly.
fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> bool where
O: GenericImageView<Pixel = Self::Pixel>,
[src]
fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> bool where
O: GenericImageView<Pixel = Self::Pixel>,
impl<P, Container> GenericImage for ImageBuffer<P, Container> where
Container: Deref<Target = [<P as Pixel>::Subpixel]> + DerefMut,
P: Pixel + 'static,
<P as Pixel>::Subpixel: 'static,
[src]
impl<P, Container> GenericImage for ImageBuffer<P, Container> where
Container: Deref<Target = [<P as Pixel>::Subpixel]> + DerefMut,
P: Pixel + 'static,
<P as Pixel>::Subpixel: 'static,
type InnerImage = ImageBuffer<P, Container>
fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut P
[src]
fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut P
fn put_pixel(&mut self, x: u32, y: u32, pixel: P)
[src]
fn put_pixel(&mut self, x: u32, y: u32, pixel: P)
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: P)
[src]
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: P)
Puts a pixel at location (x, y), ignoring bounds checking.
fn blend_pixel(&mut self, x: u32, y: u32, p: P)
[src]
fn blend_pixel(&mut self, x: u32, y: u32, p: P)
Put a pixel at location (x, y), taking into account alpha channels
DEPRECATED: This method will be removed. Blend the pixel directly instead.
fn inner_mut(
&mut self
) -> &mut <ImageBuffer<P, Container> as GenericImage>::InnerImage
[src]
fn inner_mut(
&mut self
) -> &mut <ImageBuffer<P, Container> as GenericImage>::InnerImage
ⓘImportant traits for MutPixels<'a, I>fn pixels_mut(&mut self) -> MutPixels<Self>
[src]
fn pixels_mut(&mut self) -> MutPixels<Self>
: This cannot be implemented safely in Rust. Please use the image buffer directly.
fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> bool where
O: GenericImageView<Pixel = Self::Pixel>,
[src]
fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> bool where
O: GenericImageView<Pixel = Self::Pixel>,
fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut Self::InnerImage>
[src]
fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32
) -> SubImage<&mut Self::InnerImage>