pub struct ImageNormalizer;Expand description
Image normalizer
Implementations§
Source§impl ImageNormalizer
impl ImageNormalizer
Sourcepub fn normalize(
input_path: &Path,
output_path: &Path,
options: &NormalizeOptions,
) -> Result<NormalizeResult>
pub fn normalize( input_path: &Path, output_path: &Path, options: &NormalizeOptions, ) -> Result<NormalizeResult>
Normalize an image to target resolution with paper color padding
Sourcepub fn normalize_with_shift(
input_path: &Path,
output_path: &Path,
options: &NormalizeOptions,
shift_x: i32,
shift_y: i32,
custom_scale: Option<f64>,
) -> Result<NormalizeResult>
pub fn normalize_with_shift( input_path: &Path, output_path: &Path, options: &NormalizeOptions, shift_x: i32, shift_y: i32, custom_scale: Option<f64>, ) -> Result<NormalizeResult>
Normalize with shift (for final output with page offset correction)
Sourcepub fn estimate_paper_color(image: &RgbImage) -> PaperColor
pub fn estimate_paper_color(image: &RgbImage) -> PaperColor
Estimate paper color from entire image
Sourcepub fn sample_corner_colors(
image: &RgbImage,
patch_percent: u32,
) -> CornerColors
pub fn sample_corner_colors( image: &RgbImage, patch_percent: u32, ) -> CornerColors
Sample paper colors from image corners
Auto Trait Implementations§
impl Freeze for ImageNormalizer
impl RefUnwindSafe for ImageNormalizer
impl Send for ImageNormalizer
impl Sync for ImageNormalizer
impl Unpin for ImageNormalizer
impl UnwindSafe for ImageNormalizer
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