miso 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/LICENSE +20 -0
  2. data/README +55 -0
  3. data/Rakefile +54 -0
  4. data/TODO +2 -0
  5. data/VERSION +1 -0
  6. data/html/classes/Miso.html +133 -0
  7. data/html/classes/Miso/Factory.html +278 -0
  8. data/html/classes/Miso/Image.html +394 -0
  9. data/html/classes/Miso/Processor.html +379 -0
  10. data/html/classes/Miso/Processor/CoreImage.html +246 -0
  11. data/html/classes/Miso/Processor/ImageMagick.html +345 -0
  12. data/html/classes/Miso/Processor/NotImplementedError.html +111 -0
  13. data/html/created.rid +1 -0
  14. data/html/files/LICENSE.html +133 -0
  15. data/html/files/README.html +156 -0
  16. data/html/files/lib/miso/factory_rb.html +101 -0
  17. data/html/files/lib/miso/image_rb.html +101 -0
  18. data/html/files/lib/miso/processor/core_image_rb.html +108 -0
  19. data/html/files/lib/miso/processor/image_magick_rb.html +110 -0
  20. data/html/files/lib/miso/processor_rb.html +101 -0
  21. data/html/files/lib/miso_rb.html +101 -0
  22. data/html/fr_class_index.html +33 -0
  23. data/html/fr_file_index.html +34 -0
  24. data/html/fr_method_index.html +62 -0
  25. data/html/index.html +24 -0
  26. data/html/rdoc-style.css +208 -0
  27. data/lib/miso.rb +5 -0
  28. data/lib/miso/factory.rb +53 -0
  29. data/lib/miso/image.rb +51 -0
  30. data/lib/miso/processor.rb +61 -0
  31. data/lib/miso/processor/core_image.rb +27 -0
  32. data/lib/miso/processor/image_magick.rb +59 -0
  33. data/spec/api/factory_spec.rb +31 -0
  34. data/spec/api/image_spec.rb +115 -0
  35. data/spec/api/processor/image_magick_spec.rb +22 -0
  36. data/spec/api/processor_spec.rb +41 -0
  37. data/spec/fixtures/120x100.png +0 -0
  38. data/spec/start.rb +30 -0
  39. metadata +97 -0
