pHash 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/phash/audio.rb +3 -3
- data/lib/phash/image.rb +2 -2
- data/lib/phash/text.rb +2 -2
- data/lib/phash/video.rb +2 -2
- data/pHash.gemspec +1 -1
- metadata +4 -4
data/lib/phash/audio.rb
CHANGED
@@ -14,7 +14,7 @@ module Phash
|
|
14
14
|
#
|
15
15
|
# float* ph_readaudio(const char *filename, int sr, int channels, float *sigbuf, int &buflen, const float nbsecs = 0);
|
16
16
|
#
|
17
|
-
attach_function :ph_readaudio, [:string, :int, :int, :pointer, :pointer, :float], :pointer
|
17
|
+
attach_function :ph_readaudio, [:string, :int, :int, :pointer, :pointer, :float], :pointer, :blocking => true
|
18
18
|
|
19
19
|
# audio hash calculation
|
20
20
|
# purpose: hash calculation for each frame in the buffer.
|
@@ -31,7 +31,7 @@ module Phash
|
|
31
31
|
#
|
32
32
|
# uint32_t* ph_audiohash(float *buf, int nbbuf, const int sr, int &nbframes);
|
33
33
|
#
|
34
|
-
attach_function :ph_audiohash, [:pointer, :int, :int, :pointer], :pointer
|
34
|
+
attach_function :ph_audiohash, [:pointer, :int, :int, :pointer], :pointer, :blocking => true
|
35
35
|
|
36
36
|
# distance function between two hashes
|
37
37
|
#
|
@@ -47,7 +47,7 @@ module Phash
|
|
47
47
|
#
|
48
48
|
# double* ph_audio_distance_ber(uint32_t *hash_a, const int Na, uint32_t *hash_b, const int Nb, const float threshold, const int block_size, int &Nc);
|
49
49
|
#
|
50
|
-
attach_function :ph_audio_distance_ber, [:pointer, :int, :pointer, :int, :float, :int, :pointer], :pointer
|
50
|
+
attach_function :ph_audio_distance_ber, [:pointer, :int, :pointer, :int, :float, :int, :pointer], :pointer, :blocking => true
|
51
51
|
|
52
52
|
class << self
|
53
53
|
class AudioHash < HashData; end
|
data/lib/phash/image.rb
CHANGED
@@ -9,13 +9,13 @@ module Phash
|
|
9
9
|
#
|
10
10
|
# int ph_dct_imagehash(const char* file, ulong64 &hash);
|
11
11
|
#
|
12
|
-
attach_function :ph_dct_imagehash, [:string, :pointer], :int
|
12
|
+
attach_function :ph_dct_imagehash, [:string, :pointer], :int, :blocking => true
|
13
13
|
|
14
14
|
# no info in pHash.h
|
15
15
|
#
|
16
16
|
# int ph_hamming_distance(const ulong64 hash1,const ulong64 hash2);
|
17
17
|
#
|
18
|
-
attach_function :ph_hamming_distance, [:uint64, :uint64], :int
|
18
|
+
attach_function :ph_hamming_distance, [:uint64, :uint64], :int, :blocking => true
|
19
19
|
|
20
20
|
class << self
|
21
21
|
# Get image file hash using <tt>ph_dct_imagehash</tt>
|
data/lib/phash/text.rb
CHANGED
@@ -20,7 +20,7 @@ module Phash
|
|
20
20
|
#
|
21
21
|
# TxtHashPoint* ph_texthash(const char *filename, int *nbpoints);
|
22
22
|
#
|
23
|
-
attach_function :ph_texthash, [:string, :pointer], :pointer
|
23
|
+
attach_function :ph_texthash, [:string, :pointer], :pointer, :blocking => true
|
24
24
|
|
25
25
|
# compare 2 text hashes
|
26
26
|
#
|
@@ -33,7 +33,7 @@ module Phash
|
|
33
33
|
#
|
34
34
|
# TxtMatch* ph_compare_text_hashes(TxtHashPoint *hash1, int N1, TxtHashPoint *hash2, int N2, int *nbmatches);
|
35
35
|
#
|
36
|
-
attach_function :ph_compare_text_hashes, [:pointer, :int, :pointer, :int, :pointer], :pointer
|
36
|
+
attach_function :ph_compare_text_hashes, [:pointer, :int, :pointer, :int, :pointer], :pointer, :blocking => true
|
37
37
|
|
38
38
|
class << self
|
39
39
|
class TextHash < HashData; end
|
data/lib/phash/video.rb
CHANGED
@@ -5,13 +5,13 @@ module Phash
|
|
5
5
|
#
|
6
6
|
# ulong64* ph_dct_videohash(const char *filename, int &Length);
|
7
7
|
#
|
8
|
-
attach_function :ph_dct_videohash, [:string, :pointer], :pointer
|
8
|
+
attach_function :ph_dct_videohash, [:string, :pointer], :pointer, :blocking => true
|
9
9
|
|
10
10
|
# no info in pHash.h
|
11
11
|
#
|
12
12
|
# double ph_dct_videohash_dist(ulong64 *hashA, int N1, ulong64 *hashB, int N2, int threshold=21);
|
13
13
|
#
|
14
|
-
attach_function :ph_dct_videohash_dist, [:pointer, :int, :pointer, :int, :int], :double
|
14
|
+
attach_function :ph_dct_videohash_dist, [:pointer, :int, :pointer, :int, :int], :double, :blocking => true
|
15
15
|
|
16
16
|
class << self
|
17
17
|
class VideoHash < HashData; end
|
data/pHash.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pHash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ivan Kuchin
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-12-
|
18
|
+
date: 2011-12-26 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec
|