Struct visioncortex::Sampler[][src]

pub struct Sampler {
    pub image: BinaryImage,
}

For sampling and resizing binary images

Fields

image: BinaryImage

Implementations

impl Sampler[src]

pub fn new(image: &BinaryImage) -> Sampler[src]

pub fn new_with_size(image: &BinaryImage, sampler_size: usize) -> Sampler[src]

pub fn new_with_size_crop(
    image: &BinaryImage,
    sampler_size: usize,
    crop: BoundingRect
) -> Sampler
[src]

pub fn resample_square_image(
    image: &BinaryImage,
    crop: BoundingRect,
    new_size: usize
) -> BinaryImage
[src]

Resize an image of any size into a square image while keeping the aspect ratio of content. Would empty fill expanded area.

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

pub fn resample_image_with_crop(
    image: &BinaryImage,
    crop: BoundingRect,
    new_width: usize,
    new_height: usize
) -> BinaryImage
[src]

pub fn resample_image_with_crop_to_image(
    src: &BinaryImage,
    src_rect: BoundingRect,
    dst: &mut BinaryImage,
    dst_rect: BoundingRect
)
[src]

pub fn resample_image_with_crop_to_image_overlay(
    src: &BinaryImage,
    src_rect: BoundingRect,
    dst: &mut BinaryImage,
    dst_rect: BoundingRect,
    overlay: bool
)
[src]

impl Sampler[src]

pub fn size(&self) -> usize[src]

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

pub fn sample(
    &self,
    left: usize,
    top: usize,
    right: usize,
    bottom: usize
) -> usize
[src]

Auto Trait Implementations

impl RefUnwindSafe for Sampler

impl Send for Sampler

impl Sync for Sampler

impl Unpin for Sampler

impl UnwindSafe for Sampler

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, 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.