pub struct BinaryImage { /* private fields */ }Implementations§
Source§impl BinaryImage
impl BinaryImage
pub fn new(width: u32, height: u32) -> Self
pub fn resize(&self, width: u32, height: u32) -> BinaryImage
pub fn from_raw<T>(width: u32, height: u32, buffer: &[T]) -> Selfwhere
T: Zero,
pub fn from_bitvec(width: u32, height: u32, buffer: BitVec) -> Self
Sourcepub fn flip_horizontal(&self) -> Self
pub fn flip_horizontal(&self) -> Self
Flip an image horizontally
Sourcepub fn flip_vertical(&self) -> Self
pub fn flip_vertical(&self) -> Self
Flip an image vertically
pub fn get_pixel(&self, x: u32, y: u32) -> Bit
pub fn height(&self) -> u32
pub fn width(&self) -> u32
Trait Implementations§
Source§impl Clone for BinaryImage
impl Clone for BinaryImage
Source§fn clone(&self) -> BinaryImage
fn clone(&self) -> BinaryImage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinaryImage
impl Debug for BinaryImage
Source§impl Default for BinaryImage
impl Default for BinaryImage
Source§fn default() -> BinaryImage
fn default() -> BinaryImage
Returns the “default value” for a type. Read more
Source§impl<'a, I, P> From<BinaryView<'a, I>> for BinaryImage
impl<'a, I, P> From<BinaryView<'a, I>> for BinaryImage
Source§fn from(view: BinaryView<'a, I>) -> BinaryImage
fn from(view: BinaryView<'a, I>) -> BinaryImage
Converts to this type from the input type.
Source§impl From<DynamicImage> for BinaryImage
impl From<DynamicImage> for BinaryImage
Source§fn from(image: DynamicImage) -> Self
fn from(image: DynamicImage) -> Self
Converts to this type from the input type.
Source§impl<Container, P> From<ImageBuffer<P, Container>> for BinaryImage
impl<Container, P> From<ImageBuffer<P, Container>> for BinaryImage
Source§fn from(image: ImageBuffer<P, Container>) -> Self
fn from(image: ImageBuffer<P, Container>) -> Self
Converts to this type from the input type.
Source§impl GenericImage for BinaryImage
impl GenericImage for BinaryImage
Source§unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
unsafe fn unsafe_put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
Puts a pixel at location (x, y). Indexed from top left. Read more
Source§fn put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
fn put_pixel(&mut self, x: u32, y: u32, pixel: Self::Pixel)
Put a pixel at location (x, y). Indexed from top left. Read more
Source§fn blend_pixel(&mut self, x: u32, y: u32, other: Self::Pixel)
fn blend_pixel(&mut self, x: u32, y: u32, other: Self::Pixel)
👎Deprecated since 0.24.0: Use iterator
pixels_mut to blend the pixels directlyPut a pixel at location (x, y), taking into account alpha channels
Source§fn get_pixel_mut(&mut self, _: u32, _: u32) -> &mut Self::Pixel
fn get_pixel_mut(&mut self, _: u32, _: u32) -> &mut Self::Pixel
👎Deprecated since 0.24.0: Use
get_pixel and put_pixel instead.Gets a reference to the mutable pixel at location
(x, y). Indexed from top left. Read moreSource§fn copy_from<O>(&mut self, other: &O, x: u32, y: u32) -> Result<(), ImageError>where
O: GenericImageView<Pixel = Self::Pixel>,
fn copy_from<O>(&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. Read more
Source§fn copy_within(&mut self, source: Rect, x: u32, y: u32) -> bool
fn copy_within(&mut self, source: Rect, x: u32, y: u32) -> bool
Copies all of the pixels from one part of this image to another part of this image. Read more
Source§fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32,
) -> SubImage<&mut Self>where
Self: Sized,
fn sub_image(
&mut self,
x: u32,
y: u32,
width: u32,
height: u32,
) -> SubImage<&mut Self>where
Self: Sized,
Returns a mutable subimage that is a view into this image.
If you want an immutable subimage instead, use
GenericImageView::view
The coordinates set the position of the top left corner of the SubImage.Source§impl GenericImageView for BinaryImage
impl GenericImageView for BinaryImage
Source§unsafe fn unsafe_get_pixel(&self, x: u32, y: u32) -> Self::Pixel
unsafe fn unsafe_get_pixel(&self, x: u32, y: u32) -> Self::Pixel
Returns the pixel located at (x, y). Indexed from top left. Read more
Source§fn get_pixel(&self, x: u32, y: u32) -> Self::Pixel
fn get_pixel(&self, x: u32, y: u32) -> Self::Pixel
Returns the pixel located at (x, y). Indexed from top left. Read more
Source§fn dimensions(&self) -> (u32, u32)
fn dimensions(&self) -> (u32, u32)
The width and height of this image.
Source§fn in_bounds(&self, x: u32, y: u32) -> bool
fn in_bounds(&self, x: u32, y: u32) -> bool
Returns true if this x, y coordinate is contained inside the image.
Source§fn pixels(&self) -> Pixels<'_, Self>where
Self: Sized,
fn pixels(&self) -> Pixels<'_, Self>where
Self: Sized,
Returns an Iterator over the pixels of this image.
The iterator yields the coordinates of each pixel
along with their value
Source§fn view(&self, x: u32, y: u32, width: u32, height: u32) -> SubImage<&Self>where
Self: Sized,
fn view(&self, x: u32, y: u32, width: u32, height: u32) -> SubImage<&Self>where
Self: Sized,
Returns a subimage that is an immutable view into this image.
You can use
GenericImage::sub_image if you need a mutable view instead.
The coordinates set the position of the top left corner of the view.Auto Trait Implementations§
impl Freeze for BinaryImage
impl RefUnwindSafe for BinaryImage
impl Send for BinaryImage
impl Sync for BinaryImage
impl Unpin for BinaryImage
impl UnwindSafe for BinaryImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more