pub struct FlipPool { /* private fields */ }Expand description
Histogram-like value pool for determining if error map has significant differences.
This is how you can programmatically determine if images count as different.
Implementations§
Source§impl FlipPool
impl FlipPool
Sourcepub fn with_buckets(bucket_count: usize) -> Self
pub fn with_buckets(bucket_count: usize) -> Self
Creates a new pool with the given amount of buckets.
Sourcepub fn from_image(image: &FlipImageFloat) -> Self
pub fn from_image(image: &FlipImageFloat) -> Self
Creates a new pool and initializes the buckets with the values given image.
Sourcepub fn histogram(&mut self) -> FlipHistogram<'_>
pub fn histogram(&mut self) -> FlipHistogram<'_>
Accesses the internal histogram of the pool.
Sourcepub fn min_value(&self) -> f32
pub fn min_value(&self) -> f32
Gets the minimum value stored in the pool.
Returns 0.0 if no values have been added to the pool.
Sourcepub fn max_value(&self) -> f32
pub fn max_value(&self) -> f32
Gets the maximum value stored in the pool.
Returns 0.0 if no values have been added to the pool.
Sourcepub fn mean(&self) -> f32
pub fn mean(&self) -> f32
Gets the mean value stored in the pool.
Returns 0.0 if no values have been added to the pool.
Sourcepub fn get_weighted_percentile(&self, percentile: f64) -> f64
pub fn get_weighted_percentile(&self, percentile: f64) -> f64
Gets the given weighted percentile [0.0, 1.0] from the pool.
I currently do not understand the difference between this and Self::get_percentile with weighted = true,
except that this function uses doubles and doesn’t require mutation of internal state.
Returns 0.0 if no values have been added to the pool.
Sourcepub fn get_percentile(&mut self, percentile: f32, weighted: bool) -> f32
pub fn get_percentile(&mut self, percentile: f32, weighted: bool) -> f32
Get the value of the given percentile [0.0, 1.0] from the pool.
If weighted is true, is almost equivalent to Self::get_weighted_percentile.
Returns 0.0 if no values have been added to the pool.
Sourcepub fn update_with_image(&mut self, image: &FlipImageFloat)
pub fn update_with_image(&mut self, image: &FlipImageFloat)
Updates the given pool with the contents of the given image.