Struct visioncortex::Sampler
source · pub struct Sampler {
pub image: BinaryImage,
}
Expand description
For sampling and resizing binary images
Fields§
§image: BinaryImage
Implementations§
source§impl Sampler
impl Sampler
pub fn new(image: &BinaryImage) -> Sampler
pub fn new_with_size(image: &BinaryImage, sampler_size: usize) -> Sampler
pub fn new_with_size_crop( image: &BinaryImage, sampler_size: usize, crop: BoundingRect ) -> Sampler
sourcepub fn resample_square_image(
image: &BinaryImage,
crop: BoundingRect,
new_size: usize
) -> BinaryImage
pub fn resample_square_image( image: &BinaryImage, crop: BoundingRect, new_size: usize ) -> BinaryImage
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
pub fn resample_image_with_crop( image: &BinaryImage, crop: BoundingRect, new_width: usize, new_height: usize ) -> BinaryImage
pub fn resample_image_with_crop_to_image( src: &BinaryImage, src_rect: BoundingRect, dst: &mut BinaryImage, dst_rect: BoundingRect )
pub fn resample_image_with_crop_to_image_overlay( src: &BinaryImage, src_rect: BoundingRect, dst: &mut BinaryImage, dst_rect: BoundingRect, overlay: bool )
Auto Trait Implementations§
impl Freeze for Sampler
impl RefUnwindSafe for Sampler
impl Send for Sampler
impl Sync for Sampler
impl Unpin for Sampler
impl UnwindSafe for Sampler
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