pub struct Sampler {
pub image: BinaryImage,
}Expand description
For sampling and resizing binary images
Fields§
§image: BinaryImageImplementations§
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
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