Struct visioncortex::BinaryImage[][src]

pub struct BinaryImage {
    pub pixels: BitVec,
    pub width: usize,
    pub height: usize,
}

Image with 1 bit per pixel

Fields

pixels: BitVecwidth: usizeheight: usize

Implementations

impl BinaryImage[src]

pub fn operation(
    &self,
    other: &BinaryImage,
    operator: impl FnMut((&mut u8, &u8))
) -> BinaryImage
[src]

pub fn negative(&self) -> BinaryImage[src]

pub fn diff(&self, other: &BinaryImage) -> BinaryImage[src]

pub fn union(&self, other: &BinaryImage) -> BinaryImage[src]

pub fn intersect(&self, other: &BinaryImage) -> BinaryImage[src]

pub fn clustered_diff(&self, other: &BinaryImage) -> u32[src]

pub fn significance(&self, area: u64, threshold: u32) -> u32[src]

early return if diff >= threshold, so maximum return value is equal to threshold

pub fn diff_and_count(&self, other: &BinaryImage) -> usize[src]

pub fn popcount(i: u32) -> u32[src]

pub fn stroke(&self, s: u32) -> BinaryImage[src]

expand a binary image using a circular brush

impl BinaryImage[src]

pub fn to_skeleton(&self) -> Skeleton[src]

An extremely fast implementation of skeletonization

impl BinaryImage[src]

pub fn to_clusters(&self, diagonal: bool) -> Clusters[src]

impl BinaryImage[src]

pub fn new_w_h(width: usize, height: usize) -> BinaryImage[src]

pub fn get_pixel_at(&self, p: PointI32) -> bool[src]

pub fn get_pixel(&self, x: usize, y: usize) -> bool[src]

pub fn get_pixel_at_safe(&self, p: PointI32) -> bool[src]

pub fn get_pixel_safe(&self, x: i32, y: i32) -> bool[src]

pub fn set_pixel(&mut self, x: usize, y: usize, v: bool)[src]

pub fn set_pixel_at(&mut self, p: PointI32, v: bool)[src]

pub fn set_pixel_index(&mut self, i: usize, v: bool)[src]

pub fn set_pixel_safe(&mut self, x: i32, y: i32, v: bool) -> bool[src]

pub fn set_pixel_at_safe(&mut self, p: PointI32, v: bool)[src]

pub fn bounding_rect(&self) -> BoundingRect[src]

pub fn area(&self) -> u64[src]

pub fn crop(&self) -> BinaryImage[src]

crop image to fit content

pub fn crop_with_rect(&self, rect: BoundingRect) -> BinaryImage[src]

crop a specific area from image

pub fn uncrop(&self, new_width: usize, new_height: usize) -> BinaryImage[src]

expand the image while center original image so that there will be more space surrounding

pub fn from_string(string: &str) -> Self[src]

pub fn rotate(&self, angle: f64) -> BinaryImage[src]

pub fn paste_from(&mut self, src: &BinaryImage, offset: PointI32)[src]

Paste the content of src into self, with offset with respective to the upper-left corner.

pub fn to_color_image(&self) -> ColorImage[src]

Trait Implementations

impl Clone for BinaryImage[src]

impl Debug for BinaryImage[src]

impl Default for BinaryImage[src]

impl Display for BinaryImage[src]

impl From<BinaryImage> for Shape[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.