docstrings
This commit is contained in:
@@ -20,7 +20,8 @@ impl DCT {
|
|||||||
DCT { quantization_matrix }
|
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 {
|
pub fn with_quality(mut self, quality: u8) -> Self {
|
||||||
let mut quantization_matrix: [u8; 64] = [0; 64];
|
let mut quantization_matrix: [u8; 64] = [0; 64];
|
||||||
let scalar: f32 = match quality {
|
let scalar: f32 = match quality {
|
||||||
@@ -38,6 +39,7 @@ impl DCT {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
fn dct(&self, img: &image::DynamicImage) -> [f64; 64] {
|
fn dct(&self, img: &image::DynamicImage) -> [f64; 64] {
|
||||||
let mut dct_values: [f64; 64] = [0.0; 64];
|
let mut dct_values: [f64; 64] = [0.0; 64];
|
||||||
for u in 0..8 {
|
for u in 0..8 {
|
||||||
|
|||||||
@@ -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 {
|
pub trait Descriptor {
|
||||||
fn info(&self) -> String {
|
fn info(&self) -> String {
|
||||||
"Descriptor".to_string()
|
"Descriptor".to_string()
|
||||||
|
|||||||
@@ -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 descriptors;
|
||||||
pub mod store;
|
pub mod store;
|
||||||
@@ -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 std::collections::HashMap;
|
||||||
use crate::descriptors::Descriptor;
|
use crate::descriptors::Descriptor;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|||||||
Reference in New Issue
Block a user