pub struct ImageMarginDetector;Expand description
Default margin detector implementation
Implementations§
Source§impl ImageMarginDetector
impl ImageMarginDetector
Sourcepub fn detect(
image_path: &Path,
options: &MarginOptions,
) -> Result<MarginDetection>
pub fn detect( image_path: &Path, options: &MarginOptions, ) -> Result<MarginDetection>
Detect margins in a single image
Sourcepub fn detect_unified(
images: &[PathBuf],
options: &MarginOptions,
) -> Result<UnifiedMargins>
pub fn detect_unified( images: &[PathBuf], options: &MarginOptions, ) -> Result<UnifiedMargins>
Detect unified margins for multiple images
Sourcepub fn trim(
input_path: &Path,
output_path: &Path,
margins: &Margins,
) -> Result<TrimResult>
pub fn trim( input_path: &Path, output_path: &Path, margins: &Margins, ) -> Result<TrimResult>
Trim image using specified margins
Sourcepub fn pad_to_size(
input_path: &Path,
output_path: &Path,
target_size: (u32, u32),
background: [u8; 3],
) -> Result<TrimResult>
pub fn pad_to_size( input_path: &Path, output_path: &Path, target_size: (u32, u32), background: [u8; 3], ) -> Result<TrimResult>
Pad image to target size
Sourcepub fn process_batch(
images: &[(PathBuf, PathBuf)],
options: &MarginOptions,
) -> Result<Vec<TrimResult>>
pub fn process_batch( images: &[(PathBuf, PathBuf)], options: &MarginOptions, ) -> Result<Vec<TrimResult>>
Process batch with unified margins
Auto Trait Implementations§
impl Freeze for ImageMarginDetector
impl RefUnwindSafe for ImageMarginDetector
impl Send for ImageMarginDetector
impl Sync for ImageMarginDetector
impl Unpin for ImageMarginDetector
impl UnwindSafe for ImageMarginDetector
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