Struct visioncortex::Sampler [−][src]
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]
image: &BinaryImage,
sampler_size: usize,
crop: BoundingRect
) -> Sampler
pub fn resample_square_image(
image: &BinaryImage,
crop: BoundingRect,
new_size: usize
) -> BinaryImage
[src]
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
[src]
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
[src]
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
)
[src]
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
)
[src]
src: &BinaryImage,
src_rect: BoundingRect,
dst: &mut BinaryImage,
dst_rect: BoundingRect,
overlay: bool
)
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]
&self,
left: usize,
top: usize,
right: usize,
bottom: usize
) -> usize
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,