Trait ImageHasher

Source
pub trait ImageHasher {
    // Required method
    fn hash_from_img(&self, img: &DynamicImage) -> ImageHash;

    // Provided method
    fn hash_from_path(&self, path: &Path) -> Result<ImageHash, ImageError> { ... }
}
Expand description

Trait for generating image hashes

Required Methods§

Source

fn hash_from_img(&self, img: &DynamicImage) -> ImageHash

Generates a hash for a given image.

§Arguments
  • img - The image to generate the hash for.
§Returns

The generated image hash.

Provided Methods§

Source

fn hash_from_path(&self, path: &Path) -> Result<ImageHash, ImageError>

Generates a hash for an image specified by its file path.

§Arguments
  • path - The path to the image file.
§Returns

The generated image hash.

Implementors§