Enum img_hash::HashType [−][src]
pub enum HashType { Mean, Block, Gradient, DoubleGradient, DCT, UserDCT(DCT2DFunc), // some variants omitted }
An enum describing the hash algorithms that img_hash
offers.
Variants
Mean
This algorithm first averages the pixels of the reduced-size and color image, and then compares each pixel to the average.
Fast, but inaccurate. Really only useful for finding duplicates.
Block
The Blockhash.io algorithm.
Faster than Mean
but also prone to more collisions and suitable only for finding
duplicates.
Gradient
This algorithm compares each pixel in a row to its neighbor and registers changes in gradients (e.g. edges and color boundaries).
More accurate than Mean
but much faster than DCT
.
DoubleGradient
A version of Gradient
that adds an extra hash pass orthogonal to the first
(i.e. on columns in addition to rows).
Slower than Gradient
and produces a double-sized hash, but much more accurate.
DCT
This algorithm runs a Discrete Cosine Transform on the reduced-color and size image, then compares each datapoint in the transform to the average.
Slowest by far, but can detect changes in color gamut and sometimes relatively significant edits.
Call precompute_dct_matrix()
with your chosen hash size to memoize the DCT matrix for the
given size, which can produce significant speedups in repeated hash runs.
UserDCT(DCT2DFunc)
Equivalent to DCT
, but allows the user to provide their own 2-dimensional DCT function.
See the DCT2DFunc
docs for more info.
Use this variant if you want a specialized or optimized 2D DCT implementation, such as from FFTW. (This cannot be the default implementation because of licensing conflicts.)
Trait Implementations
impl Clone for HashType
[src]
impl Clone for HashType
fn clone(&self) -> HashType
[src]
fn clone(&self) -> HashType
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for HashType
[src]
impl Copy for HashType
impl Debug for HashType
[src]
impl Debug for HashType
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Hash for HashType
[src]
impl Hash for HashType
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for HashType
[src]
impl PartialEq for HashType
fn eq(&self, other: &HashType) -> bool
[src]
fn eq(&self, other: &HashType) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &HashType) -> bool
[src]
fn ne(&self, other: &HashType) -> bool
This method tests for !=
.
impl Eq for HashType
[src]
impl Eq for HashType