Struct cameraunit::OptimumExposure
source · pub struct OptimumExposure { /* private fields */ }
Expand description
Configuration used to find the optimum exposure.
§Options
percentile_pix
- The percentile of the pixel values to use as the target pixel value, in fraction.pixel_tgt
- The target pixel value, in fraction.pixel_tol
- The uncertainty of the target pixel value, in fraction.pixel_exclusion
- The number of pixels to exclude from the top of the image.min_exposure
- The minimum allowed exposure time.max_exposure
- The maximum allowed exposure time.max_bin
- The maximum allowed binning.
Implementations§
source§impl OptimumExposure
impl OptimumExposure
sourcepub fn calculate(
&self,
img: Vec<u16>,
exposure: Duration,
bin: u8
) -> Result<(Duration, u16), &'static str>
pub fn calculate( &self, img: Vec<u16>, exposure: Duration, bin: u8 ) -> Result<(Duration, u16), &'static str>
Find the optimum exposure time and binning to reach a target pixel value. The algorithm does not use any hysteresis and uses simple scaling.
§Arguments
mut img
- The image luminance data as a vector of u16 that is consumed.exposure
- The exposure duration used to obtain this image luminance data.bin
- The binning used to obtain this image luminance data.
§Returns
Ok((Duration, u16))
- The optimum exposure time and binning.
§Errors
- Errors are returned as static string slices.
sourcepub fn get_builder(&self) -> OptimumExposureBuilder
pub fn get_builder(&self) -> OptimumExposureBuilder
Retrieve the builder for the [serialimage::OptimumExposure
] calculator.
This is useful for changing the configuration of the calculator.
Trait Implementations§
source§impl Clone for OptimumExposure
impl Clone for OptimumExposure
source§fn clone(&self) -> OptimumExposure
fn clone(&self) -> OptimumExposure
Returns a copy 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 OptimumExposure
impl Debug for OptimumExposure
source§impl PartialEq for OptimumExposure
impl PartialEq for OptimumExposure
source§fn eq(&self, other: &OptimumExposure) -> bool
fn eq(&self, other: &OptimumExposure) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for OptimumExposure
impl StructuralPartialEq for OptimumExposure
Auto Trait Implementations§
impl Freeze for OptimumExposure
impl RefUnwindSafe for OptimumExposure
impl Send for OptimumExposure
impl Sync for OptimumExposure
impl Unpin for OptimumExposure
impl UnwindSafe for OptimumExposure
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