FlipPool

Struct FlipPool 

Source
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

Source

pub fn new() -> Self

Creates a new pool with 100 buckets.

Source

pub fn with_buckets(bucket_count: usize) -> Self

Creates a new pool with the given amount of buckets.

Source

pub fn from_image(image: &FlipImageFloat) -> Self

Creates a new pool and initializes the buckets with the values given image.

Source

pub fn histogram(&mut self) -> FlipHistogram<'_>

Accesses the internal histogram of the pool.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn update_with_image(&mut self, image: &FlipImageFloat)

Updates the given pool with the contents of the given image.

Source

pub fn clear(&mut self)

Clears the pool.

Trait Implementations§

Source§

impl Default for FlipPool

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for FlipPool

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for FlipPool

Source§

impl Sync for FlipPool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.