watchdoge 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/watchdoge/image_diff.rb +6 -4
- data/lib/watchdoge/version.rb +1 -1
- data/watchdoge.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 398c14865e7fef97f94eff50002f7de2623878eb022aedb31d16ff5995a2aaa3
|
4
|
+
data.tar.gz: 7e6c5d44a7f720dc2825c7484bd194fc2382816423c0ecf77aa44621d89a3f54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c40e84bba42b2fd4be21b64576bf97d0cff5d9451447a49fe8deadf8c4eeaf21f867d6057cb87842ef8edb4e4fa9783eaed7cf3079d12f2c61c399bf663c953e
|
7
|
+
data.tar.gz: 9779a8aa2a0d0de5e96b7a34c5c3f931be3d13cbff206d52d34802492be28e6e88c76feae7ca635ad5ad062c3358b1d79a67ed829bc2822831835be5e8aefc53
|
data/lib/watchdoge/image_diff.rb
CHANGED
@@ -7,12 +7,14 @@ module WatchDoge
|
|
7
7
|
def diff input_image, reference_image
|
8
8
|
return nil if input_image.pixels.hash == reference_image.pixels.hash
|
9
9
|
|
10
|
+
dup_input_image = input_image.dup
|
11
|
+
|
10
12
|
input_image.height.times do |y|
|
11
13
|
pixels = input_image.row(y)
|
12
14
|
|
13
15
|
if y >= reference_image.height
|
14
16
|
pixels.each_with_index do |pixel, x|
|
15
|
-
|
17
|
+
dup_input_image.compose_pixel(x, y, HIGHLIGHT_COLOR)
|
16
18
|
end
|
17
19
|
else
|
18
20
|
reference_pixels = reference_image.row(y)
|
@@ -21,14 +23,14 @@ module WatchDoge
|
|
21
23
|
|
22
24
|
pixels.each_with_index do |pixel, x|
|
23
25
|
if pixels[x] != reference_pixels[x]
|
24
|
-
|
25
|
-
|
26
|
+
dup_input_image.compose_pixel(x, y, reference_pixels[x])
|
27
|
+
dup_input_image.compose_pixel(x, y, HIGHLIGHT_COLOR)
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
|
-
|
33
|
+
dup_input_image
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
data/lib/watchdoge/version.rb
CHANGED
data/watchdoge.gemspec
CHANGED