Struct cameraunit::OptimumExposureBuilder
source · pub struct OptimumExposureBuilder { /* private fields */ }
Expand description
Builder for the [serialimage::OptimumExposure
] calculator.
The default values are:
percentile_pix
- 0.995pixel_tgt
- 40000. / 65536.pixel_uncertainty
- 5000. / 65536.pixel_exclusion
- 100min_allowed_exp
- 1 msmax_allowed_exp
- 10 smax_allowed_bin
- 1
Implementations§
source§impl OptimumExposureBuilder
impl OptimumExposureBuilder
sourcepub fn percentile_pix(self, percentile_pix: f32) -> OptimumExposureBuilder
pub fn percentile_pix(self, percentile_pix: f32) -> OptimumExposureBuilder
Set the percentile of the pixel values to use as the target pixel value.
The pixels are sorted in ascending order and the pixel at the percentile is targeted for optimization.
sourcepub fn pixel_tgt(self, pixel_tgt: f32) -> OptimumExposureBuilder
pub fn pixel_tgt(self, pixel_tgt: f32) -> OptimumExposureBuilder
Set the target pixel value.
The target pixel value is the value that the algorithm will try to reach.
sourcepub fn pixel_uncertainty(self, pixel_uncertainty: f32) -> OptimumExposureBuilder
pub fn pixel_uncertainty(self, pixel_uncertainty: f32) -> OptimumExposureBuilder
Set the uncertainty of the target pixel value.
The pixel value is considered to be within the target if it is within the target value plus or minus the uncertainty.
sourcepub fn pixel_exclusion(self, pixel_exclusion: u32) -> OptimumExposureBuilder
pub fn pixel_exclusion(self, pixel_exclusion: u32) -> OptimumExposureBuilder
Set the number of pixels to exclude from the top of the image.
The pixels are sorted in ascending order and the top pixel_exclusion
pixels
are excluded from the optimization.
sourcepub fn min_allowed_exp(
self,
min_allowed_exp: Duration
) -> OptimumExposureBuilder
pub fn min_allowed_exp( self, min_allowed_exp: Duration ) -> OptimumExposureBuilder
Set the minimum allowed exposure time.
The minimum allowed exposure time is the shortest exposure time that the algorithm will consider.
sourcepub fn max_allowed_exp(
self,
max_allowed_exp: Duration
) -> OptimumExposureBuilder
pub fn max_allowed_exp( self, max_allowed_exp: Duration ) -> OptimumExposureBuilder
Set the maximum allowed exposure time.
The maximum allowed exposure time is the longest exposure time that the algorithm will consider.
sourcepub fn max_allowed_bin(self, max_allowed_bin: u16) -> OptimumExposureBuilder
pub fn max_allowed_bin(self, max_allowed_bin: u16) -> OptimumExposureBuilder
Set the maximum allowed binning.
The maximum allowed binning is the largest binning factor that the algorithm will consider to minimize the exposure time.
sourcepub fn build(self) -> Result<OptimumExposure, &'static str>
pub fn build(self) -> Result<OptimumExposure, &'static str>
Build the [serialimage::OptimumExposure
].
Trait Implementations§
source§impl Clone for OptimumExposureBuilder
impl Clone for OptimumExposureBuilder
source§fn clone(&self) -> OptimumExposureBuilder
fn clone(&self) -> OptimumExposureBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OptimumExposureBuilder
impl Debug for OptimumExposureBuilder
source§impl Default for OptimumExposureBuilder
impl Default for OptimumExposureBuilder
source§fn default() -> OptimumExposureBuilder
fn default() -> OptimumExposureBuilder
source§impl PartialEq for OptimumExposureBuilder
impl PartialEq for OptimumExposureBuilder
source§fn eq(&self, other: &OptimumExposureBuilder) -> bool
fn eq(&self, other: &OptimumExposureBuilder) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for OptimumExposureBuilder
Auto Trait Implementations§
impl Freeze for OptimumExposureBuilder
impl RefUnwindSafe for OptimumExposureBuilder
impl Send for OptimumExposureBuilder
impl Sync for OptimumExposureBuilder
impl Unpin for OptimumExposureBuilder
impl UnwindSafe for OptimumExposureBuilder
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
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>
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>
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>
ReadEndian::read_from_little_endian()
.