PHP 클래스 Jenssegers\ImageHash\ImageHash

파일 보기 프로젝트 열기: jenssegers/imagehash

보호된 프로퍼티들

프로퍼티 타입 설명
$implementation Jenssegers\ImageHash\Implementation The hashing implementation.

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
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.

메소드 상세

__construct() 공개 메소드

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

compare() 공개 메소드

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

createResource() 보호된 메소드

Get a GD2 resource from string.
protected createResource ( string $data ) : resource
$data string
리턴 resource

destroyResource() 보호된 메소드

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

distance() 공개 메소드

Calculate the Hamming Distance.
public distance ( integer $hash1, integer $hash2 ) : integer
$hash1 integer
$hash2 integer
리턴 integer

formatHash() 보호된 메소드

Format hash in hex.
protected formatHash ( integer $hash ) : string | integer
$hash integer
리턴 string | integer

hash() 공개 메소드

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

hashFromString() 공개 메소드

Calculate a perceptual hash of an image string.
public hashFromString ( mixed $data ) : string
$data mixed Image data
리턴 string

loadImageResource() 보호된 메소드

Get a GD2 resource from file.
protected loadImageResource ( string $file ) : resource
$file string
리턴 resource

프로퍼티 상세

$implementation 보호되어 있는 프로퍼티

The hashing implementation.
protected Implementation,Jenssegers\ImageHash $implementation
리턴 Jenssegers\ImageHash\Implementation