@@ -0,0 +1,394 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Miso::Image</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Miso::Image</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/miso/factory_rb.html">
59
+ lib/miso/factory.rb
60
+ </a>
61
+ <br />
62
+ <a href="../../files/lib/miso/image_rb.html">
63
+ lib/miso/image.rb
64
+ </a>
65
+ <br />
66
+ </td>
67
+ </tr>
68
+
69
+ <tr class="top-aligned-row">
70
+ <td><strong>Parent:</strong></td>
71
+ <td>
72
+ Object
73
+ </td>
74
+ </tr>
75
+ </table>
76
+ </div>
77
+ <!-- banner header -->
78
+
79
+ <div id="bodyContent">
80
+
81
+
82
+
83
+ <div id="contextContent">
84
+
85
+
86
+
87
+ </div>
88
+
89
+ <div id="method-list">
90
+ <h3 class="section-bar">Methods</h3>
91
+
92
+ <div class="name-list">
93
+ <a href="#M000029">crop</a>&nbsp;&nbsp;
94
+ <a href="#M000034">crop</a>&nbsp;&nbsp;
95
+ <a href="#M000033">crop_fitting</a>&nbsp;&nbsp;
96
+ <a href="#M000036">dimensions</a>&nbsp;&nbsp;
97
+ <a href="#M000031">dimensions</a>&nbsp;&nbsp;
98
+ <a href="#M000027">factory</a>&nbsp;&nbsp;
99
+ <a href="#M000030">fit</a>&nbsp;&nbsp;
100
+ <a href="#M000035">fit</a>&nbsp;&nbsp;
101
+ <a href="#M000028">new</a>&nbsp;&nbsp;
102
+ <a href="#M000032">write</a>&nbsp;&nbsp;
103
+ </div>
104
+ </div>
105
+
106
+ </div>
107
+
108
+
109
+ <!-- if includes -->
110
+
111
+ <div id="section">
112
+
113
+
114
+
115
+
116
+
117
+ <div id="attribute-list">
118
+ <h3 class="section-bar">Attributes</h3>
119
+
120
+ <div class="name-list">
121
+ <table>
122
+ <tr class="top-aligned-row context-row">
123
+ <td class="context-item-name">processor</td>
124
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
125
+ <td class="context-item-desc"></td>
126
+ </tr>
127
+ </table>
128
+ </div>
129
+ </div>
130
+
131
+
132
+
133
+ <!-- if method_list -->
134
+ <div id="methods">
135
+ <h3 class="section-bar">Public Class methods</h3>
136
+
137
+ <div id="method-M000034" class="method-detail">
138
+ <a name="M000034"></a>
139
+
140
+ <div class="method-heading">
141
+ <a href="#M000034" class="method-signature">
142
+ <span class="method-name">crop</span><span class="method-args">(input_file, output_file, width, height, processor_class = nil)</span>
143
+ </a>
144
+ </div>
145
+
146
+ <div class="method-description">
147
+ <p>
148
+ Class shortcut methods
149
+ </p>
150
+ <p><a class="source-toggle" href="#"
151
+ onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
152
+ <div class="method-source-code" id="M000034-source">
153
+ <pre>
154
+ <span class="ruby-comment cmt"># File lib/miso/image.rb, line 39</span>
155
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">crop</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">output_file</span>, <span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>, <span class="ruby-identifier">processor_class</span> = <span class="ruby-keyword kw">nil</span>)
156
+ <span class="ruby-identifier">new</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">processor_class</span>).<span class="ruby-identifier">crop</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>).<span class="ruby-identifier">write</span>(<span class="ruby-identifier">output_file</span>)
157
+ <span class="ruby-keyword kw">end</span>
158
+ </pre>
159
+ </div>
160
+ </div>
161
+ </div>
162
+
163
+ <div id="method-M000036" class="method-detail">
164
+ <a name="M000036"></a>
165
+
166
+ <div class="method-heading">
167
+ <a href="#M000036" class="method-signature">
168
+ <span class="method-name">dimensions</span><span class="method-args">(input_file, processor_class = nil)</span>
169
+ </a>
170
+ </div>
171
+
172
+ <div class="method-description">
173
+ <p><a class="source-toggle" href="#"
174
+ onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
175
+ <div class="method-source-code" id="M000036-source">
176
+ <pre>
177
+ <span class="ruby-comment cmt"># File lib/miso/image.rb, line 47</span>
178
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dimensions</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">processor_class</span> = <span class="ruby-keyword kw">nil</span>)
179
+ <span class="ruby-identifier">new</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">processor_class</span>).<span class="ruby-identifier">dimensions</span>
180
+ <span class="ruby-keyword kw">end</span>
181
+ </pre>
182
+ </div>
183
+ </div>
184
+ </div>
185
+
186
+ <div id="method-M000027" class="method-detail">
187
+ <a name="M000027"></a>
188
+
189
+ <div class="method-heading">
190
+ <a href="#M000027" class="method-signature">
191
+ <span class="method-name">factory</span><span class="method-args">(processor_class = Processor.processor_class)</span>
192
+ </a>
193
+ </div>
194
+
195
+ <div class="method-description">
196
+ <p><a class="source-toggle" href="#"
197
+ onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
198
+ <div class="method-source-code" id="M000027-source">
199
+ <pre>
200
+ <span class="ruby-comment cmt"># File lib/miso/factory.rb, line 3</span>
201
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">factory</span>(<span class="ruby-identifier">processor_class</span> = <span class="ruby-constant">Processor</span>.<span class="ruby-identifier">processor_class</span>)
202
+ <span class="ruby-constant">Factory</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">processor_class</span>)
203
+ <span class="ruby-keyword kw">end</span>
204
+ </pre>
205
+ </div>
206
+ </div>
207
+ </div>
208
+
209
+ <div id="method-M000035" class="method-detail">
210
+ <a name="M000035"></a>
211
+
212
+ <div class="method-heading">
213
+ <a href="#M000035" class="method-signature">
214
+ <span class="method-name">fit</span><span class="method-args">(input_file, output_file, width, height, processor_class = nil)</span>
215
+ </a>
216
+ </div>
217
+
218
+ <div class="method-description">
219
+ <p><a class="source-toggle" href="#"
220
+ onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
221
+ <div class="method-source-code" id="M000035-source">
222
+ <pre>
223
+ <span class="ruby-comment cmt"># File lib/miso/image.rb, line 43</span>
224
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fit</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">output_file</span>, <span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>, <span class="ruby-identifier">processor_class</span> = <span class="ruby-keyword kw">nil</span>)
225
+ <span class="ruby-identifier">new</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">processor_class</span>).<span class="ruby-identifier">fit</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>).<span class="ruby-identifier">write</span>(<span class="ruby-identifier">output_file</span>)
226
+ <span class="ruby-keyword kw">end</span>
227
+ </pre>
228
+ </div>
229
+ </div>
230
+ </div>
231
+
232
+ <div id="method-M000028" class="method-detail">
233
+ <a name="M000028"></a>
234
+
235
+ <div class="method-heading">
236
+ <a href="#M000028" class="method-signature">
237
+ <span class="method-name">new</span><span class="method-args">(input_file, processor_class=nil)</span>
238
+ </a>
239
+ </div>
240
+
241
+ <div class="method-description">
242
+ <p><a class="source-toggle" href="#"
243
+ onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
244
+ <div class="method-source-code" id="M000028-source">
245
+ <pre>
246
+ <span class="ruby-comment cmt"># File lib/miso/image.rb, line 5</span>
247
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">processor_class</span>=<span class="ruby-keyword kw">nil</span>)
248
+ <span class="ruby-identifier">processor_class</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Processor</span>.<span class="ruby-identifier">processor_class</span>
249
+ <span class="ruby-ivar">@processor</span> = <span class="ruby-identifier">processor_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">input_file</span>)
250
+ <span class="ruby-keyword kw">end</span>
251
+ </pre>
252
+ </div>
253
+ </div>
254
+ </div>
255
+
256
+ <h3 class="section-bar">Public Instance methods</h3>
257
+
258
+ <div id="method-M000029" class="method-detail">
259
+ <a name="M000029"></a>
260
+
261
+ <div class="method-heading">
262
+ <a href="#M000029" class="method-signature">
263
+ <span class="method-name">crop</span><span class="method-args">(width, height)</span>
264
+ </a>
265
+ </div>
266
+
267
+ <div class="method-description">
268
+ <p>
269
+ Basic methods
270
+ </p>
271
+ <p><a class="source-toggle" href="#"
272
+ onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
273
+ <div class="method-source-code" id="M000029-source">
274
+ <pre>
275
+ <span class="ruby-comment cmt"># File lib/miso/image.rb, line 12</span>
276
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">crop</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
277
+ <span class="ruby-ivar">@processor</span>.<span class="ruby-identifier">crop</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
278
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>
279
+ <span class="ruby-keyword kw">end</span>
280
+ </pre>
281
+ </div>
282
+ </div>
283
+ </div>
284
+
285
+ <div id="method-M000033" class="method-detail">
286
+ <a name="M000033"></a>
287
+
288
+ <div class="method-heading">
289
+ <a href="#M000033" class="method-signature">
290
+ <span class="method-name">crop_fitting</span><span class="method-args">(width, heigth)</span>
291
+ </a>
292
+ </div>
293
+
294
+ <div class="method-description">
295
+ <p>
296
+ Combined methods
297
+ </p>
298
+ <p><a class="source-toggle" href="#"
299
+ onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
300
+ <div class="method-source-code" id="M000033-source">
301
+ <pre>
302
+ <span class="ruby-comment cmt"># File lib/miso/image.rb, line 33</span>
303
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">crop_fitting</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">heigth</span>)
304
+ <span class="ruby-identifier">fit</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">heigth</span>).<span class="ruby-identifier">crop</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">heigth</span>)
305
+ <span class="ruby-keyword kw">end</span>
306
+ </pre>
307
+ </div>
308
+ </div>
309
+ </div>
310
+
311
+ <div id="method-M000031" class="method-detail">
312
+ <a name="M000031"></a>
313
+
314
+ <div class="method-heading">
315
+ <a href="#M000031" class="method-signature">
316
+ <span class="method-name">dimensions</span><span class="method-args">()</span>
317
+ </a>
318
+ </div>
319
+
320
+ <div class="method-description">
321
+ <p><a class="source-toggle" href="#"
322
+ onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
323
+ <div class="method-source-code" id="M000031-source">
324
+ <pre>
325
+ <span class="ruby-comment cmt"># File lib/miso/image.rb, line 22</span>
326
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dimensions</span>
327
+ <span class="ruby-ivar">@processor</span>.<span class="ruby-identifier">dimensions</span>
328
+ <span class="ruby-keyword kw">end</span>
329
+ </pre>
330
+ </div>
331
+ </div>
332
+ </div>
333
+
334
+ <div id="method-M000030" class="method-detail">
335
+ <a name="M000030"></a>
336
+
337
+ <div class="method-heading">
338
+ <a href="#M000030" class="method-signature">
339
+ <span class="method-name">fit</span><span class="method-args">(width, height)</span>
340
+ </a>
341
+ </div>
342
+
343
+ <div class="method-description">
344
+ <p><a class="source-toggle" href="#"
345
+ onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
346
+ <div class="method-source-code" id="M000030-source">
347
+ <pre>
348
+ <span class="ruby-comment cmt"># File lib/miso/image.rb, line 17</span>
349
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fit</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
350
+ <span class="ruby-ivar">@processor</span>.<span class="ruby-identifier">fit</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
351
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>
352
+ <span class="ruby-keyword kw">end</span>
353
+ </pre>
354
+ </div>
355
+ </div>
356
+ </div>
357
+
358
+ <div id="method-M000032" class="method-detail">
359
+ <a name="M000032"></a>
360
+
361
+ <div class="method-heading">
362
+ <a href="#M000032" class="method-signature">
363
+ <span class="method-name">write</span><span class="method-args">(output_file)</span>
364
+ </a>
365
+ </div>
366
+
367
+ <div class="method-description">
368
+ <p><a class="source-toggle" href="#"
369
+ onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
370
+ <div class="method-source-code" id="M000032-source">
371
+ <pre>
372
+ <span class="ruby-comment cmt"># File lib/miso/image.rb, line 26</span>
373
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">output_file</span>)
374
+ <span class="ruby-ivar">@processor</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">output_file</span>)
375
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">output_file</span>, <span class="ruby-ivar">@processor</span>.<span class="ruby-identifier">class</span>)
376
+ <span class="ruby-keyword kw">end</span>
377
+ </pre>
378
+ </div>
379
+ </div>
380
+ </div>
381
+
382
+
383
+ </div>
384
+
385
+
386
+ </div>
387
+
388
+
389
+ <div id="validator-badges">
390
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
391
+ </div>
392
+
393
+ </body>
394
+ </html>
@@ -0,0 +1,379 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Miso::Processor</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Miso::Processor</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/miso/processor/core_image_rb.html">
59
+ lib/miso/processor/core_image.rb
60
+ </a>
61
+ <br />
62
+ <a href="../../files/lib/miso/processor/image_magick_rb.html">
63
+ lib/miso/processor/image_magick.rb
64
+ </a>
65
+ <br />
66
+ <a href="../../files/lib/miso/processor_rb.html">
67
+ lib/miso/processor.rb
68
+ </a>
69
+ <br />
70
+ </td>
71
+ </tr>
72
+
73
+ <tr class="top-aligned-row">
74
+ <td><strong>Parent:</strong></td>
75
+ <td>
76
+ Object
77
+ </td>
78
+ </tr>
79
+ </table>
80
+ </div>
81
+ <!-- banner header -->
82
+
83
+ <div id="bodyContent">
84
+
85
+
86
+
87
+ <div id="contextContent">
88
+
89
+
90
+
91
+ </div>
92
+
93
+ <div id="method-list">
94
+ <h3 class="section-bar">Methods</h3>
95
+
96
+ <div class="name-list">
97
+ <a href="#M000003">available?</a>&nbsp;&nbsp;
98
+ <a href="#M000005">crop</a>&nbsp;&nbsp;
99
+ <a href="#M000007">dimensions</a>&nbsp;&nbsp;
100
+ <a href="#M000006">fit</a>&nbsp;&nbsp;
101
+ <a href="#M000004">new</a>&nbsp;&nbsp;
102
+ <a href="#M000001">processor_class</a>&nbsp;&nbsp;
103
+ <a href="#M000002">processor_classes</a>&nbsp;&nbsp;
104
+ <a href="#M000008">write</a>&nbsp;&nbsp;
105
+ </div>
106
+ </div>
107
+
108
+ </div>
109
+
110
+
111
+ <!-- if includes -->
112
+
113
+ <div id="section">
114
+
115
+ <div id="class-list">
116
+ <h3 class="section-bar">Classes and Modules</h3>
117
+
118
+ Class <a href="Processor/CoreImage.html" class="link">Miso::Processor::CoreImage</a><br />
119
+ Class <a href="Processor/ImageMagick.html" class="link">Miso::Processor::ImageMagick</a><br />
120
+ Class <a href="Processor/NotImplementedError.html" class="link">Miso::Processor::NotImplementedError</a><br />
121
+
122
+ </div>
123
+
124
+
125
+
126
+
127
+ <div id="attribute-list">
128
+ <h3 class="section-bar">Attributes</h3>
129
+
130
+ <div class="name-list">
131
+ <table>
132
+ <tr class="top-aligned-row context-row">
133
+ <td class="context-item-name">input_file</td>
134
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
135
+ <td class="context-item-desc"></td>
136
+ </tr>
137
+ <tr class="top-aligned-row context-row">
138
+ <td class="context-item-name">processor_class</td>
139
+ <td class="context-item-value">&nbsp;[W]&nbsp;</td>
140
+ <td class="context-item-desc">
141
+ Sets the default processor class.
142
+
143
+ </td>
144
+ </tr>
145
+ <tr class="top-aligned-row context-row">
146
+ <td class="context-item-name">processor_classes</td>
147
+ <td class="context-item-value">&nbsp;[W]&nbsp;</td>
148
+ <td class="context-item-desc">
149
+ Sets the default processor classes list.
150
+
151
+ </td>
152
+ </tr>
153
+ </table>
154
+ </div>
155
+ </div>
156
+
157
+
158
+
159
+ <!-- if method_list -->
160
+ <div id="methods">
161
+ <h3 class="section-bar">Public Class methods</h3>
162
+
163
+ <div id="method-M000003" class="method-detail">
164
+ <a name="M000003"></a>
165
+
166
+ <div class="method-heading">
167
+ <a href="#M000003" class="method-signature">
168
+ <span class="method-name">available?</span><span class="method-args">()</span>
169
+ </a>
170
+ </div>
171
+
172
+ <div class="method-description">
173
+ <p><a class="source-toggle" href="#"
174
+ onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
175
+ <div class="method-source-code" id="M000003-source">
176
+ <pre>
177
+ <span class="ruby-comment cmt"># File lib/miso/processor.rb, line 34</span>
178
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">available?</span>
179
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-node">&quot;The class `#{name}' does not implement ::available?.&quot;</span>
180
+ <span class="ruby-keyword kw">end</span>
181
+ </pre>
182
+ </div>
183
+ </div>
184
+ </div>
185
+
186
+ <div id="method-M000004" class="method-detail">
187
+ <a name="M000004"></a>
188
+
189
+ <div class="method-heading">
190
+ <a href="#M000004" class="method-signature">
191
+ <span class="method-name">new</span><span class="method-args">(input_file)</span>
192
+ </a>
193
+ </div>
194
+
195
+ <div class="method-description">
196
+ <p><a class="source-toggle" href="#"
197
+ onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
198
+ <div class="method-source-code" id="M000004-source">
199
+ <pre>
200
+ <span class="ruby-comment cmt"># File lib/miso/processor.rb, line 41</span>
201
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input_file</span>)
202
+ <span class="ruby-ivar">@input_file</span> = <span class="ruby-identifier">input_file</span>
203
+ <span class="ruby-keyword kw">end</span>
204
+ </pre>
205
+ </div>
206
+ </div>
207
+ </div>
208
+
209
+ <div id="method-M000001" class="method-detail">
210
+ <a name="M000001"></a>
211
+
212
+ <div class="method-heading">
213
+ <a href="#M000001" class="method-signature">
214
+ <span class="method-name">processor_class</span><span class="method-args">()</span>
215
+ </a>
216
+ </div>
217
+
218
+ <div class="method-description">
219
+ <p>
220
+ The default processor class.
221
+ </p>
222
+ <p>
223
+ Returns either the assigned processor, or otherwise finds the first
224
+ processor, that is available on the machine, from the <a
225
+ href="Processor.html#M000002">processor_classes</a> array.
226
+ </p>
227
+ <p><a class="source-toggle" href="#"
228
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
229
+ <div class="method-source-code" id="M000001-source">
230
+ <pre>
231
+ <span class="ruby-comment cmt"># File lib/miso/processor.rb, line 20</span>
232
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">processor_class</span>
233
+ <span class="ruby-ivar">@processor_class</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">processor_classes</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">available?</span> }
234
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;None of the Miso::Processor classes is available.&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@processor_class</span>
235
+ <span class="ruby-ivar">@processor_class</span>
236
+ <span class="ruby-keyword kw">end</span>
237
+ </pre>
238
+ </div>
239
+ </div>
240
+ </div>
241
+
242
+ <div id="method-M000002" class="method-detail">
243
+ <a name="M000002"></a>
244
+
245
+ <div class="method-heading">
246
+ <a href="#M000002" class="method-signature">
247
+ <span class="method-name">processor_classes</span><span class="method-args">()</span>
248
+ </a>
249
+ </div>
250
+
251
+ <div class="method-description">
252
+ <p>
253
+ The list of processor classes.
254
+ </p>
255
+ <p>
256
+ When no explicit <a href="Processor.html#M000001">processor_class</a> is
257
+ set this list is iterated, from first to last, and the first available
258
+ processor on the machine is used.
259
+ </p>
260
+ <p><a class="source-toggle" href="#"
261
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
262
+ <div class="method-source-code" id="M000002-source">
263
+ <pre>
264
+ <span class="ruby-comment cmt"># File lib/miso/processor.rb, line 30</span>
265
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">processor_classes</span>
266
+ <span class="ruby-ivar">@processor_classes</span> <span class="ruby-operator">||=</span> [<span class="ruby-constant">CoreImage</span>, <span class="ruby-constant">ImageMagick</span>]
267
+ <span class="ruby-keyword kw">end</span>
268
+ </pre>
269
+ </div>
270
+ </div>
271
+ </div>
272
+
273
+ <h3 class="section-bar">Public Instance methods</h3>
274
+
275
+ <div id="method-M000005" class="method-detail">
276
+ <a name="M000005"></a>
277
+
278
+ <div class="method-heading">
279
+ <a href="#M000005" class="method-signature">
280
+ <span class="method-name">crop</span><span class="method-args">(width, height)</span>
281
+ </a>
282
+ </div>
283
+
284
+ <div class="method-description">
285
+ <p><a class="source-toggle" href="#"
286
+ onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
287
+ <div class="method-source-code" id="M000005-source">
288
+ <pre>
289
+ <span class="ruby-comment cmt"># File lib/miso/processor.rb, line 45</span>
290
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">crop</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
291
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-node">&quot;The class `#{self.class.name}' does not implement #crop.&quot;</span>
292
+ <span class="ruby-keyword kw">end</span>
293
+ </pre>
294
+ </div>
295
+ </div>
296
+ </div>
297
+
298
+ <div id="method-M000007" class="method-detail">
299
+ <a name="M000007"></a>
300
+
301
+ <div class="method-heading">
302
+ <a href="#M000007" class="method-signature">
303
+ <span class="method-name">dimensions</span><span class="method-args">()</span>
304
+ </a>
305
+ </div>
306
+
307
+ <div class="method-description">
308
+ <p><a class="source-toggle" href="#"
309
+ onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
310
+ <div class="method-source-code" id="M000007-source">
311
+ <pre>
312
+ <span class="ruby-comment cmt"># File lib/miso/processor.rb, line 53</span>
313
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dimensions</span>
314
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-node">&quot;The class `#{self.class.name}' does not implement #dimensions.&quot;</span>
315
+ <span class="ruby-keyword kw">end</span>
316
+ </pre>
317
+ </div>
318
+ </div>
319
+ </div>
320
+
321
+ <div id="method-M000006" class="method-detail">
322
+ <a name="M000006"></a>
323
+
324
+ <div class="method-heading">
325
+ <a href="#M000006" class="method-signature">
326
+ <span class="method-name">fit</span><span class="method-args">(width, height)</span>
327
+ </a>
328
+ </div>
329
+
330
+ <div class="method-description">
331
+ <p><a class="source-toggle" href="#"
332
+ onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
333
+ <div class="method-source-code" id="M000006-source">
334
+ <pre>
335
+ <span class="ruby-comment cmt"># File lib/miso/processor.rb, line 49</span>
336
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fit</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">height</span>)
337
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-node">&quot;The class `#{self.class.name}' does not implement #fit.&quot;</span>
338
+ <span class="ruby-keyword kw">end</span>
339
+ </pre>
340
+ </div>
341
+ </div>
342
+ </div>
343
+
344
+ <div id="method-M000008" class="method-detail">
345
+ <a name="M000008"></a>
346
+
347
+ <div class="method-heading">
348
+ <a href="#M000008" class="method-signature">
349
+ <span class="method-name">write</span><span class="method-args">(output_file)</span>
350
+ </a>
351
+ </div>
352
+
353
+ <div class="method-description">
354
+ <p><a class="source-toggle" href="#"
355
+ onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
356
+ <div class="method-source-code" id="M000008-source">
357
+ <pre>
358
+ <span class="ruby-comment cmt"># File lib/miso/processor.rb, line 57</span>
359
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">output_file</span>)
360
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-node">&quot;The class `#{self.class.name}' does not implement #write.&quot;</span>
361
+ <span class="ruby-keyword kw">end</span>
362
+ </pre>
363
+ </div>
364
+ </div>
365
+ </div>
366
+
367
+
368
+ </div>
369
+
370
+
371
+ </div>
372
+
373
+
374
+ <div id="validator-badges">
375
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
376
+ </div>
377
+
378
+ </body>
379
+ </html>