diff --git a/src/descriptors/dct.rs b/src/descriptors/dct.rs index d6835fa..15cb98a 100644 --- a/src/descriptors/dct.rs +++ b/src/descriptors/dct.rs @@ -20,7 +20,8 @@ impl DCT { DCT { quantization_matrix } } - // Builds DCT with given quality value + /// Builds DCT with given quality value + /// quality pub fn with_quality(mut self, quality: u8) -> Self { let mut quantization_matrix: [u8; 64] = [0; 64]; let scalar: f32 = match quality { @@ -38,6 +39,7 @@ impl DCT { self } + /// fn dct(&self, img: &image::DynamicImage) -> [f64; 64] { let mut dct_values: [f64; 64] = [0.0; 64]; for u in 0..8 { diff --git a/src/descriptors/mod.rs b/src/descriptors/mod.rs index fe0690f..88ccf30 100644 --- a/src/descriptors/mod.rs +++ b/src/descriptors/mod.rs @@ -1,3 +1,6 @@ +//! Descriptors that can be used to describe an image. +//! If two images are (almost) the same, their descriptions will be the same. + pub trait Descriptor { fn info(&self) -> String { "Descriptor".to_string() diff --git a/src/lib.rs b/src/lib.rs index c807575..ea0f982 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,2 +1,6 @@ +//! Near-copy image similarity detection. + +//! Descriptors that can be used to describe an image. +//! If two images are (almost) the same, their descriptions will be the same. pub mod descriptors; pub mod store; \ No newline at end of file diff --git a/src/store.rs b/src/store.rs index 04a6029..99f9940 100644 --- a/src/store.rs +++ b/src/store.rs @@ -1,3 +1,6 @@ +//! Persistent store of all calculated image descriptions. +//! Can be queried to find identical or similar images. + use std::collections::HashMap; use crate::descriptors::Descriptor; use std::fs;