PHP Class Jenssegers\ImageHash\ImageHash

Afficher le fichier Open project: jenssegers/imagehash

Protected Properties

Свойство Type Description
$implementation Jenssegers\ImageHash\Implementation The hashing implementation.

Méthodes publiques

Méthode Description
__construct ( Jenssegers\ImageHash\Implementation $implementation = null, string $mode = self::HEXADECIMAL ) Constructor.
compare ( mixed $resource1, mixed $resource2 ) : integer Compare 2 images and get the hamming distance.
distance ( integer $hash1, integer $hash2 ) : integer Calculate the Hamming Distance.
hash ( mixed $resource ) : integer Calculate a perceptual hash of an image file.
hashFromString ( mixed $data ) : string Calculate a perceptual hash of an image string.

Méthodes protégées

Méthode Description
createResource ( string $data ) : resource Get a GD2 resource from string.
destroyResource ( resource $resource ) Destroy GD2 resource.
formatHash ( integer $hash ) : string | integer Format hash in hex.
loadImageResource ( string $file ) : resource Get a GD2 resource from file.

Method Details

__construct() public méthode

Constructor.
public __construct ( Jenssegers\ImageHash\Implementation $implementation = null, string $mode = self::HEXADECIMAL )
$implementation Jenssegers\ImageHash\Implementation
$mode string

compare() public méthode

Compare 2 images and get the hamming distance.
public compare ( mixed $resource1, mixed $resource2 ) : integer
$resource1 mixed
$resource2 mixed
Résultat integer

createResource() protected méthode

Get a GD2 resource from string.
protected createResource ( string $data ) : resource
$data string
Résultat resource

destroyResource() protected méthode

Destroy GD2 resource.
protected destroyResource ( resource $resource )
$resource resource

distance() public méthode

Calculate the Hamming Distance.
public distance ( integer $hash1, integer $hash2 ) : integer
$hash1 integer
$hash2 integer
Résultat integer

formatHash() protected méthode

Format hash in hex.
protected formatHash ( integer $hash ) : string | integer
$hash integer
Résultat string | integer

hash() public méthode

Calculate a perceptual hash of an image file.
public hash ( mixed $resource ) : integer
$resource mixed GD2 resource or filename
Résultat integer

hashFromString() public méthode

Calculate a perceptual hash of an image string.
public hashFromString ( mixed $data ) : string
$data mixed Image data
Résultat string

loadImageResource() protected méthode

Get a GD2 resource from file.
protected loadImageResource ( string $file ) : resource
$file string
Résultat resource

Property Details

$implementation protected_oe property

The hashing implementation.
protected Implementation,Jenssegers\ImageHash $implementation
Résultat Jenssegers\ImageHash\Implementation