#[non_exhaustive]pub enum Contrast {
Auto,
MinMax,
Percentile(f64, f64),
Raw,
Window(f64, f64),
StoredWindow(usize),
Log(f64, f64),
}Expand description
How sample values map to display brightness.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Auto
percentile:0.1,99.9 for most images; raw for 8-bit RGB (already display-ready).
MinMax
Darkest sample → black, brightest → full colour.
Percentile(f64, f64)
The given percentiles of the (downsampled) samples → black and full colour.
Raw
The pixel type’s full range (0–255 for uint8, 0–65535 for uint16, 0–1 for floats).
Window(f64, f64)
A display window: values from center - width / 2 (black) to center + width / 2
(white), in the image’s values (Hounsfield units for CT).
StoredWindow(usize)
The n-th display window the file stores (images[].extra.windows).
Log(f64, f64)
Logarithmic: the given percentiles → black and full colour, brightness by the logarithm of the value above the low one (diffraction images: faint spots and strong ones both show).
Trait Implementations§
impl Copy for Contrast
impl StructuralPartialEq for Contrast
Auto Trait Implementations§
impl Freeze for Contrast
impl RefUnwindSafe for Contrast
impl Send for Contrast
impl Sync for Contrast
impl Unpin for Contrast
impl UnsafeUnpin for Contrast
impl UnwindSafe for Contrast
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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