image_comparator 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/README.md +32 -0
- data/Rakefile +9 -0
- data/doc/ImageComparator.html +802 -0
- data/doc/_index.html +110 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +75 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +75 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +87 -0
- data/doc/top-level-namespace.html +112 -0
- data/image_comparator.gemspec +19 -0
- data/images/almost-the-same-1.png +0 -0
- data/images/almost-the-same-2.png +0 -0
- data/images/base-nok-areas.png +0 -0
- data/images/base-nok.png +0 -0
- data/images/base-ok.png +0 -0
- data/images/base.png +0 -0
- data/lib/image_comparator.rb +316 -0
- data/test/image_comparator_test.rb +267 -0
- metadata +143 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 03b711e4ffa78e8918e5f17275f02b437cfb6eda
|
4
|
+
data.tar.gz: 9f108a034b40f53ea91cad71f9c24d8bc6098433
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fdc1f9157e00563110542a1cb140ddffe1dc6791fb0493ecadd091f15dd046bab0ae303388e450cec94a6a265a019853e2d7dcfd94cd0837e691a8628720e86f
|
7
|
+
data.tar.gz: 56f5167dd68479cbdeb22d69af135284b68303e5c7d05f38bde6945d1c6bf9005fd712e14682ef51176188ef516d8f93ea8c30472981996ec2f3b4ada6f06365
|
data/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Image Comparator
|
2
|
+
|
3
|
+
The objective of this small project is to provide a simple api to compare 2 png images.
|
4
|
+
|
5
|
+
It provide the following features:
|
6
|
+
|
7
|
+
* Image comparison pixel to pixel.
|
8
|
+
* Possibility to focus comparison to specific areas or remove areas from the comparison.
|
9
|
+
* Possibility to obtain an image with the differences found.
|
10
|
+
|
11
|
+
## How to install
|
12
|
+
|
13
|
+
```
|
14
|
+
gem install image_comparator
|
15
|
+
```
|
16
|
+
|
17
|
+
## Examples
|
18
|
+
|
19
|
+
```
|
20
|
+
require 'image_comparator'
|
21
|
+
|
22
|
+
image_comparator = ImageComparator.new
|
23
|
+
image_comparator.define_images_to_compare('./images/almost-the-same-1.png', './images/almost-the-same-2.png')
|
24
|
+
image_comparator.compare
|
25
|
+
```
|
26
|
+
|
27
|
+
See unit tests to see more examples and documentation
|
28
|
+
|
29
|
+
## How to generate the documentation
|
30
|
+
|
31
|
+
1. Clone the project
|
32
|
+
2.
|
data/Rakefile
ADDED
@@ -0,0 +1,802 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: ImageComparator
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '';
|
20
|
+
framesUrl = "frames.html#!ImageComparator.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="_index.html">Index (I)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">ImageComparator</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: ImageComparator
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">ImageComparator</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<dt class="r2">Includes:</dt>
|
94
|
+
<dd class="r2">ChunkyPNG::Color</dd>
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<dt class="r1 last">Defined in:</dt>
|
101
|
+
<dd class="r1 last">image_comparator.rb</dd>
|
102
|
+
|
103
|
+
</dl>
|
104
|
+
<div class="clear"></div>
|
105
|
+
|
106
|
+
|
107
|
+
<h2>Constant Summary</h2>
|
108
|
+
|
109
|
+
<dl class="constants">
|
110
|
+
|
111
|
+
<dt id="LOG_FILE-constant" class="">LOG_FILE =
|
112
|
+
|
113
|
+
</dt>
|
114
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>./tmp/log_file.log</span><span class='tstring_end'>'</span></span></pre></dd>
|
115
|
+
|
116
|
+
<dt id="LOG_ROTATE_PERIOCITY-constant" class="">LOG_ROTATE_PERIOCITY =
|
117
|
+
|
118
|
+
</dt>
|
119
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>monthly</span><span class='tstring_end'>'</span></span></pre></dd>
|
120
|
+
|
121
|
+
<dt id="DEFAULT_TEMP_FOLDER-constant" class="">DEFAULT_TEMP_FOLDER =
|
122
|
+
|
123
|
+
</dt>
|
124
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>./tmp</span><span class='tstring_end'>'</span></span></pre></dd>
|
125
|
+
|
126
|
+
<dt id="DEFAULT_FILE1_NAME-constant" class="">DEFAULT_FILE1_NAME =
|
127
|
+
|
128
|
+
</dt>
|
129
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>file1.png</span><span class='tstring_end'>'</span></span></pre></dd>
|
130
|
+
|
131
|
+
<dt id="DEFAULT_FILE2_NAME-constant" class="">DEFAULT_FILE2_NAME =
|
132
|
+
|
133
|
+
</dt>
|
134
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>file2.png</span><span class='tstring_end'>'</span></span></pre></dd>
|
135
|
+
|
136
|
+
</dl>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<h2>
|
147
|
+
Instance Method Summary
|
148
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
149
|
+
</h2>
|
150
|
+
|
151
|
+
<ul class="summary">
|
152
|
+
|
153
|
+
<li class="public ">
|
154
|
+
<span class="summary_signature">
|
155
|
+
|
156
|
+
<a href="#calculate_diff_image-instance_method" title="#calculate_diff_image (instance method)">- (String) <strong>calculate_diff_image</strong>(path_res = './diff.png') </a>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
</span>
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
<span class="summary_desc"><div class='inline'>
|
171
|
+
<p>This method generates a png with the image differences and returns a
|
172
|
+
fingerprint of the returned image.</p>
|
173
|
+
</div></span>
|
174
|
+
|
175
|
+
</li>
|
176
|
+
|
177
|
+
|
178
|
+
<li class="public ">
|
179
|
+
<span class="summary_signature">
|
180
|
+
|
181
|
+
<a href="#equal-instance_method" title="#equal (instance method)">- (Boolean) <strong>equal</strong> </a>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
</span>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<span class="summary_desc"><div class='inline'>
|
196
|
+
<p>This method return a boolean to indicate if 2 png images are equal from a
|
197
|
+
pixel point of view.</p>
|
198
|
+
</div></span>
|
199
|
+
|
200
|
+
</li>
|
201
|
+
|
202
|
+
|
203
|
+
<li class="public ">
|
204
|
+
<span class="summary_signature">
|
205
|
+
|
206
|
+
<a href="#equal_and_generate_diff-instance_method" title="#equal_and_generate_diff (instance method)">- (Boolean) <strong>equal_and_generate_diff</strong>(path_res = './diff.png') </a>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</span>
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
<span class="summary_desc"><div class='inline'>
|
221
|
+
<p>This method returns a boolean to indicate if the 2 images are equal, based
|
222
|
+
on the threshold, and in case they are not, a png with the differences is
|
223
|
+
generated.</p>
|
224
|
+
</div></span>
|
225
|
+
|
226
|
+
</li>
|
227
|
+
|
228
|
+
|
229
|
+
<li class="public ">
|
230
|
+
<span class="summary_signature">
|
231
|
+
|
232
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (ImageComparator) <strong>initialize</strong>(path_image1, path_image2) </a>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
</span>
|
237
|
+
|
238
|
+
|
239
|
+
<span class="note title constructor">constructor</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
<span class="summary_desc"><div class='inline'>
|
249
|
+
<p>Class constructor.</p>
|
250
|
+
</div></span>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
<li class="public ">
|
256
|
+
<span class="summary_signature">
|
257
|
+
|
258
|
+
<a href="#set_areas-instance_method" title="#set_areas (instance method)">- (Object) <strong>set_areas</strong>(areas) </a>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</span>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
<span class="summary_desc"><div class='inline'>
|
273
|
+
<p>This method defines the areas that will be used on the comparison methods,
|
274
|
+
ie: equal, calculate_diff_image and equal_and_generate_diff methods.</p>
|
275
|
+
</div></span>
|
276
|
+
|
277
|
+
</li>
|
278
|
+
|
279
|
+
|
280
|
+
</ul>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
<div id="constructor_details" class="method_details_list">
|
285
|
+
<h2>Constructor Details</h2>
|
286
|
+
|
287
|
+
<div class="method_details first">
|
288
|
+
<h3 class="signature first" id="initialize-instance_method">
|
289
|
+
|
290
|
+
- (<tt><span class='object_link'><a href="" title="ImageComparator (class)">ImageComparator</a></span></tt>) <strong>initialize</strong>(path_image1, path_image2)
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
</h3><div class="docstring">
|
297
|
+
<div class="discussion">
|
298
|
+
|
299
|
+
<p>Class constructor</p>
|
300
|
+
|
301
|
+
|
302
|
+
</div>
|
303
|
+
</div>
|
304
|
+
<div class="tags">
|
305
|
+
<p class="tag_title">Parameters:</p>
|
306
|
+
<ul class="param">
|
307
|
+
|
308
|
+
<li>
|
309
|
+
|
310
|
+
<span class='name'>path_image1</span>
|
311
|
+
|
312
|
+
|
313
|
+
<span class='type'>(<tt>String</tt>)</span>
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
—
|
318
|
+
<div class='inline'>
|
319
|
+
<p>The path to the first image to compare.</p>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
</li>
|
323
|
+
|
324
|
+
<li>
|
325
|
+
|
326
|
+
<span class='name'>path_image2</span>
|
327
|
+
|
328
|
+
|
329
|
+
<span class='type'>(<tt>String</tt>)</span>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
—
|
334
|
+
<div class='inline'>
|
335
|
+
<p>The path to the second image to compare.</p>
|
336
|
+
</div>
|
337
|
+
|
338
|
+
</li>
|
339
|
+
|
340
|
+
</ul>
|
341
|
+
|
342
|
+
|
343
|
+
</div><table class="source_code">
|
344
|
+
<tr>
|
345
|
+
<td>
|
346
|
+
<pre class="lines">
|
347
|
+
|
348
|
+
|
349
|
+
23
|
350
|
+
24
|
351
|
+
25
|
352
|
+
26
|
353
|
+
27
|
354
|
+
28
|
355
|
+
29</pre>
|
356
|
+
</td>
|
357
|
+
<td>
|
358
|
+
<pre class="code"><span class="info file"># File 'image_comparator.rb', line 23</span>
|
359
|
+
|
360
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_path_image1'>path_image1</span><span class='comma'>,</span> <span class='id identifier rubyid_path_image2'>path_image2</span><span class='rparen'>)</span>
|
361
|
+
<span class='ivar'>@logger</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>LOG_FILE</span><span class='comma'>,</span> <span class='const'>LOG_ROTATE_PERIOCITY</span><span class='rparen'>)</span>
|
362
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>in: initialize(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path_image1'>path_image1</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path_image2'>path_image2</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
363
|
+
<span class='ivar'>@areas</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
364
|
+
<span class='ivar'>@path_image1</span> <span class='op'>=</span> <span class='id identifier rubyid_path_image1'>path_image1</span>
|
365
|
+
<span class='ivar'>@path_image2</span> <span class='op'>=</span> <span class='id identifier rubyid_path_image2'>path_image2</span>
|
366
|
+
<span class='kw'>end</span></pre>
|
367
|
+
</td>
|
368
|
+
</tr>
|
369
|
+
</table>
|
370
|
+
</div>
|
371
|
+
|
372
|
+
</div>
|
373
|
+
|
374
|
+
|
375
|
+
<div id="instance_method_details" class="method_details_list">
|
376
|
+
<h2>Instance Method Details</h2>
|
377
|
+
|
378
|
+
|
379
|
+
<div class="method_details first">
|
380
|
+
<h3 class="signature first" id="calculate_diff_image-instance_method">
|
381
|
+
|
382
|
+
- (<tt>String</tt>) <strong>calculate_diff_image</strong>(path_res = './diff.png')
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
</h3><div class="docstring">
|
389
|
+
<div class="discussion">
|
390
|
+
|
391
|
+
<p>This method generates a png with the image differences and returns a
|
392
|
+
fingerprint of the returned image.</p>
|
393
|
+
|
394
|
+
<p>If areas are defined, they will be used on the comparison. See
|
395
|
+
<span class='object_link'><a href="#set_areas-instance_method" title="ImageComparator#set_areas (method)">#set_areas</a></span></p>
|
396
|
+
|
397
|
+
|
398
|
+
</div>
|
399
|
+
</div>
|
400
|
+
<div class="tags">
|
401
|
+
<p class="tag_title">Parameters:</p>
|
402
|
+
<ul class="param">
|
403
|
+
|
404
|
+
<li>
|
405
|
+
|
406
|
+
<span class='name'>path_res</span>
|
407
|
+
|
408
|
+
|
409
|
+
<span class='type'>(<tt>String</tt>)</span>
|
410
|
+
|
411
|
+
|
412
|
+
<em class="default">(defaults to: <tt>'./diff.png'</tt>)</em>
|
413
|
+
|
414
|
+
|
415
|
+
—
|
416
|
+
<div class='inline'>
|
417
|
+
<p>(Optional, by default ./diff.png) It defines where the png file with the
|
418
|
+
differences will be placed.</p>
|
419
|
+
</div>
|
420
|
+
|
421
|
+
</li>
|
422
|
+
|
423
|
+
</ul>
|
424
|
+
|
425
|
+
<p class="tag_title">Returns:</p>
|
426
|
+
<ul class="return">
|
427
|
+
|
428
|
+
<li>
|
429
|
+
|
430
|
+
|
431
|
+
<span class='type'>(<tt>String</tt>)</span>
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
—
|
436
|
+
<div class='inline'>
|
437
|
+
<p>It generates a png with the image differences and returns a fingerprint of
|
438
|
+
the returned image</p>
|
439
|
+
</div>
|
440
|
+
|
441
|
+
</li>
|
442
|
+
|
443
|
+
</ul>
|
444
|
+
|
445
|
+
</div><table class="source_code">
|
446
|
+
<tr>
|
447
|
+
<td>
|
448
|
+
<pre class="lines">
|
449
|
+
|
450
|
+
|
451
|
+
48
|
452
|
+
49
|
453
|
+
50
|
454
|
+
51
|
455
|
+
52
|
456
|
+
53
|
457
|
+
54
|
458
|
+
55
|
459
|
+
56
|
460
|
+
57
|
461
|
+
58
|
462
|
+
59
|
463
|
+
60
|
464
|
+
61
|
465
|
+
62
|
466
|
+
63
|
467
|
+
64
|
468
|
+
65
|
469
|
+
66
|
470
|
+
67
|
471
|
+
68
|
472
|
+
69
|
473
|
+
70
|
474
|
+
71
|
475
|
+
72
|
476
|
+
73
|
477
|
+
74
|
478
|
+
75
|
479
|
+
76
|
480
|
+
77
|
481
|
+
78
|
482
|
+
79
|
483
|
+
80
|
484
|
+
81
|
485
|
+
82
|
486
|
+
83
|
487
|
+
84
|
488
|
+
85</pre>
|
489
|
+
</td>
|
490
|
+
<td>
|
491
|
+
<pre class="code"><span class="info file"># File 'image_comparator.rb', line 48</span>
|
492
|
+
|
493
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_calculate_diff_image'>calculate_diff_image</span><span class='lparen'>(</span><span class='id identifier rubyid_path_res'>path_res</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>./diff.png</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
494
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>in: calculate_diff_image (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path_res'>path_res</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
495
|
+
<span class='kw'>begin</span>
|
496
|
+
<span class='id identifier rubyid_p_image1'>p_image1</span> <span class='op'>=</span> <span class='ivar'>@path_image1</span>
|
497
|
+
<span class='id identifier rubyid_p_image2'>p_image2</span> <span class='op'>=</span> <span class='ivar'>@path_image2</span>
|
498
|
+
|
499
|
+
<span class='kw'>unless</span> <span class='ivar'>@areas</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
500
|
+
<span class='id identifier rubyid_prepare_areas_on_files'>prepare_areas_on_files</span>
|
501
|
+
<span class='id identifier rubyid_p_image1'>p_image1</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>DEFAULT_TEMP_FOLDER</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='const'>DEFAULT_FILE1_NAME</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
502
|
+
<span class='id identifier rubyid_p_image2'>p_image2</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>DEFAULT_TEMP_FOLDER</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='const'>DEFAULT_FILE2_NAME</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
503
|
+
<span class='kw'>end</span>
|
504
|
+
|
505
|
+
<span class='id identifier rubyid_images'>images</span> <span class='op'>=</span> <span class='lbracket'>[</span>
|
506
|
+
<span class='const'>ChunkyPNG</span><span class='op'>::</span><span class='const'>Image</span><span class='period'>.</span><span class='id identifier rubyid_from_file'>from_file</span><span class='lparen'>(</span><span class='id identifier rubyid_p_image1'>p_image1</span><span class='rparen'>)</span><span class='comma'>,</span>
|
507
|
+
<span class='const'>ChunkyPNG</span><span class='op'>::</span><span class='const'>Image</span><span class='period'>.</span><span class='id identifier rubyid_from_file'>from_file</span><span class='lparen'>(</span><span class='id identifier rubyid_p_image2'>p_image2</span><span class='rparen'>)</span>
|
508
|
+
<span class='rbracket'>]</span>
|
509
|
+
|
510
|
+
<span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_y'>y</span><span class='op'>|</span>
|
511
|
+
<span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_row'>row</span><span class='lparen'>(</span><span class='id identifier rubyid_y'>y</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_pixel'>pixel</span><span class='comma'>,</span> <span class='id identifier rubyid_x'>x</span><span class='op'>|</span>
|
512
|
+
|
513
|
+
<span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_rgb'>rgb</span><span class='lparen'>(</span>
|
514
|
+
<span class='id identifier rubyid_r'>r</span><span class='lparen'>(</span><span class='id identifier rubyid_pixel'>pixel</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_r'>r</span><span class='lparen'>(</span><span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>-</span> <span class='int'>2</span> <span class='op'>*</span> <span class='lbracket'>[</span><span class='id identifier rubyid_r'>r</span><span class='lparen'>(</span><span class='id identifier rubyid_pixel'>pixel</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_r'>r</span><span class='lparen'>(</span><span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span><span class='comma'>,</span>
|
515
|
+
<span class='id identifier rubyid_g'>g</span><span class='lparen'>(</span><span class='id identifier rubyid_pixel'>pixel</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_g'>g</span><span class='lparen'>(</span><span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>-</span> <span class='int'>2</span> <span class='op'>*</span> <span class='lbracket'>[</span><span class='id identifier rubyid_g'>g</span><span class='lparen'>(</span><span class='id identifier rubyid_pixel'>pixel</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_g'>g</span><span class='lparen'>(</span><span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span><span class='comma'>,</span>
|
516
|
+
<span class='id identifier rubyid_b'>b</span><span class='lparen'>(</span><span class='id identifier rubyid_pixel'>pixel</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_b'>b</span><span class='lparen'>(</span><span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>-</span> <span class='int'>2</span> <span class='op'>*</span> <span class='lbracket'>[</span><span class='id identifier rubyid_b'>b</span><span class='lparen'>(</span><span class='id identifier rubyid_pixel'>pixel</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='lparen'>(</span><span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span>
|
517
|
+
<span class='rparen'>)</span>
|
518
|
+
<span class='kw'>end</span>
|
519
|
+
<span class='kw'>end</span>
|
520
|
+
<span class='id identifier rubyid_images'>images</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span><span class='lparen'>(</span><span class='id identifier rubyid_path_res'>path_res</span><span class='rparen'>)</span>
|
521
|
+
<span class='id identifier rubyid_diff_fingerprint'>diff_fingerprint</span> <span class='op'>=</span> <span class='const'>Phashion</span><span class='op'>::</span><span class='const'>Image</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_path_res'>path_res</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_fingerprint'>fingerprint</span>
|
522
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>out: calculate_diff_image (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path_res'>path_res</span><span class='embexpr_end'>}</span><span class='tstring_content'>) - ret: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_diff_fingerprint'>diff_fingerprint</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
523
|
+
<span class='id identifier rubyid_diff_fingerprint'>diff_fingerprint</span>
|
524
|
+
<span class='kw'>rescue</span> <span class='const'>StandardError</span>
|
525
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>There was a problem</span><span class='tstring_end'>'</span></span>
|
526
|
+
<span class='id identifier rubyid_raise'>raise</span>
|
527
|
+
<span class='kw'>ensure</span>
|
528
|
+
<span class='id identifier rubyid_delete_temp_images'>delete_temp_images</span>
|
529
|
+
<span class='kw'>end</span>
|
530
|
+
<span class='kw'>end</span></pre>
|
531
|
+
</td>
|
532
|
+
</tr>
|
533
|
+
</table>
|
534
|
+
</div>
|
535
|
+
|
536
|
+
<div class="method_details ">
|
537
|
+
<h3 class="signature " id="equal-instance_method">
|
538
|
+
|
539
|
+
- (<tt>Boolean</tt>) <strong>equal</strong>
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
</h3><div class="docstring">
|
546
|
+
<div class="discussion">
|
547
|
+
|
548
|
+
<p>This method return a boolean to indicate if 2 png images are equal from a
|
549
|
+
pixel point of view.</p>
|
550
|
+
|
551
|
+
<p>If areas are defined, they will be used on the comparison. See
|
552
|
+
<span class='object_link'><a href="#set_areas-instance_method" title="ImageComparator#set_areas (method)">#set_areas</a></span></p>
|
553
|
+
|
554
|
+
|
555
|
+
</div>
|
556
|
+
</div>
|
557
|
+
<div class="tags">
|
558
|
+
|
559
|
+
<p class="tag_title">Returns:</p>
|
560
|
+
<ul class="return">
|
561
|
+
|
562
|
+
<li>
|
563
|
+
|
564
|
+
|
565
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
—
|
570
|
+
<div class='inline'>
|
571
|
+
<p>True if the 2 images are equal, otherwise false.</p>
|
572
|
+
</div>
|
573
|
+
|
574
|
+
</li>
|
575
|
+
|
576
|
+
</ul>
|
577
|
+
|
578
|
+
</div><table class="source_code">
|
579
|
+
<tr>
|
580
|
+
<td>
|
581
|
+
<pre class="lines">
|
582
|
+
|
583
|
+
|
584
|
+
36
|
585
|
+
37
|
586
|
+
38</pre>
|
587
|
+
</td>
|
588
|
+
<td>
|
589
|
+
<pre class="code"><span class="info file"># File 'image_comparator.rb', line 36</span>
|
590
|
+
|
591
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_equal'>equal</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
592
|
+
<span class='id identifier rubyid_equal_pixel_perfect'>equal_pixel_perfect</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
593
|
+
<span class='kw'>end</span></pre>
|
594
|
+
</td>
|
595
|
+
</tr>
|
596
|
+
</table>
|
597
|
+
</div>
|
598
|
+
|
599
|
+
<div class="method_details ">
|
600
|
+
<h3 class="signature " id="equal_and_generate_diff-instance_method">
|
601
|
+
|
602
|
+
- (<tt>Boolean</tt>) <strong>equal_and_generate_diff</strong>(path_res = './diff.png')
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
</h3><div class="docstring">
|
609
|
+
<div class="discussion">
|
610
|
+
|
611
|
+
<p>This method returns a boolean to indicate if the 2 images are equal, based
|
612
|
+
on the threshold, and in case they are not, a png with the differences is
|
613
|
+
generated.</p>
|
614
|
+
|
615
|
+
<p>If areas are defined, they will be used on the comparison. See
|
616
|
+
<span class='object_link'><a href="#set_areas-instance_method" title="ImageComparator#set_areas (method)">#set_areas</a></span></p>
|
617
|
+
|
618
|
+
|
619
|
+
</div>
|
620
|
+
</div>
|
621
|
+
<div class="tags">
|
622
|
+
<p class="tag_title">Parameters:</p>
|
623
|
+
<ul class="param">
|
624
|
+
|
625
|
+
<li>
|
626
|
+
|
627
|
+
<span class='name'>path_res</span>
|
628
|
+
|
629
|
+
|
630
|
+
<span class='type'>(<tt>String</tt>)</span>
|
631
|
+
|
632
|
+
|
633
|
+
<em class="default">(defaults to: <tt>'./diff.png'</tt>)</em>
|
634
|
+
|
635
|
+
|
636
|
+
—
|
637
|
+
<div class='inline'>
|
638
|
+
<p>(Optional, by default ./diff.png) It defines where the png file with the
|
639
|
+
differences will be placed.</p>
|
640
|
+
</div>
|
641
|
+
|
642
|
+
</li>
|
643
|
+
|
644
|
+
</ul>
|
645
|
+
|
646
|
+
<p class="tag_title">Returns:</p>
|
647
|
+
<ul class="return">
|
648
|
+
|
649
|
+
<li>
|
650
|
+
|
651
|
+
|
652
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
653
|
+
|
654
|
+
|
655
|
+
|
656
|
+
—
|
657
|
+
<div class='inline'>
|
658
|
+
<p>True if the 2 images are equal, otherwise false. In case of being false a
|
659
|
+
png image with the differences is generated.</p>
|
660
|
+
</div>
|
661
|
+
|
662
|
+
</li>
|
663
|
+
|
664
|
+
</ul>
|
665
|
+
|
666
|
+
</div><table class="source_code">
|
667
|
+
<tr>
|
668
|
+
<td>
|
669
|
+
<pre class="lines">
|
670
|
+
|
671
|
+
|
672
|
+
97
|
673
|
+
98
|
674
|
+
99
|
675
|
+
100
|
676
|
+
101
|
677
|
+
102
|
678
|
+
103</pre>
|
679
|
+
</td>
|
680
|
+
<td>
|
681
|
+
<pre class="code"><span class="info file"># File 'image_comparator.rb', line 97</span>
|
682
|
+
|
683
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_equal_and_generate_diff'>equal_and_generate_diff</span><span class='lparen'>(</span><span class='id identifier rubyid_path_res'>path_res</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>./diff.png</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
684
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>in:equal_and_generate_diff(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path_res'>path_res</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
685
|
+
<span class='id identifier rubyid_images_equals'>images_equals</span> <span class='op'>=</span> <span class='id identifier rubyid_equal'>equal</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
686
|
+
<span class='id identifier rubyid_calculate_diff_image'>calculate_diff_image</span><span class='lparen'>(</span><span class='id identifier rubyid_path_res'>path_res</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_images_equals'>images_equals</span>
|
687
|
+
<span class='ivar'>@logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>out:equal_and_generate_diff(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path_res'>path_res</span><span class='embexpr_end'>}</span><span class='tstring_content'> - ret: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_images_equals'>images_equals</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
688
|
+
<span class='id identifier rubyid_images_equals'>images_equals</span>
|
689
|
+
<span class='kw'>end</span></pre>
|
690
|
+
</td>
|
691
|
+
</tr>
|
692
|
+
</table>
|
693
|
+
</div>
|
694
|
+
|
695
|
+
<div class="method_details ">
|
696
|
+
<h3 class="signature " id="set_areas-instance_method">
|
697
|
+
|
698
|
+
- (<tt>Object</tt>) <strong>set_areas</strong>(areas)
|
699
|
+
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
|
704
|
+
</h3><div class="docstring">
|
705
|
+
<div class="discussion">
|
706
|
+
|
707
|
+
<p>This method defines the areas that will be used on the comparison methods,
|
708
|
+
ie: equal, calculate_diff_image and equal_and_generate_diff methods.</p>
|
709
|
+
|
710
|
+
<p>The comparison methods will only focus the comparison on the areas flagged
|
711
|
+
as included and will ignore the ones marked as exclude.</p>
|
712
|
+
|
713
|
+
<p>If the areas are defined, the comparison methods first create a temporal
|
714
|
+
image for each image to compare with only the areas that will be included
|
715
|
+
(if there is any) and then will remove from this image the excluded images
|
716
|
+
(if any). This temporal images will be used on the comparison.</p>
|
717
|
+
|
718
|
+
|
719
|
+
</div>
|
720
|
+
</div>
|
721
|
+
<div class="tags">
|
722
|
+
|
723
|
+
<div class="examples">
|
724
|
+
<p class="tag_title">Examples:</p>
|
725
|
+
|
726
|
+
|
727
|
+
<p class="example_title"><div class='inline'>
|
728
|
+
<p>Here you can see an example of areas.</p>
|
729
|
+
</div></p>
|
730
|
+
|
731
|
+
<pre class="example code"><code><span class='id identifier rubyid_origin_coord'>origin_coord</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>x</span><span class='label_end'>':</span><span class='int'>828</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>y</span><span class='label_end'>':</span><span class='int'>293</span><span class='rbrace'>}</span>
|
732
|
+
<span class='id identifier rubyid_end_coord'>end_coord</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>x</span><span class='label_end'>':</span><span class='int'>1173</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>y</span><span class='label_end'>':</span><span class='int'>688</span><span class='rbrace'>}</span>
|
733
|
+
<span class='id identifier rubyid_area1'>area1</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>origin</span><span class='label_end'>':</span> <span class='id identifier rubyid_origin_coord'>origin_coord</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>end</span><span class='label_end'>':</span> <span class='id identifier rubyid_end_coord'>end_coord</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>exclude</span><span class='label_end'>':</span> <span class='kw'>false</span><span class='rbrace'>}</span>
|
734
|
+
<span class='id identifier rubyid_origin_coord2'>origin_coord2</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>x</span><span class='label_end'>':</span><span class='int'>0</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>y</span><span class='label_end'>':</span><span class='int'>0</span><span class='rbrace'>}</span>
|
735
|
+
<span class='id identifier rubyid_end_coord2'>end_coord2</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>x</span><span class='label_end'>':</span><span class='int'>828</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>y</span><span class='label_end'>':</span><span class='int'>293</span><span class='rbrace'>}</span>
|
736
|
+
<span class='id identifier rubyid_area2'>area2</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>origin</span><span class='label_end'>':</span> <span class='id identifier rubyid_origin_coord2'>origin_coord2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>end</span><span class='label_end'>':</span> <span class='id identifier rubyid_end_coord2'>end_coord2</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>exclude</span><span class='label_end'>':</span> <span class='kw'>true</span><span class='rbrace'>}</span>
|
737
|
+
<span class='id identifier rubyid_areas'>areas</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_area1'>area1</span><span class='comma'>,</span> <span class='id identifier rubyid_area2'>area2</span><span class='rbracket'>]</span></code></pre>
|
738
|
+
|
739
|
+
</div>
|
740
|
+
<p class="tag_title">Parameters:</p>
|
741
|
+
<ul class="param">
|
742
|
+
|
743
|
+
<li>
|
744
|
+
|
745
|
+
<span class='name'>areas</span>
|
746
|
+
|
747
|
+
|
748
|
+
<span class='type'>(<tt>Array<Symbol></tt>)</span>
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
—
|
753
|
+
<div class='inline'>
|
754
|
+
<p>This is an array of areas to include or exclude on the comparison methods.
|
755
|
+
It has the following format:</p>
|
756
|
+
|
757
|
+
<p>areas = [area1, …, areaN]</p>
|
758
|
+
|
759
|
+
<p>areaX = 'end': point, 'exclude':
|
760
|
+
boolean</p>
|
761
|
+
|
762
|
+
<p>point = integer, 'y': integer</p>
|
763
|
+
</div>
|
764
|
+
|
765
|
+
</li>
|
766
|
+
|
767
|
+
</ul>
|
768
|
+
|
769
|
+
|
770
|
+
</div><table class="source_code">
|
771
|
+
<tr>
|
772
|
+
<td>
|
773
|
+
<pre class="lines">
|
774
|
+
|
775
|
+
|
776
|
+
133
|
777
|
+
134
|
778
|
+
135</pre>
|
779
|
+
</td>
|
780
|
+
<td>
|
781
|
+
<pre class="code"><span class="info file"># File 'image_comparator.rb', line 133</span>
|
782
|
+
|
783
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_areas'>set_areas</span><span class='lparen'>(</span><span class='id identifier rubyid_areas'>areas</span><span class='rparen'>)</span>
|
784
|
+
<span class='ivar'>@areas</span><span class='op'>=</span><span class='id identifier rubyid_areas'>areas</span>
|
785
|
+
<span class='kw'>end</span></pre>
|
786
|
+
</td>
|
787
|
+
</tr>
|
788
|
+
</table>
|
789
|
+
</div>
|
790
|
+
|
791
|
+
</div>
|
792
|
+
|
793
|
+
</div>
|
794
|
+
|
795
|
+
<div id="footer">
|
796
|
+
Generated on Thu Nov 10 15:59:20 2016 by
|
797
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
798
|
+
0.8.7.6 (ruby-2.3.1).
|
799
|
+
</div>
|
800
|
+
|
801
|
+
</body>
|
802
|
+
</html>
|