pub struct ColorStats {
pub page_number: usize,
pub paper_r: f64,
pub paper_g: f64,
pub paper_b: f64,
pub ink_r: f64,
pub ink_g: f64,
pub ink_b: f64,
pub mean_r: f64,
pub mean_g: f64,
pub mean_b: f64,
}Expand description
Color statistics for a single page
Fields§
§page_number: usizePage number (1-based)
paper_r: f64Paper (background) color - Red channel average
paper_g: f64Paper (background) color - Green channel average
paper_b: f64Paper (background) color - Blue channel average
ink_r: f64Ink (foreground) color - Red channel average
ink_g: f64Ink (foreground) color - Green channel average
ink_b: f64Ink (foreground) color - Blue channel average
mean_r: f64Mean R (for backward compatibility, same as paper_r)
mean_g: f64Mean G (for backward compatibility, same as paper_g)
mean_b: f64Mean B (for backward compatibility, same as paper_b)
Implementations§
Source§impl ColorStats
impl ColorStats
Sourcepub fn paper_luminance(&self) -> f64
pub fn paper_luminance(&self) -> f64
Calculate paper luminance (ITU-R BT.601)
Sourcepub fn ink_luminance(&self) -> f64
pub fn ink_luminance(&self) -> f64
Calculate ink luminance
Trait Implementations§
Source§impl Clone for ColorStats
impl Clone for ColorStats
Source§fn clone(&self) -> ColorStats
fn clone(&self) -> ColorStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColorStats
impl Debug for ColorStats
Source§impl Default for ColorStats
impl Default for ColorStats
Source§fn default() -> ColorStats
fn default() -> ColorStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ColorStats
impl RefUnwindSafe for ColorStats
impl Send for ColorStats
impl Sync for ColorStats
impl Unpin for ColorStats
impl UnwindSafe for ColorStats
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().