pub struct BinaryImageSampler {
pub image: BinaryImage,
}Expand description
For sampling and resizing binary images
Fields§
§image: BinaryImageImplementations§
Source§impl BinaryImageSampler
impl BinaryImageSampler
pub fn new(image: &BinaryImage) -> BinaryImageSampler
pub fn new_with_size( image: &BinaryImage, sampler_size: usize, ) -> BinaryImageSampler
pub fn new_with_size_crop( image: &BinaryImage, sampler_size: usize, crop: BoundingRect, ) -> BinaryImageSampler
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, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BinaryImageSampler
impl RefUnwindSafe for BinaryImageSampler
impl Send for BinaryImageSampler
impl Sync for BinaryImageSampler
impl Unpin for BinaryImageSampler
impl UnsafeUnpin for BinaryImageSampler
impl UnwindSafe for BinaryImageSampler
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more