pub fn hash<Img: GenericImage<Rgba<u8>>>(img: &Img, hash_size: u32, fast: bool) -> ImageHash {
        let hash = if fast { 
            fast_hash(img, hash_size)   
        } else { 
            dct_hash(img, hash_size)             
        };

        assert!((hash_size * hash_size) as uint == hash.len());

        ImageHash {
            size: hash_size * hash_size,
            bitv: hash,
        }
    }
/// Create a hash of `img` with a length of `hash_size * hash_size`.
///
/// If `fast == true`, use a simple average of the pixels (faster, but less accurate). 
/// Else, perform a Discrete Cosine Transform & Mean hash (slower, but more accurate).
///
/// Setting `fast = true` produces hashes that are really only useful for
/// comparing *equality* and very *closely* similar images with minor edits or corrections. 
/// Strong color/gamma correction will throw off the hash. 
///
/// In practice, on a fast computer, using `fast = false` won't drastically increase the hash
/// time for a single image. In a program that processes many images at once, the bottleneck
/// will likely be in loading and decoding the images, and not in the hash function.
Create a hash of `img` with a length of `hash_size * hash_size`.
If `fast == true`, use a simple average of the pixels (faster, but less accurate).
Else, perform a Discrete Cosine Transform & Mean hash (slower, but more accurate).

Setting `fast = true` produces hashes that are really only useful for
comparing *equality* and very *closely* similar images with minor edits or corrections.
Strong color/gamma correction will throw off the hash.

In practice, on a fast computer, using `fast = false` won't drastically increase the hash
time for a single image. In a program that processes many images at once, the bottleneck
will likely be in loading and decoding the images, and not in the hash function.
Create a hash of ` img ` with a length of ` hash_size * hash_size ` . If ` fast == true ` use a simple average of the pixels ( faster but less accurate ) . Else perform a Discrete Cosine Transform & Mean hash ( slower but more accurate ) . Setting ` fast = true ` produces hashes that are really only useful for comparing * equality * and very * closely * similar images with minor edits or corrections . Strong color / gamma correction will throw off the hash . In practice on a fast computer using ` fast = false ` won ' t drastically increase the hash time for a single image . In a program that processes many images at once the bottleneck will likely be in loading and decoding the images and not in the hash function .
pub fn hash<Img: GenericImage<Rgba<u8>>>(img: &Img, hash_size: u32, fast: bool) -> ImageHash {
        let hash = if fast { 
            fast_hash(img, hash_size)   
        } else { 
            dct_hash(img, hash_size)             
        };
        assert!((hash_size * hash_size) as uint == hash.len());
        ImageHash {
            size: hash_size * hash_size,
            bitv: hash,
        }
    }
pub fn hash < Img : GenericImage < Rgba < u8 > > > ( img : & Img , hash_size : u32 , fast : bool ) -> ImageHash { let hash = if fast { fast_hash ( img , hash_size ) } else { dct_hash ( img , hash_size ) } ; assert ! ( ( hash_size hash_size ) as uint hash len ( ) ) ; ImageHash { size : hash_size * hash_size , bitv : hash , } }
Create a hash of `img` with a length of `hash_size * hash_size`.
Create a hash of ` img ` with a length of ` hash_size * hash_size ` .
img
&Img
hash_size
u32
fast
bool
img
&Img
hash_size
u32
fast
bool