pub struct ColorAnalyzer;Expand description
Color statistics analyzer
Implementations§
Source§impl ColorAnalyzer
impl ColorAnalyzer
Sourcepub fn calculate_stats(image_path: &Path) -> Result<ColorStats>
pub fn calculate_stats(image_path: &Path) -> Result<ColorStats>
Calculate color statistics from an image file
Sourcepub fn calculate_stats_from_image(
image: &RgbImage,
page_number: usize,
) -> ColorStats
pub fn calculate_stats_from_image( image: &RgbImage, page_number: usize, ) -> ColorStats
Calculate color statistics from an RGB image
Sourcepub fn exclude_outliers(stats_list: &[ColorStats]) -> Vec<ColorStats>
pub fn exclude_outliers(stats_list: &[ColorStats]) -> Vec<ColorStats>
Exclude outlier pages using MAD (Median Absolute Deviation)
Sourcepub fn decide_global_adjustment(stats_list: &[ColorStats]) -> GlobalColorParam
pub fn decide_global_adjustment(stats_list: &[ColorStats]) -> GlobalColorParam
Decide global color adjustment parameters from filtered stats
Sourcepub fn apply_adjustment(image: &mut RgbImage, params: &GlobalColorParam)
pub fn apply_adjustment(image: &mut RgbImage, params: &GlobalColorParam)
Apply global color adjustment to an image
Sourcepub fn apply_bleed_suppression(
image: &mut RgbImage,
bleed_config: &BleedSuppression,
)
pub fn apply_bleed_suppression( image: &mut RgbImage, bleed_config: &BleedSuppression, )
Apply bleed-through suppression only (without other adjustments)
Phase 1.3: Dedicated function for bleed-through removal
Sourcepub fn detect_bleed_percentage(
image: &RgbImage,
bleed_config: &BleedSuppression,
) -> f64
pub fn detect_bleed_percentage( image: &RgbImage, bleed_config: &BleedSuppression, ) -> f64
Detect bleed-through percentage in an image
Returns the percentage of pixels that match bleed-through characteristics.
Sourcepub fn analyze_book_pages(
image_paths: &[PathBuf],
) -> Result<(Vec<ColorStats>, Vec<ColorStats>)>
pub fn analyze_book_pages( image_paths: &[PathBuf], ) -> Result<(Vec<ColorStats>, Vec<ColorStats>)>
Analyze multiple pages and return statistics with outliers filtered per group
Auto Trait Implementations§
impl Freeze for ColorAnalyzer
impl RefUnwindSafe for ColorAnalyzer
impl Send for ColorAnalyzer
impl Sync for ColorAnalyzer
impl Unpin for ColorAnalyzer
impl UnwindSafe for ColorAnalyzer
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