-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell bindings to pHash, the open source perceptual hash library -- @package phash @version 0.0.3 module Data.PHash.Types newtype PHash PHash :: Word64 -> PHash toCPHash :: PHash -> CULong fromCPHash :: CULong -> PHash instance Show PHash instance Eq PHash instance Num PHash module Data.PHash.Image -- | Obtain the hash of an image. Returns Nothing on failure. pHash's API -- does not provide any error information when this fails, but CImg may -- dump something to stderr. -- -- Examples: -- --
-- >>> import Data.PHash -- -- >>> imageHash imgPath -- Just (PHash 17549625427362946731) --imageHash :: FilePath -> IO (Maybe PHash) module Data.PHash -- | Calculate the distance between two hashes. This can be used to detect -- how similar two images are. -- --
-- >>> import Data.PHash -- -- >>> hammingDistance (PHash 15243782418149777067) (PHash 17549625427362946731) -- 2 ---- --
-- >>> hammingDistance (PHash 15243782418149777067) (PHash 15243782418149777067) -- 0 --hammingDistance :: PHash -> PHash -> Int -- | Determine if two images are similar by a user-defined threshold imagesSimilar :: FilePath -> FilePath -> Int -> IO (Maybe Bool)