shattered_machine 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +1 -0
- data/.yardoc/checksums +14 -0
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +8 -0
- data/LICENSE +9 -0
- data/README.md +51 -0
- data/doc/ShatteredMachine.html +135 -0
- data/doc/ShatteredMachine/Brush.html +375 -0
- data/doc/ShatteredMachine/ChangeByte.html +367 -0
- data/doc/ShatteredMachine/Converter.html +327 -0
- data/doc/ShatteredMachine/Defect.html +369 -0
- data/doc/ShatteredMachine/Exchange.html +373 -0
- data/doc/ShatteredMachine/Glitcher.html +365 -0
- data/doc/ShatteredMachine/Io.html +569 -0
- data/doc/ShatteredMachine/Io/Paths.html +310 -0
- data/doc/ShatteredMachine/PixelSorter.html +381 -0
- data/doc/ShatteredMachine/RustyEngine.html +111 -0
- data/doc/ShatteredMachine/Sampler.html +361 -0
- data/doc/ShatteredMachine/Slim.html +389 -0
- data/doc/ShatteredMachine/Transpose.html +369 -0
- data/doc/ShatteredMachine/WrongFilter.html +367 -0
- data/doc/_index.html +288 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +497 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +123 -0
- data/doc/js/app.js +314 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +275 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/rusty_engine/librusty_engine.dll +0 -0
- data/lib/rusty_engine/librusty_engine.dylib +0 -0
- data/lib/rusty_engine/librusty_engine.so +0 -0
- data/lib/rusty_engine/rusty_engine.rb +39 -0
- data/lib/shattered_machine.rb +11 -0
- data/lib/shattered_machine/brush.rb +28 -0
- data/lib/shattered_machine/change_byte.rb +41 -0
- data/lib/shattered_machine/converter.rb +20 -0
- data/lib/shattered_machine/defect.rb +38 -0
- data/lib/shattered_machine/exchange.rb +59 -0
- data/lib/shattered_machine/glitcher.rb +35 -0
- data/lib/shattered_machine/io.rb +74 -0
- data/lib/shattered_machine/pixel_sorter.rb +50 -0
- data/lib/shattered_machine/sampler.rb +100 -0
- data/lib/shattered_machine/slim.rb +55 -0
- data/lib/shattered_machine/transpose.rb +50 -0
- data/lib/shattered_machine/wrong_filter.rb +39 -0
- data/shattered_machine.gemspec +16 -0
- data/spec/brush_spec.rb +28 -0
- data/spec/change_byte_spec.rb +26 -0
- data/spec/converter_spec.rb +24 -0
- data/spec/defect_spec.rb +26 -0
- data/spec/exchange_spec.rb +26 -0
- data/spec/glitcher_spec.rb +26 -0
- data/spec/images/bar.PNG +0 -0
- data/spec/images/bar.jpeg +0 -0
- data/spec/images/foo.jpg +0 -0
- data/spec/images/foo.png +0 -0
- data/spec/images/fuzz.JPG +0 -0
- data/spec/images/pouet.JPEG +0 -0
- data/spec/io_spec.rb +74 -0
- data/spec/lib/rusty_engine_spec.rb +20 -0
- data/spec/pixel_sorter_spec.rb +26 -0
- data/spec/sampler_spec.rb +37 -0
- data/spec/slim_spec.rb +26 -0
- data/spec/spec_helper.rb +61 -0
- data/spec/transpose_spec.rb +26 -0
- data/spec/wrong_filter_spec.rb +26 -0
- metadata +147 -0
@@ -0,0 +1,389 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: ShatteredMachine::Slim
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.26
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "ShatteredMachine::Slim";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (S)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../ShatteredMachine.html" title="ShatteredMachine (module)">ShatteredMachine</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Slim</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: ShatteredMachine::Slim
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">ShatteredMachine::Slim</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/shattered_machine/slim.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Repeat pixels of a given png image. The logic for the pixel sorter come from the Rusty Engine.</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<h2>
|
116
|
+
Constant Summary
|
117
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
118
|
+
</h2>
|
119
|
+
|
120
|
+
<dl class="constants">
|
121
|
+
|
122
|
+
<dt id="ALL_COLORS-constant" class="">ALL_COLORS =
|
123
|
+
|
124
|
+
</dt>
|
125
|
+
<dd><pre class="code"><span class='qsymbols_beg'>%i(</span><span class='tstring_content'>white</span><span class='words_sep'> </span><span class='tstring_content'>black</span><span class='words_sep'> </span><span class='tstring_content'>grey</span><span class='words_sep'> </span><span class='tstring_content'>red</span><span class='words_sep'> </span><span class='tstring_content'>green</span><span class='words_sep'> </span><span class='tstring_content'>blue</span><span class='words_sep'> </span><span class='tstring_content'>cyan</span><span class='words_sep'> </span><span class='tstring_content'>yellow</span><span class='words_sep'> </span><span class='tstring_content'>magenta</span><span class='tstring_end'>)</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
126
|
+
|
127
|
+
</dl>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<h2>
|
138
|
+
Instance Method Summary
|
139
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
140
|
+
</h2>
|
141
|
+
|
142
|
+
<ul class="summary">
|
143
|
+
|
144
|
+
<li class="public ">
|
145
|
+
<span class="summary_signature">
|
146
|
+
|
147
|
+
<a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong>(input_image, output_image) ⇒ boolean </a>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
</span>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="summary_desc"><div class='inline'>
|
162
|
+
<p>Status of slim.</p>
|
163
|
+
</div></span>
|
164
|
+
|
165
|
+
</li>
|
166
|
+
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options = {}) ⇒ Slim </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
<span class="note title constructor">constructor</span>
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<span class="summary_desc"><div class='inline'>
|
188
|
+
<p>A new instance of Slim.</p>
|
189
|
+
</div></span>
|
190
|
+
|
191
|
+
</li>
|
192
|
+
|
193
|
+
|
194
|
+
</ul>
|
195
|
+
|
196
|
+
|
197
|
+
<div id="constructor_details" class="method_details_list">
|
198
|
+
<h2>Constructor Details</h2>
|
199
|
+
|
200
|
+
<div class="method_details first">
|
201
|
+
<h3 class="signature first" id="initialize-instance_method">
|
202
|
+
|
203
|
+
#<strong>initialize</strong>(options = {}) ⇒ <tt><span class='object_link'><a href="" title="ShatteredMachine::Slim (class)">Slim</a></span></tt>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
</h3><div class="docstring">
|
210
|
+
<div class="discussion">
|
211
|
+
|
212
|
+
<p>Returns a new instance of Slim.</p>
|
213
|
+
|
214
|
+
|
215
|
+
</div>
|
216
|
+
</div>
|
217
|
+
<div class="tags">
|
218
|
+
<p class="tag_title">Parameters:</p>
|
219
|
+
<ul class="param">
|
220
|
+
|
221
|
+
<li>
|
222
|
+
|
223
|
+
<span class='name'>options</span>
|
224
|
+
|
225
|
+
|
226
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
227
|
+
|
228
|
+
|
229
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
230
|
+
|
231
|
+
|
232
|
+
—
|
233
|
+
<div class='inline'>
|
234
|
+
<p>options for slim algorithm</p>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
</li>
|
238
|
+
|
239
|
+
</ul>
|
240
|
+
|
241
|
+
|
242
|
+
</div><table class="source_code">
|
243
|
+
<tr>
|
244
|
+
<td>
|
245
|
+
<pre class="lines">
|
246
|
+
|
247
|
+
|
248
|
+
12
|
249
|
+
13
|
250
|
+
14
|
251
|
+
15
|
252
|
+
16
|
253
|
+
17
|
254
|
+
18</pre>
|
255
|
+
</td>
|
256
|
+
<td>
|
257
|
+
<pre class="code"><span class="info file"># File 'lib/shattered_machine/slim.rb', line 12</span>
|
258
|
+
|
259
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
260
|
+
<span class='ivar'>@colors</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:colors</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'><span class='object_link'><a href="#ALL_COLORS-constant" title="ShatteredMachine::Slim::ALL_COLORS (constant)">ALL_COLORS</a></span></span>
|
261
|
+
<span class='ivar'>@direction</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:direction</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='symbol'>:up_to_down</span>
|
262
|
+
<span class='ivar'>@probability</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:probability</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>95</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
263
|
+
<span class='ivar'>@probability_area</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:probability_area</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>global</span><span class='tstring_end'>'</span></span>
|
264
|
+
<span class='ivar'>@colors_with_proba</span> <span class='op'>=</span> <span class='id identifier rubyid_colors_with_proba'>colors_with_proba</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:colors_with_proba</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
265
|
+
<span class='kw'>end</span></pre>
|
266
|
+
</td>
|
267
|
+
</tr>
|
268
|
+
</table>
|
269
|
+
</div>
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
<div id="instance_method_details" class="method_details_list">
|
275
|
+
<h2>Instance Method Details</h2>
|
276
|
+
|
277
|
+
|
278
|
+
<div class="method_details first">
|
279
|
+
<h3 class="signature first" id="call-instance_method">
|
280
|
+
|
281
|
+
#<strong>call</strong>(input_image, output_image) ⇒ <tt>boolean</tt>
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
</h3><div class="docstring">
|
288
|
+
<div class="discussion">
|
289
|
+
|
290
|
+
<p>Returns status of slim.</p>
|
291
|
+
|
292
|
+
|
293
|
+
</div>
|
294
|
+
</div>
|
295
|
+
<div class="tags">
|
296
|
+
<p class="tag_title">Parameters:</p>
|
297
|
+
<ul class="param">
|
298
|
+
|
299
|
+
<li>
|
300
|
+
|
301
|
+
<span class='name'>input_image</span>
|
302
|
+
|
303
|
+
|
304
|
+
<span class='type'>(<tt>string</tt>)</span>
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
—
|
309
|
+
<div class='inline'>
|
310
|
+
<p>path for image</p>
|
311
|
+
</div>
|
312
|
+
|
313
|
+
</li>
|
314
|
+
|
315
|
+
<li>
|
316
|
+
|
317
|
+
<span class='name'>output_image</span>
|
318
|
+
|
319
|
+
|
320
|
+
<span class='type'>(<tt>string</tt>)</span>
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
—
|
325
|
+
<div class='inline'>
|
326
|
+
<p>path for output slimed image</p>
|
327
|
+
</div>
|
328
|
+
|
329
|
+
</li>
|
330
|
+
|
331
|
+
</ul>
|
332
|
+
|
333
|
+
<p class="tag_title">Returns:</p>
|
334
|
+
<ul class="return">
|
335
|
+
|
336
|
+
<li>
|
337
|
+
|
338
|
+
|
339
|
+
<span class='type'>(<tt>boolean</tt>)</span>
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
—
|
344
|
+
<div class='inline'>
|
345
|
+
<p>status of slim</p>
|
346
|
+
</div>
|
347
|
+
|
348
|
+
</li>
|
349
|
+
|
350
|
+
</ul>
|
351
|
+
|
352
|
+
</div><table class="source_code">
|
353
|
+
<tr>
|
354
|
+
<td>
|
355
|
+
<pre class="lines">
|
356
|
+
|
357
|
+
|
358
|
+
23
|
359
|
+
24
|
360
|
+
25
|
361
|
+
26
|
362
|
+
27</pre>
|
363
|
+
</td>
|
364
|
+
<td>
|
365
|
+
<pre class="code"><span class="info file"># File 'lib/shattered_machine/slim.rb', line 23</span>
|
366
|
+
|
367
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_input_image'>input_image</span><span class='comma'>,</span> <span class='id identifier rubyid_output_image'>output_image</span><span class='rparen'>)</span>
|
368
|
+
<span class='const'><span class='object_link'><a href="RustyEngine.html" title="ShatteredMachine::RustyEngine (module)">RustyEngine</a></span></span><span class='period'>.</span><span class='id identifier rubyid_slim'>slim</span><span class='lparen'>(</span><span class='id identifier rubyid_input_image'>input_image</span><span class='comma'>,</span> <span class='id identifier rubyid_output_image'>output_image</span><span class='comma'>,</span> <span class='ivar'>@probability</span><span class='comma'>,</span> <span class='ivar'>@probability_area</span><span class='comma'>,</span>
|
369
|
+
<span class='id identifier rubyid_rust_formatted_direction'>rust_formatted_direction</span><span class='comma'>,</span> <span class='id identifier rubyid_rust_formatted_colors'>rust_formatted_colors</span><span class='comma'>,</span>
|
370
|
+
<span class='id identifier rubyid_rust_formatted_color_with_proba'>rust_formatted_color_with_proba</span><span class='rparen'>)</span>
|
371
|
+
<span class='kw'>end</span></pre>
|
372
|
+
</td>
|
373
|
+
</tr>
|
374
|
+
</table>
|
375
|
+
</div>
|
376
|
+
|
377
|
+
</div>
|
378
|
+
|
379
|
+
</div>
|
380
|
+
|
381
|
+
<div id="footer">
|
382
|
+
Generated on Sun May 23 13:30:11 2021 by
|
383
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
384
|
+
0.9.26 (ruby-2.6.6).
|
385
|
+
</div>
|
386
|
+
|
387
|
+
</div>
|
388
|
+
</body>
|
389
|
+
</html>
|
@@ -0,0 +1,369 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: ShatteredMachine::Transpose
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.26
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "ShatteredMachine::Transpose";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (T)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../ShatteredMachine.html" title="ShatteredMachine (module)">ShatteredMachine</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Transpose</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: ShatteredMachine::Transpose
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">ShatteredMachine::Transpose</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/shattered_machine/transpose.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Use the transpose algorithm from pnglitch on a given png image.</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2>
|
122
|
+
Instance Method Summary
|
123
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
124
|
+
</h2>
|
125
|
+
|
126
|
+
<ul class="summary">
|
127
|
+
|
128
|
+
<li class="public ">
|
129
|
+
<span class="summary_signature">
|
130
|
+
|
131
|
+
<a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong>(input_image, output_image) ⇒ boolean </a>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
</span>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="summary_desc"><div class='inline'>
|
146
|
+
<p>Status of transpose.</p>
|
147
|
+
</div></span>
|
148
|
+
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
152
|
+
<li class="public ">
|
153
|
+
<span class="summary_signature">
|
154
|
+
|
155
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options = {}) ⇒ Transpose </a>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</span>
|
160
|
+
|
161
|
+
|
162
|
+
<span class="note title constructor">constructor</span>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>A new instance of Transpose.</p>
|
173
|
+
</div></span>
|
174
|
+
|
175
|
+
</li>
|
176
|
+
|
177
|
+
|
178
|
+
</ul>
|
179
|
+
|
180
|
+
|
181
|
+
<div id="constructor_details" class="method_details_list">
|
182
|
+
<h2>Constructor Details</h2>
|
183
|
+
|
184
|
+
<div class="method_details first">
|
185
|
+
<h3 class="signature first" id="initialize-instance_method">
|
186
|
+
|
187
|
+
#<strong>initialize</strong>(options = {}) ⇒ <tt><span class='object_link'><a href="" title="ShatteredMachine::Transpose (class)">Transpose</a></span></tt>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
</h3><div class="docstring">
|
194
|
+
<div class="discussion">
|
195
|
+
|
196
|
+
<p>Returns a new instance of Transpose.</p>
|
197
|
+
|
198
|
+
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
<div class="tags">
|
202
|
+
<p class="tag_title">Parameters:</p>
|
203
|
+
<ul class="param">
|
204
|
+
|
205
|
+
<li>
|
206
|
+
|
207
|
+
<span class='name'>options</span>
|
208
|
+
|
209
|
+
|
210
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
211
|
+
|
212
|
+
|
213
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
214
|
+
|
215
|
+
|
216
|
+
—
|
217
|
+
<div class='inline'>
|
218
|
+
<p>options for transpose algorithm</p>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
</li>
|
222
|
+
|
223
|
+
</ul>
|
224
|
+
|
225
|
+
|
226
|
+
</div><table class="source_code">
|
227
|
+
<tr>
|
228
|
+
<td>
|
229
|
+
<pre class="lines">
|
230
|
+
|
231
|
+
|
232
|
+
8
|
233
|
+
9
|
234
|
+
10
|
235
|
+
11</pre>
|
236
|
+
</td>
|
237
|
+
<td>
|
238
|
+
<pre class="code"><span class="info file"># File 'lib/shattered_machine/transpose.rb', line 8</span>
|
239
|
+
|
240
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
241
|
+
<span class='ivar'>@filter</span> <span class='op'>=</span> <span class='id identifier rubyid_define_filter'>define_filter</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:filter</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>average</span><span class='tstring_end'>'</span></span>
|
242
|
+
<span class='ivar'>@transpose_force</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:transpose_force</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>half</span><span class='tstring_end'>'</span></span>
|
243
|
+
<span class='kw'>end</span></pre>
|
244
|
+
</td>
|
245
|
+
</tr>
|
246
|
+
</table>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
</div>
|
250
|
+
|
251
|
+
|
252
|
+
<div id="instance_method_details" class="method_details_list">
|
253
|
+
<h2>Instance Method Details</h2>
|
254
|
+
|
255
|
+
|
256
|
+
<div class="method_details first">
|
257
|
+
<h3 class="signature first" id="call-instance_method">
|
258
|
+
|
259
|
+
#<strong>call</strong>(input_image, output_image) ⇒ <tt>boolean</tt>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
</h3><div class="docstring">
|
266
|
+
<div class="discussion">
|
267
|
+
|
268
|
+
<p>Returns status of transpose.</p>
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
</div>
|
273
|
+
<div class="tags">
|
274
|
+
<p class="tag_title">Parameters:</p>
|
275
|
+
<ul class="param">
|
276
|
+
|
277
|
+
<li>
|
278
|
+
|
279
|
+
<span class='name'>input_image</span>
|
280
|
+
|
281
|
+
|
282
|
+
<span class='type'>(<tt>string</tt>)</span>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
—
|
287
|
+
<div class='inline'>
|
288
|
+
<p>path for image</p>
|
289
|
+
</div>
|
290
|
+
|
291
|
+
</li>
|
292
|
+
|
293
|
+
<li>
|
294
|
+
|
295
|
+
<span class='name'>output_image</span>
|
296
|
+
|
297
|
+
|
298
|
+
<span class='type'>(<tt>string</tt>)</span>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
—
|
303
|
+
<div class='inline'>
|
304
|
+
<p>path for output transposed image</p>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
</li>
|
308
|
+
|
309
|
+
</ul>
|
310
|
+
|
311
|
+
<p class="tag_title">Returns:</p>
|
312
|
+
<ul class="return">
|
313
|
+
|
314
|
+
<li>
|
315
|
+
|
316
|
+
|
317
|
+
<span class='type'>(<tt>boolean</tt>)</span>
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
—
|
322
|
+
<div class='inline'>
|
323
|
+
<p>status of transpose</p>
|
324
|
+
</div>
|
325
|
+
|
326
|
+
</li>
|
327
|
+
|
328
|
+
</ul>
|
329
|
+
|
330
|
+
</div><table class="source_code">
|
331
|
+
<tr>
|
332
|
+
<td>
|
333
|
+
<pre class="lines">
|
334
|
+
|
335
|
+
|
336
|
+
16
|
337
|
+
17
|
338
|
+
18
|
339
|
+
19
|
340
|
+
20
|
341
|
+
21</pre>
|
342
|
+
</td>
|
343
|
+
<td>
|
344
|
+
<pre class="code"><span class="info file"># File 'lib/shattered_machine/transpose.rb', line 16</span>
|
345
|
+
|
346
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_input_image'>input_image</span><span class='comma'>,</span> <span class='id identifier rubyid_output_image'>output_image</span><span class='rparen'>)</span>
|
347
|
+
<span class='const'>PNGlitch</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_input_image'>input_image</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_png'>png</span><span class='op'>|</span>
|
348
|
+
<span class='id identifier rubyid_filtered_glitch'>filtered_glitch</span><span class='lparen'>(</span><span class='id identifier rubyid_png'>png</span><span class='comma'>,</span> <span class='ivar'>@filter</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_save'>save</span> <span class='id identifier rubyid_output_image'>output_image</span>
|
349
|
+
<span class='kw'>end</span>
|
350
|
+
<span class='id identifier rubyid_output_image'>output_image</span>
|
351
|
+
<span class='kw'>end</span></pre>
|
352
|
+
</td>
|
353
|
+
</tr>
|
354
|
+
</table>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
</div>
|
358
|
+
|
359
|
+
</div>
|
360
|
+
|
361
|
+
<div id="footer">
|
362
|
+
Generated on Sun May 23 13:30:11 2021 by
|
363
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
364
|
+
0.9.26 (ruby-2.6.6).
|
365
|
+
</div>
|
366
|
+
|
367
|
+
</div>
|
368
|
+
</body>
|
369
|
+
</html>
|