rrtf 0.1.2 → 1.0.0
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 +4 -4
- data/.byebug_history +6 -3
- data/CHANGELOG.md +24 -0
- data/README.md +194 -84
- data/documentation/RRTF.html +5 -5
- data/documentation/RRTF/AnonymousStyle.html +792 -0
- data/documentation/RRTF/BorderFormatting.html +821 -0
- data/documentation/RRTF/BorderStyle.html +493 -0
- data/documentation/RRTF/CharacterFormatting.html +293 -162
- data/documentation/RRTF/CharacterStyle.html +53 -109
- data/documentation/RRTF/Colour.html +61 -1
- data/documentation/RRTF/ColourTable.html +52 -52
- data/documentation/RRTF/CommandNode.html +367 -971
- data/documentation/RRTF/ContainerNode.html +44 -44
- data/documentation/RRTF/Converters.html +1 -1
- data/documentation/RRTF/Converters/HTML.html +1 -1
- data/documentation/RRTF/Converters/HTML/Helpers.html +1 -1
- data/documentation/RRTF/Converters/HTML/Node.html +1 -1
- data/documentation/RRTF/Converters/HTML/NodeSet.html +1 -1
- data/documentation/RRTF/Document.html +267 -255
- data/documentation/RRTF/DocumentFormatting.html +833 -0
- data/documentation/RRTF/DocumentProperties.html +444 -0
- data/documentation/RRTF/Font.html +1 -1
- data/documentation/RRTF/FontTable.html +1 -1
- data/documentation/RRTF/FooterNode.html +16 -16
- data/documentation/RRTF/GeometryNode.html +774 -0
- data/documentation/RRTF/GeometryProperties.html +1014 -0
- data/documentation/RRTF/HeaderNode.html +16 -16
- data/documentation/RRTF/ImageNode.html +705 -492
- data/documentation/RRTF/Information.html +1 -1
- data/documentation/RRTF/LinkNode.html +10 -10
- data/documentation/RRTF/ListLevel.html +1 -1
- data/documentation/RRTF/ListLevelNode.html +37 -37
- data/documentation/RRTF/ListMarker.html +1 -1
- data/documentation/RRTF/ListNode.html +19 -19
- data/documentation/RRTF/ListTable.html +1 -1
- data/documentation/RRTF/ListTemplate.html +1 -1
- data/documentation/RRTF/ListTextNode.html +14 -14
- data/documentation/RRTF/Node.html +26 -26
- data/documentation/RRTF/Page.html +129 -0
- data/documentation/RRTF/Page/Margin.html +1158 -0
- data/documentation/RRTF/Page/Size.html +946 -0
- data/documentation/RRTF/PageFormatting.html +954 -0
- data/documentation/RRTF/ParagraphFormatting.html +338 -56
- data/documentation/RRTF/ParagraphNode.html +10 -10
- data/documentation/RRTF/ParagraphStyle.html +72 -111
- data/documentation/RRTF/PositionFormatting.html +780 -0
- data/documentation/RRTF/PositionStyle.html +424 -0
- data/documentation/RRTF/Properties.html +243 -0
- data/documentation/RRTF/RTFError.html +21 -10
- data/documentation/RRTF/ShadingFormatting.html +712 -0
- data/documentation/RRTF/ShadingStyle.html +424 -0
- data/documentation/RRTF/Style.html +284 -697
- data/documentation/RRTF/Stylesheet.html +36 -3
- data/documentation/RRTF/TableCellNode.html +131 -131
- data/documentation/RRTF/TableNode.html +82 -82
- data/documentation/RRTF/TableRowNode.html +53 -53
- data/documentation/RRTF/TextNode.html +46 -46
- data/documentation/RRTF/Utilities.html +837 -17
- data/documentation/_index.html +139 -6
- data/documentation/class_list.html +1 -1
- data/documentation/file.README.html +218 -87
- data/documentation/index.html +218 -87
- data/documentation/method_list.html +631 -391
- data/documentation/top-level-namespace.html +1 -1
- data/examples/01.rtf +947 -20
- data/examples/01_everything.rb +176 -0
- data/examples/02.rtf +13 -0
- data/examples/02_basic_paragraph.rb +10 -0
- data/examples/03.rtf +20 -0
- data/examples/03_paragraph_inline_style.rb +14 -0
- data/examples/04.rtf +21 -0
- data/examples/04_paragraph_with_character_style.rb +18 -0
- data/examples/05.rtf +21 -0
- data/examples/05_hyperlinks.rb +21 -0
- data/examples/06.rtf +21 -0
- data/examples/06_basic_list.rb +21 -0
- data/examples/07.rtf +28 -0
- data/examples/07_nested_list.rb +27 -0
- data/examples/08.rtf +807 -0
- data/examples/08_images.rb +17 -0
- data/examples/09.rtf +84 -0
- data/examples/09_shapes.rb +56 -0
- data/examples/10.rtf +34 -0
- data/examples/10_stylesheet.rb +18 -0
- data/examples/resources/images/redshirt.png +0 -0
- data/examples/resources/images/redshirts.jpg +0 -0
- data/examples/resources/json/redshirt_styles.json +72 -8
- data/examples/~$01.rtf +0 -0
- data/lib/rrtf.rb +4 -16
- data/lib/rrtf/colour.rb +8 -0
- data/lib/rrtf/formatting.rb +988 -0
- data/lib/rrtf/node.rb +17 -1851
- data/lib/rrtf/node/command_node.rb +242 -0
- data/lib/rrtf/node/container_node.rb +75 -0
- data/lib/rrtf/node/document.rb +339 -0
- data/lib/rrtf/node/footer_node.rb +47 -0
- data/lib/rrtf/node/geometry_node.rb +65 -0
- data/lib/rrtf/node/header_node.rb +47 -0
- data/lib/rrtf/node/image_node.rb +175 -0
- data/lib/rrtf/node/link_node.rb +10 -0
- data/lib/rrtf/node/list_level_node.rb +44 -0
- data/lib/rrtf/node/list_node.rb +30 -0
- data/lib/rrtf/node/list_text_node.rb +22 -0
- data/lib/rrtf/node/node.rb +53 -0
- data/lib/rrtf/node/paragraph_node.rb +11 -0
- data/lib/rrtf/node/table_cell_node.rb +233 -0
- data/lib/rrtf/node/table_node.rb +136 -0
- data/lib/rrtf/node/table_row_node.rb +92 -0
- data/lib/rrtf/node/text_node.rb +76 -0
- data/lib/rrtf/page.rb +7 -0
- data/lib/rrtf/page/margin.rb +98 -0
- data/lib/rrtf/page/size.rb +98 -0
- data/lib/rrtf/properties.rb +3 -0
- data/lib/rrtf/properties/document_properties.rb +34 -0
- data/lib/rrtf/properties/geometry_properties.rb +380 -0
- data/lib/rrtf/properties/properties.rb +13 -0
- data/lib/rrtf/style.rb +4 -5
- data/lib/rrtf/style/anonymous_style.rb +73 -0
- data/lib/rrtf/style/border_style.rb +27 -0
- data/lib/rrtf/style/character_style.rb +1 -7
- data/lib/rrtf/style/paragraph_style.rb +0 -6
- data/lib/rrtf/style/position_style.rb +26 -0
- data/lib/rrtf/style/shading_style.rb +26 -0
- data/lib/rrtf/style/style.rb +60 -101
- data/lib/rrtf/utilities.rb +138 -0
- data/lib/rrtf/version.rb +1 -1
- data/rrtf.gemspec +1 -0
- metadata +85 -10
- data/examples/01_mac_libreoffice5_2_3_3.png +0 -0
- data/examples/01_mac_pages6_2.png +0 -0
- data/examples/01_mac_textedit1_12.png +0 -0
- data/examples/01_mac_word15_36.png +0 -0
- data/examples/01_styles_and_paragraphs.rb +0 -32
- data/lib/rrtf/paper.rb +0 -53
- data/lib/rrtf/style/document_style.rb +0 -116
- data/lib/rrtf/style/formatting.rb +0 -320
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
|
|
101
101
|
<dl>
|
|
102
102
|
<dt>Defined in:</dt>
|
|
103
|
-
<dd>lib/rrtf/node.rb</dd>
|
|
103
|
+
<dd>lib/rrtf/node/header_node.rb</dd>
|
|
104
104
|
</dl>
|
|
105
105
|
|
|
106
106
|
</div>
|
|
@@ -311,7 +311,7 @@ class to prevent footnotes being added to headers.</p>
|
|
|
311
311
|
|
|
312
312
|
|
|
313
313
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="CommandNode.html" title="RRTF::CommandNode (class)">CommandNode</a></span></h3>
|
|
314
|
-
<p class="inherited"><span class='object_link'><a href="CommandNode.html#<<-instance_method" title="RRTF::CommandNode#<< (method)">#<<</a></span>, <span class='object_link'><a href="CommandNode.html#apply-instance_method" title="RRTF::CommandNode#apply (method)">#apply</a></span>, <span class='object_link'><a href="CommandNode.html#
|
|
314
|
+
<p class="inherited"><span class='object_link'><a href="CommandNode.html#<<-instance_method" title="RRTF::CommandNode#<< (method)">#<<</a></span>, <span class='object_link'><a href="CommandNode.html#apply-instance_method" title="RRTF::CommandNode#apply (method)">#apply</a></span>, <span class='object_link'><a href="CommandNode.html#geometry-instance_method" title="RRTF::CommandNode#geometry (method)">#geometry</a></span>, <span class='object_link'><a href="CommandNode.html#image-instance_method" title="RRTF::CommandNode#image (method)">#image</a></span>, <span class='object_link'><a href="CommandNode.html#line_break-instance_method" title="RRTF::CommandNode#line_break (method)">#line_break</a></span>, <span class='object_link'><a href="CommandNode.html#link-instance_method" title="RRTF::CommandNode#link (method)">#link</a></span>, <span class='object_link'><a href="CommandNode.html#list-instance_method" title="RRTF::CommandNode#list (method)">#list</a></span>, <span class='object_link'><a href="CommandNode.html#paragraph-instance_method" title="RRTF::CommandNode#paragraph (method)">#paragraph</a></span>, <span class='object_link'><a href="CommandNode.html#table-instance_method" title="RRTF::CommandNode#table (method)">#table</a></span>, <span class='object_link'><a href="CommandNode.html#to_rtf-instance_method" title="RRTF::CommandNode#to_rtf (method)">#to_rtf</a></span></p>
|
|
315
315
|
|
|
316
316
|
|
|
317
317
|
|
|
@@ -374,13 +374,13 @@ HeaderNode::UNIVERSAL.</p>
|
|
|
374
374
|
<pre class="lines">
|
|
375
375
|
|
|
376
376
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
377
|
+
30
|
|
378
|
+
31
|
|
379
|
+
32
|
|
380
|
+
33</pre>
|
|
381
381
|
</td>
|
|
382
382
|
<td>
|
|
383
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
383
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/header_node.rb', line 30</span>
|
|
384
384
|
|
|
385
385
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_document'>document</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='op'>=</span><span class='const'>UNIVERSAL</span><span class='rparen'>)</span>
|
|
386
386
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_document'>document</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_id2name'>id2name</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|
@@ -424,12 +424,12 @@ HeaderNode::UNIVERSAL.</p>
|
|
|
424
424
|
<pre class="lines">
|
|
425
425
|
|
|
426
426
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
17
|
|
428
|
+
18
|
|
429
|
+
19</pre>
|
|
430
430
|
</td>
|
|
431
431
|
<td>
|
|
432
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
432
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/header_node.rb', line 17</span>
|
|
433
433
|
|
|
434
434
|
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
|
|
435
435
|
<span class='ivar'>@type</span>
|
|
@@ -485,12 +485,12 @@ class to prevent footnotes being added to headers.</p>
|
|
|
485
485
|
<pre class="lines">
|
|
486
486
|
|
|
487
487
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
488
|
+
43
|
|
489
|
+
44
|
|
490
|
+
45</pre>
|
|
491
491
|
</td>
|
|
492
492
|
<td>
|
|
493
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
493
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/header_node.rb', line 43</span>
|
|
494
494
|
|
|
495
495
|
<span class='kw'>def</span> <span class='id identifier rubyid_footnote'>footnote</span><span class='lparen'>(</span><span class='id identifier rubyid_text'>text</span><span class='rparen'>)</span>
|
|
496
496
|
<span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Footnotes are not permitted in page headers.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
@@ -505,7 +505,7 @@ class to prevent footnotes being added to headers.</p>
|
|
|
505
505
|
</div>
|
|
506
506
|
|
|
507
507
|
<div id="footer">
|
|
508
|
-
Generated on Mon Jul
|
|
508
|
+
Generated on Mon Jul 31 21:49:00 2017 by
|
|
509
509
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
510
510
|
0.9.9 (ruby-2.3.3).
|
|
511
511
|
</div>
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
|
|
97
97
|
<dl>
|
|
98
98
|
<dt>Defined in:</dt>
|
|
99
|
-
<dd>lib/rrtf/node.rb</dd>
|
|
99
|
+
<dd>lib/rrtf/node/image_node.rb</dd>
|
|
100
100
|
</dl>
|
|
101
101
|
|
|
102
102
|
</div>
|
|
@@ -113,109 +113,127 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
113
113
|
</div>
|
|
114
114
|
<div class="tags">
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</div>
|
|
116
|
+
<p class="tag_title">Author:</p>
|
|
117
|
+
<ul class="author">
|
|
118
|
+
|
|
119
|
+
<li>
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
<div class='inline'>
|
|
126
|
+
<p>Peter Wood</p>
|
|
129
127
|
</div>
|
|
130
|
-
|
|
128
|
+
|
|
129
|
+
</li>
|
|
131
130
|
|
|
132
|
-
|
|
131
|
+
<li>
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<div class='inline'>
|
|
138
|
+
<p>Wesley Hileman</p>
|
|
133
139
|
</div>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
|
|
141
|
+
</li>
|
|
142
|
+
|
|
143
|
+
</ul>
|
|
144
|
+
<p class="tag_title">Since:</p>
|
|
145
|
+
<ul class="since">
|
|
146
|
+
|
|
147
|
+
<li>
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
<div class='inline'>
|
|
154
|
+
<p>legacy</p>
|
|
145
155
|
</div>
|
|
146
|
-
|
|
156
|
+
|
|
157
|
+
</li>
|
|
147
158
|
|
|
159
|
+
</ul>
|
|
148
160
|
|
|
149
161
|
</div>
|
|
150
|
-
|
|
151
|
-
|
|
162
|
+
<h2>Constant Summary</h2>
|
|
163
|
+
<dl class="constants">
|
|
152
164
|
|
|
153
|
-
<dt id="
|
|
165
|
+
<dt id="TYPE_DICTIONARY-constant" class="">TYPE_DICTIONARY =
|
|
154
166
|
<div class="docstring">
|
|
155
167
|
<div class="discussion">
|
|
156
168
|
|
|
157
|
-
<p>
|
|
169
|
+
<p>Supported image types.</p>
|
|
158
170
|
|
|
159
171
|
|
|
160
172
|
</div>
|
|
161
173
|
</div>
|
|
162
174
|
<div class="tags">
|
|
163
175
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
</div>
|
|
176
|
+
<p class="tag_title">Since:</p>
|
|
177
|
+
<ul class="since">
|
|
178
|
+
|
|
179
|
+
<li>
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
<div class='inline'>
|
|
186
|
+
<p>legacy</p>
|
|
177
187
|
</div>
|
|
178
|
-
|
|
188
|
+
|
|
189
|
+
</li>
|
|
179
190
|
|
|
191
|
+
</ul>
|
|
180
192
|
|
|
181
193
|
</div>
|
|
182
194
|
</dt>
|
|
183
|
-
<dd><pre class="code"><span class='
|
|
195
|
+
<dd><pre class="code"><span class='lbrace'>{</span>
|
|
196
|
+
<span class='symbol'>:png</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>pngblip</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
|
197
|
+
<span class='symbol'>:jpeg</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>jpegblip</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
|
198
|
+
<span class='symbol'>:bmp</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dibitmap0</span><span class='tstring_end'>'</span></span> <span class='comment'># device independent bitmap
|
|
199
|
+
</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
184
200
|
|
|
185
|
-
<dt id="
|
|
201
|
+
<dt id="SIZING_MODE_DICTIONARY-constant" class="">SIZING_MODE_DICTIONARY =
|
|
186
202
|
<div class="docstring">
|
|
187
203
|
<div class="discussion">
|
|
188
204
|
|
|
189
|
-
<p>
|
|
205
|
+
<p>Supported sizing modes.</p>
|
|
190
206
|
|
|
191
207
|
|
|
192
208
|
</div>
|
|
193
209
|
</div>
|
|
194
210
|
<div class="tags">
|
|
195
211
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
</div>
|
|
212
|
+
<p class="tag_title">Since:</p>
|
|
213
|
+
<ul class="since">
|
|
214
|
+
|
|
215
|
+
<li>
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
<div class='inline'>
|
|
222
|
+
<p>legacy</p>
|
|
209
223
|
</div>
|
|
210
|
-
|
|
224
|
+
|
|
225
|
+
</li>
|
|
211
226
|
|
|
227
|
+
</ul>
|
|
212
228
|
|
|
213
229
|
</div>
|
|
214
230
|
</dt>
|
|
215
231
|
<dd><pre class="code"><span class='lbrace'>{</span>
|
|
216
|
-
<span class='
|
|
217
|
-
<span class='
|
|
218
|
-
<span class='
|
|
232
|
+
<span class='comment'># Size the image absolutely according to the given width and height.
|
|
233
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ABSOLUTE</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ABSOLUTE</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
|
234
|
+
<span class='comment'># Fit the image in the box specified by the given width and height,
|
|
235
|
+
</span> <span class='comment'># preserving the aspect ratio.
|
|
236
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FIX_ASPECT_RATIO</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>FIX_ASPECT_RATIO</span><span class='tstring_end'>"</span></span>
|
|
219
237
|
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
220
238
|
|
|
221
239
|
</dl>
|
|
@@ -229,7 +247,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
229
247
|
<li class="public ">
|
|
230
248
|
<span class="summary_signature">
|
|
231
249
|
|
|
232
|
-
<a href="#
|
|
250
|
+
<a href="#border-instance_method" title="#border (instance method)">#<strong>border</strong> ⇒ Object </a>
|
|
233
251
|
|
|
234
252
|
|
|
235
253
|
|
|
@@ -246,9 +264,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
246
264
|
|
|
247
265
|
|
|
248
266
|
|
|
249
|
-
<span class="summary_desc"><div class='inline'>
|
|
250
|
-
<p>Attribute accessor.</p>
|
|
251
|
-
</div></span>
|
|
267
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
252
268
|
|
|
253
269
|
</li>
|
|
254
270
|
|
|
@@ -273,9 +289,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
273
289
|
|
|
274
290
|
|
|
275
291
|
|
|
276
|
-
<span class="summary_desc"><div class='inline'>
|
|
277
|
-
<p>Attribute accessor.</p>
|
|
278
|
-
</div></span>
|
|
292
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
279
293
|
|
|
280
294
|
</li>
|
|
281
295
|
|
|
@@ -300,9 +314,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
300
314
|
|
|
301
315
|
|
|
302
316
|
|
|
303
|
-
<span class="summary_desc"><div class='inline'>
|
|
304
|
-
<p>Attribute accessor.</p>
|
|
305
|
-
</div></span>
|
|
317
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
306
318
|
|
|
307
319
|
</li>
|
|
308
320
|
|
|
@@ -329,9 +341,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
329
341
|
|
|
330
342
|
|
|
331
343
|
|
|
332
|
-
<span class="summary_desc"><div class='inline'>
|
|
333
|
-
<p>Attribute accessor.</p>
|
|
334
|
-
</div></span>
|
|
344
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
335
345
|
|
|
336
346
|
</li>
|
|
337
347
|
|
|
@@ -339,7 +349,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
339
349
|
<li class="public ">
|
|
340
350
|
<span class="summary_signature">
|
|
341
351
|
|
|
342
|
-
<a href="#
|
|
352
|
+
<a href="#sizing_mode-instance_method" title="#sizing_mode (instance method)">#<strong>sizing_mode</strong> ⇒ Object </a>
|
|
343
353
|
|
|
344
354
|
|
|
345
355
|
|
|
@@ -356,9 +366,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
356
366
|
|
|
357
367
|
|
|
358
368
|
|
|
359
|
-
<span class="summary_desc"><div class='inline'>
|
|
360
|
-
<p>Attribute accessor.</p>
|
|
361
|
-
</div></span>
|
|
369
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
362
370
|
|
|
363
371
|
</li>
|
|
364
372
|
|
|
@@ -366,7 +374,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
366
374
|
<li class="public ">
|
|
367
375
|
<span class="summary_signature">
|
|
368
376
|
|
|
369
|
-
<a href="#
|
|
377
|
+
<a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> ⇒ Object </a>
|
|
370
378
|
|
|
371
379
|
|
|
372
380
|
|
|
@@ -375,6 +383,8 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
375
383
|
|
|
376
384
|
|
|
377
385
|
|
|
386
|
+
<span class="note title readonly">readonly</span>
|
|
387
|
+
|
|
378
388
|
|
|
379
389
|
|
|
380
390
|
|
|
@@ -383,9 +393,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
383
393
|
|
|
384
394
|
|
|
385
395
|
|
|
386
|
-
<span class="summary_desc"><div class='inline'>
|
|
387
|
-
<p>Attribute accessor.</p>
|
|
388
|
-
</div></span>
|
|
396
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
389
397
|
|
|
390
398
|
</li>
|
|
391
399
|
|
|
@@ -393,7 +401,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
393
401
|
<li class="public ">
|
|
394
402
|
<span class="summary_signature">
|
|
395
403
|
|
|
396
|
-
<a href="#
|
|
404
|
+
<a href="#width-instance_method" title="#width (instance method)">#<strong>width</strong> ⇒ Object </a>
|
|
397
405
|
|
|
398
406
|
|
|
399
407
|
|
|
@@ -402,6 +410,8 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
402
410
|
|
|
403
411
|
|
|
404
412
|
|
|
413
|
+
<span class="note title readonly">readonly</span>
|
|
414
|
+
|
|
405
415
|
|
|
406
416
|
|
|
407
417
|
|
|
@@ -410,46 +420,33 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
410
420
|
|
|
411
421
|
|
|
412
422
|
|
|
413
|
-
<span class="summary_desc"><div class='inline'>
|
|
414
|
-
<p>Attribute accessor.</p>
|
|
415
|
-
</div></span>
|
|
423
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
416
424
|
|
|
417
425
|
</li>
|
|
418
426
|
|
|
419
427
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
<a href="#width-instance_method" title="#width (instance method)">#<strong>width</strong> ⇒ Object </a>
|
|
424
|
-
|
|
428
|
+
</ul>
|
|
429
|
+
|
|
430
|
+
|
|
425
431
|
|
|
426
|
-
|
|
427
|
-
</span>
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
<span class="note title readonly">readonly</span>
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
432
|
|
|
439
433
|
|
|
434
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="RRTF::Node (class)">Node</a></span></h3>
|
|
435
|
+
<p class="inherited"><span class='object_link'><a href="Node.html#parent-instance_method" title="RRTF::Node#parent (method)">#parent</a></span></p>
|
|
436
|
+
|
|
440
437
|
|
|
441
438
|
|
|
442
|
-
<
|
|
443
|
-
|
|
444
|
-
</
|
|
445
|
-
|
|
446
|
-
</li>
|
|
439
|
+
<h2>
|
|
440
|
+
Class Method Summary
|
|
441
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
442
|
+
</h2>
|
|
447
443
|
|
|
448
|
-
|
|
449
|
-
|
|
444
|
+
<ul class="summary">
|
|
445
|
+
|
|
446
|
+
<li class="public ">
|
|
450
447
|
<span class="summary_signature">
|
|
451
448
|
|
|
452
|
-
<a href="#
|
|
449
|
+
<a href="#inspect-class_method" title="inspect (class method)">.<strong>inspect</strong>(source) ⇒ Array<Object> </a>
|
|
453
450
|
|
|
454
451
|
|
|
455
452
|
|
|
@@ -457,9 +454,6 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
457
454
|
|
|
458
455
|
|
|
459
456
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
457
|
|
|
464
458
|
|
|
465
459
|
|
|
@@ -467,16 +461,17 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
467
461
|
|
|
468
462
|
|
|
469
463
|
<span class="summary_desc"><div class='inline'>
|
|
470
|
-
<p>
|
|
464
|
+
<p>Attempts to extract the type, width, and height of an image using
|
|
465
|
+
FastImage.</p>
|
|
471
466
|
</div></span>
|
|
472
467
|
|
|
473
468
|
</li>
|
|
474
469
|
|
|
475
|
-
|
|
476
|
-
|
|
470
|
+
|
|
471
|
+
<li class="public ">
|
|
477
472
|
<span class="summary_signature">
|
|
478
473
|
|
|
479
|
-
<a href="#
|
|
474
|
+
<a href="#parse_border_array-class_method" title="parse_border_array (class method)">.<strong>parse_border_array</strong>(border) ⇒ Object </a>
|
|
480
475
|
|
|
481
476
|
|
|
482
477
|
|
|
@@ -484,9 +479,6 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
484
479
|
|
|
485
480
|
|
|
486
481
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
482
|
|
|
491
483
|
|
|
492
484
|
|
|
@@ -494,22 +486,13 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
494
486
|
|
|
495
487
|
|
|
496
488
|
<span class="summary_desc"><div class='inline'>
|
|
497
|
-
<p>
|
|
489
|
+
<p>inspect().</p>
|
|
498
490
|
</div></span>
|
|
499
491
|
|
|
500
492
|
</li>
|
|
501
493
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="RRTF::Node (class)">Node</a></span></h3>
|
|
510
|
-
<p class="inherited"><span class='object_link'><a href="Node.html#parent-instance_method" title="RRTF::Node#parent (method)">#parent</a></span></p>
|
|
511
|
-
|
|
512
|
-
|
|
494
|
+
|
|
495
|
+
</ul>
|
|
513
496
|
|
|
514
497
|
<h2>
|
|
515
498
|
Instance Method Summary
|
|
@@ -521,7 +504,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
521
504
|
<li class="public ">
|
|
522
505
|
<span class="summary_signature">
|
|
523
506
|
|
|
524
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(parent, source, id) ⇒ ImageNode </a>
|
|
507
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(parent, source, id, options = {}) ⇒ ImageNode </a>
|
|
525
508
|
|
|
526
509
|
|
|
527
510
|
|
|
@@ -541,30 +524,6 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
541
524
|
<p>This is the constructor for the ImageNode class.</p>
|
|
542
525
|
</div></span>
|
|
543
526
|
|
|
544
|
-
</li>
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
<li class="public ">
|
|
548
|
-
<span class="summary_signature">
|
|
549
|
-
|
|
550
|
-
<a href="#read_source-instance_method" title="#read_source (instance method)">#<strong>read_source</strong>(file, read, size = nil) ⇒ Object </a>
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
</span>
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
<span class="summary_desc"><div class='inline'>
|
|
565
|
-
<p>This method loads the data for an image from its source.</p>
|
|
566
|
-
</div></span>
|
|
567
|
-
|
|
568
527
|
</li>
|
|
569
528
|
|
|
570
529
|
|
|
@@ -612,7 +571,7 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
612
571
|
<div class="method_details first">
|
|
613
572
|
<h3 class="signature first" id="initialize-instance_method">
|
|
614
573
|
|
|
615
|
-
#<strong>initialize</strong>(parent, source, id) ⇒ <tt><span class='object_link'><a href="" title="RRTF::ImageNode (class)">ImageNode</a></span></tt>
|
|
574
|
+
#<strong>initialize</strong>(parent, source, id, options = {}) ⇒ <tt><span class='object_link'><a href="" title="RRTF::ImageNode (class)">ImageNode</a></span></tt>
|
|
616
575
|
|
|
617
576
|
|
|
618
577
|
|
|
@@ -623,32 +582,182 @@ identify the file type but these are not guaranteed to work.</p>
|
|
|
623
582
|
|
|
624
583
|
<p>This is the constructor for the ImageNode class.</p>
|
|
625
584
|
|
|
626
|
-
<h4 id="label-Parameters">Parameters</h4>
|
|
627
|
-
<dl class="rdoc-list note-list"><dt>parent
|
|
628
|
-
<dd>
|
|
629
|
-
<p>A reference to the node that owns the new image node.</p>
|
|
630
|
-
</dd><dt>source
|
|
631
|
-
<dd>
|
|
632
|
-
<p>A reference to the image source. This must be a String or a File.</p>
|
|
633
|
-
</dd><dt>id
|
|
634
|
-
<dd>
|
|
635
|
-
<p>The unique identifier for the image node.</p>
|
|
636
|
-
</dd></dl>
|
|
637
|
-
|
|
638
|
-
<h4 id="label-Exceptions">Exceptions</h4>
|
|
639
|
-
<dl class="rdoc-list note-list"><dt>RTFError
|
|
640
|
-
<dd>
|
|
641
|
-
<p>Generated whenever the image specified is not recognised as a supported
|
|
642
|
-
image type, something other than a String or File or IO is passed as the
|
|
643
|
-
source parameter or if the specified source does not exist or cannot be
|
|
644
|
-
accessed.</p>
|
|
645
|
-
</dd></dl>
|
|
646
|
-
|
|
647
585
|
|
|
648
586
|
</div>
|
|
649
587
|
</div>
|
|
650
588
|
<div class="tags">
|
|
589
|
+
<p class="tag_title">Parameters:</p>
|
|
590
|
+
<ul class="param">
|
|
591
|
+
|
|
592
|
+
<li>
|
|
593
|
+
|
|
594
|
+
<span class='name'>parent</span>
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
<span class='type'>(<tt><span class='object_link'><a href="Node.html" title="RRTF::Node (class)">Node</a></span></tt>)</span>
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
—
|
|
602
|
+
<div class='inline'>
|
|
603
|
+
<p>a reference to the node that owns the new image node.</p>
|
|
604
|
+
</div>
|
|
605
|
+
|
|
606
|
+
</li>
|
|
651
607
|
|
|
608
|
+
<li>
|
|
609
|
+
|
|
610
|
+
<span class='name'>source</span>
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
<span class='type'>(<tt>String</tt>, <tt>File</tt>)</span>
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
—
|
|
618
|
+
<div class='inline'>
|
|
619
|
+
<p>a reference to the image source; this must be a String or a File.</p>
|
|
620
|
+
</div>
|
|
621
|
+
|
|
622
|
+
</li>
|
|
623
|
+
|
|
624
|
+
<li>
|
|
625
|
+
|
|
626
|
+
<span class='name'>id</span>
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
—
|
|
634
|
+
<div class='inline'>
|
|
635
|
+
<p>a unique 32-bit identifier for the image.</p>
|
|
636
|
+
</div>
|
|
637
|
+
|
|
638
|
+
</li>
|
|
639
|
+
|
|
640
|
+
<li>
|
|
641
|
+
|
|
642
|
+
<span class='name'>options</span>
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
—
|
|
652
|
+
<div class='inline'>
|
|
653
|
+
<p>a hash of options.</p>
|
|
654
|
+
</div>
|
|
655
|
+
|
|
656
|
+
</li>
|
|
657
|
+
|
|
658
|
+
</ul>
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
<p class="tag_title">Options Hash (<tt>options</tt>):</p>
|
|
670
|
+
<ul class="option">
|
|
671
|
+
|
|
672
|
+
<li>
|
|
673
|
+
<span class="name">"width"</span>
|
|
674
|
+
<span class="type">(<tt>String</tt>)</span>
|
|
675
|
+
<span class="default">
|
|
676
|
+
|
|
677
|
+
— default:
|
|
678
|
+
<tt>nil</tt>
|
|
679
|
+
|
|
680
|
+
</span>
|
|
681
|
+
|
|
682
|
+
— <div class='inline'>
|
|
683
|
+
<p>the display width of the image in twips (can be a string, see
|
|
684
|
+
<span class='object_link'><a href="Utilities.html#value2twips-class_method" title="RRTF::Utilities.value2twips (method)">Utilities.value2twips</a></span>).</p>
|
|
685
|
+
</div>
|
|
686
|
+
|
|
687
|
+
</li>
|
|
688
|
+
|
|
689
|
+
<li>
|
|
690
|
+
<span class="name">"height"</span>
|
|
691
|
+
<span class="type">(<tt>String</tt>)</span>
|
|
692
|
+
<span class="default">
|
|
693
|
+
|
|
694
|
+
— default:
|
|
695
|
+
<tt>nil</tt>
|
|
696
|
+
|
|
697
|
+
</span>
|
|
698
|
+
|
|
699
|
+
— <div class='inline'>
|
|
700
|
+
<p>the display height of the image in twips (can be a string, see
|
|
701
|
+
<span class='object_link'><a href="Utilities.html#value2twips-class_method" title="RRTF::Utilities.value2twips (method)">Utilities.value2twips</a></span>).</p>
|
|
702
|
+
</div>
|
|
703
|
+
|
|
704
|
+
</li>
|
|
705
|
+
|
|
706
|
+
<li>
|
|
707
|
+
<span class="name">"sizing_mode"</span>
|
|
708
|
+
<span class="type">(<tt>String</tt>)</span>
|
|
709
|
+
<span class="default">
|
|
710
|
+
|
|
711
|
+
— default:
|
|
712
|
+
<tt>"ABSOLUTE"</tt>
|
|
713
|
+
|
|
714
|
+
</span>
|
|
715
|
+
|
|
716
|
+
— <div class='inline'>
|
|
717
|
+
<p>the method used to size the image (see <span class='object_link'><a href="#SIZING_MODE_DICTIONARY-constant" title="RRTF::ImageNode::SIZING_MODE_DICTIONARY (constant)">SIZING_MODE_DICTIONARY</a></span>).</p>
|
|
718
|
+
</div>
|
|
719
|
+
|
|
720
|
+
</li>
|
|
721
|
+
|
|
722
|
+
</ul>
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
<p class="tag_title">Raises:</p>
|
|
726
|
+
<ul class="raise">
|
|
727
|
+
|
|
728
|
+
<li>
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
<span class='type'>(<tt><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></tt>)</span>
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
—
|
|
736
|
+
<div class='inline'>
|
|
737
|
+
<p>whenever the image specified is not recognised as a supported image type,
|
|
738
|
+
something other than a String or File or IO is passed as the source
|
|
739
|
+
parameter or if the specified source does not exist or cannot be accessed.</p>
|
|
740
|
+
</div>
|
|
741
|
+
|
|
742
|
+
</li>
|
|
743
|
+
|
|
744
|
+
</ul>
|
|
745
|
+
<p class="tag_title">Since:</p>
|
|
746
|
+
<ul class="since">
|
|
747
|
+
|
|
748
|
+
<li>
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
<div class='inline'>
|
|
755
|
+
<p>legacy</p>
|
|
756
|
+
</div>
|
|
757
|
+
|
|
758
|
+
</li>
|
|
759
|
+
|
|
760
|
+
</ul>
|
|
652
761
|
|
|
653
762
|
</div><table class="source_code">
|
|
654
763
|
<tr>
|
|
@@ -656,51 +765,80 @@ accessed.</p>
|
|
|
656
765
|
<pre class="lines">
|
|
657
766
|
|
|
658
767
|
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
768
|
+
73
|
|
769
|
+
74
|
|
770
|
+
75
|
|
771
|
+
76
|
|
772
|
+
77
|
|
773
|
+
78
|
|
774
|
+
79
|
|
775
|
+
80
|
|
776
|
+
81
|
|
777
|
+
82
|
|
778
|
+
83
|
|
779
|
+
84
|
|
780
|
+
85
|
|
781
|
+
86
|
|
782
|
+
87
|
|
783
|
+
88
|
|
784
|
+
89
|
|
785
|
+
90
|
|
786
|
+
91
|
|
787
|
+
92
|
|
788
|
+
93
|
|
789
|
+
94
|
|
790
|
+
95
|
|
791
|
+
96
|
|
792
|
+
97
|
|
793
|
+
98
|
|
794
|
+
99
|
|
795
|
+
100
|
|
796
|
+
101
|
|
797
|
+
102
|
|
798
|
+
103
|
|
799
|
+
104
|
|
800
|
+
105
|
|
801
|
+
106
|
|
802
|
+
107
|
|
803
|
+
108
|
|
804
|
+
109
|
|
805
|
+
110
|
|
806
|
+
111
|
|
807
|
+
112
|
|
808
|
+
113
|
|
809
|
+
114
|
|
810
|
+
115
|
|
811
|
+
116
|
|
812
|
+
117</pre>
|
|
689
813
|
</td>
|
|
690
814
|
<td>
|
|
691
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
815
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 73</span>
|
|
692
816
|
|
|
693
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='id identifier rubyid_source'>source</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
|
|
817
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='comma'>,</span> <span class='id identifier rubyid_source'>source</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</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>
|
|
694
818
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_parent'>parent</span><span class='rparen'>)</span>
|
|
695
819
|
<span class='ivar'>@source</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
696
820
|
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_id'>id</span>
|
|
697
|
-
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
698
|
-
<span class='ivar'>@x_scaling</span> <span class='op'>=</span> <span class='ivar'>@y_scaling</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
699
|
-
<span class='ivar'>@top_crop</span> <span class='op'>=</span> <span class='ivar'>@right_crop</span> <span class='op'>=</span> <span class='ivar'>@bottom_crop</span> <span class='op'>=</span> <span class='ivar'>@left_crop</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
700
|
-
<span class='ivar'>@width</span> <span class='op'>=</span> <span class='ivar'>@height</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
701
|
-
<span class='ivar'>@displayed_width</span> <span class='op'>=</span> <span class='ivar'>@displayed_height</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
702
821
|
|
|
703
|
-
<span class='comment'>#
|
|
822
|
+
<span class='comment'># load default options
|
|
823
|
+
</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
|
824
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>width</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>nil</span><span class='comma'>,</span>
|
|
825
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>height</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>nil</span><span class='comma'>,</span>
|
|
826
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>sizing_mode</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ABSOLUTE</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
|
827
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>border</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='kw'>nil</span>
|
|
828
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
|
829
|
+
|
|
830
|
+
<span class='comment'># extract options
|
|
831
|
+
</span> <span class='ivar'>@displayed_width</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Utilities.html" title="RRTF::Utilities (class)">Utilities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_value2twips'><span class='object_link'><a href="Utilities.html#value2twips-class_method" title="RRTF::Utilities.value2twips (method)">value2twips</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>width</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
832
|
+
<span class='ivar'>@displayed_height</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Utilities.html" title="RRTF::Utilities (class)">Utilities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_value2twips'><span class='object_link'><a href="Utilities.html#value2twips-class_method" title="RRTF::Utilities.value2twips (method)">value2twips</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>height</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
833
|
+
<span class='ivar'>@sizing_mode</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#SIZING_MODE_DICTIONARY-constant" title="RRTF::ImageNode::SIZING_MODE_DICTIONARY (constant)">SIZING_MODE_DICTIONARY</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>sizing_mode</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rbracket'>]</span>
|
|
834
|
+
<span class='ivar'>@border</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_parse_border_array'>parse_border_array</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>border</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
835
|
+
|
|
836
|
+
<span class='comment'># store border colours in colour table
|
|
837
|
+
</span> <span class='ivar'>@border</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_b'>b</span><span class='op'>|</span>
|
|
838
|
+
<span class='id identifier rubyid_b'>b</span><span class='period'>.</span><span class='id identifier rubyid_push_colours'>push_colours</span><span class='lparen'>(</span><span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='period'>.</span><span class='id identifier rubyid_colours'>colours</span><span class='rparen'>)</span>
|
|
839
|
+
<span class='kw'>end</span>
|
|
840
|
+
|
|
841
|
+
<span class='comment'># Store path to image.
|
|
704
842
|
</span> <span class='ivar'>@source</span> <span class='op'>=</span> <span class='id identifier rubyid_source'>source</span> <span class='kw'>if</span> <span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_instance_of?'>instance_of?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_instance_of?'>instance_of?</span><span class='lparen'>(</span><span class='const'>Tempfile</span><span class='rparen'>)</span>
|
|
705
843
|
<span class='ivar'>@source</span> <span class='op'>=</span> <span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span> <span class='kw'>if</span> <span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_instance_of?'>instance_of?</span><span class='lparen'>(</span><span class='const'>File</span><span class='rparen'>)</span>
|
|
706
844
|
|
|
@@ -711,14 +849,15 @@ accessed.</p>
|
|
|
711
849
|
<span class='kw'>if</span> <span class='op'>!</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_readable?'>readable?</span><span class='lparen'>(</span><span class='ivar'>@source</span><span class='rparen'>)</span>
|
|
712
850
|
<span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Access to the </span><span class='embexpr_beg'>#{</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='ivar'>@source</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> file denied.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
713
851
|
<span class='kw'>end</span>
|
|
714
|
-
|
|
715
|
-
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier
|
|
716
|
-
<span class='kw'>if</span> <span class='ivar'>@type</span
|
|
717
|
-
<span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The </span><span class='embexpr_beg'>#{</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='ivar'>@source</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> file contains an
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
852
|
+
<span class='comment'># Attempt to determine image type and dimensions.
|
|
853
|
+
</span> <span class='ivar'>@type</span><span class='comma'>,</span> <span class='ivar'>@width</span><span class='comma'>,</span> <span class='ivar'>@height</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='lparen'>(</span><span class='ivar'>@source</span><span class='rparen'>)</span>
|
|
854
|
+
<span class='kw'>if</span> <span class='ivar'>@type</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
855
|
+
<span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>The </span><span class='embexpr_beg'>#{</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='ivar'>@source</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> file contains an unknown or unsupported image type.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
856
|
+
<span class='kw'>elsif</span> <span class='ivar'>@width</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='ivar'>@height</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
857
|
+
<span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Could not determine the dimensions of </span><span class='embexpr_beg'>#{</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='ivar'>@source</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
858
|
+
<span class='kw'>end</span> <span class='comment'># if
|
|
859
|
+
</span>
|
|
860
|
+
<span class='ivar'>@displayed_width</span><span class='comma'>,</span> <span class='ivar'>@displayed_height</span> <span class='op'>=</span> <span class='id identifier rubyid_size_image'>size_image</span>
|
|
722
861
|
<span class='kw'>end</span></pre>
|
|
723
862
|
</td>
|
|
724
863
|
</tr>
|
|
@@ -731,11 +870,11 @@ accessed.</p>
|
|
|
731
870
|
<h2>Instance Attribute Details</h2>
|
|
732
871
|
|
|
733
872
|
|
|
734
|
-
<span id="
|
|
873
|
+
<span id="border=-instance_method"></span>
|
|
735
874
|
<div class="method_details first">
|
|
736
|
-
<h3 class="signature first" id="
|
|
875
|
+
<h3 class="signature first" id="border-instance_method">
|
|
737
876
|
|
|
738
|
-
#<strong>
|
|
877
|
+
#<strong>border</strong> ⇒ <tt>Object</tt>
|
|
739
878
|
|
|
740
879
|
|
|
741
880
|
|
|
@@ -744,13 +883,27 @@ accessed.</p>
|
|
|
744
883
|
</h3><div class="docstring">
|
|
745
884
|
<div class="discussion">
|
|
746
885
|
|
|
747
|
-
<p>Attribute accessor.</p>
|
|
748
|
-
|
|
749
886
|
|
|
750
887
|
</div>
|
|
751
888
|
</div>
|
|
752
889
|
<div class="tags">
|
|
753
890
|
|
|
891
|
+
<p class="tag_title">Since:</p>
|
|
892
|
+
<ul class="since">
|
|
893
|
+
|
|
894
|
+
<li>
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
<div class='inline'>
|
|
901
|
+
<p>legacy</p>
|
|
902
|
+
</div>
|
|
903
|
+
|
|
904
|
+
</li>
|
|
905
|
+
|
|
906
|
+
</ul>
|
|
754
907
|
|
|
755
908
|
</div><table class="source_code">
|
|
756
909
|
<tr>
|
|
@@ -758,15 +911,15 @@ accessed.</p>
|
|
|
758
911
|
<pre class="lines">
|
|
759
912
|
|
|
760
913
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
914
|
+
27
|
|
915
|
+
28
|
|
916
|
+
29</pre>
|
|
764
917
|
</td>
|
|
765
918
|
<td>
|
|
766
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
919
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 27</span>
|
|
767
920
|
|
|
768
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
769
|
-
<span class='ivar'>@
|
|
921
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_border'>border</span>
|
|
922
|
+
<span class='ivar'>@border</span>
|
|
770
923
|
<span class='kw'>end</span></pre>
|
|
771
924
|
</td>
|
|
772
925
|
</tr>
|
|
@@ -787,13 +940,27 @@ accessed.</p>
|
|
|
787
940
|
</h3><div class="docstring">
|
|
788
941
|
<div class="discussion">
|
|
789
942
|
|
|
790
|
-
<p>Attribute accessor.</p>
|
|
791
|
-
|
|
792
943
|
|
|
793
944
|
</div>
|
|
794
945
|
</div>
|
|
795
946
|
<div class="tags">
|
|
796
947
|
|
|
948
|
+
<p class="tag_title">Since:</p>
|
|
949
|
+
<ul class="since">
|
|
950
|
+
|
|
951
|
+
<li>
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
<div class='inline'>
|
|
958
|
+
<p>legacy</p>
|
|
959
|
+
</div>
|
|
960
|
+
|
|
961
|
+
</li>
|
|
962
|
+
|
|
963
|
+
</ul>
|
|
797
964
|
|
|
798
965
|
</div><table class="source_code">
|
|
799
966
|
<tr>
|
|
@@ -801,12 +968,12 @@ accessed.</p>
|
|
|
801
968
|
<pre class="lines">
|
|
802
969
|
|
|
803
970
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
971
|
+
27
|
|
972
|
+
28
|
|
973
|
+
29</pre>
|
|
807
974
|
</td>
|
|
808
975
|
<td>
|
|
809
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
976
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 27</span>
|
|
810
977
|
|
|
811
978
|
<span class='kw'>def</span> <span class='id identifier rubyid_displayed_height'>displayed_height</span>
|
|
812
979
|
<span class='ivar'>@displayed_height</span>
|
|
@@ -830,13 +997,27 @@ accessed.</p>
|
|
|
830
997
|
</h3><div class="docstring">
|
|
831
998
|
<div class="discussion">
|
|
832
999
|
|
|
833
|
-
<p>Attribute accessor.</p>
|
|
834
|
-
|
|
835
1000
|
|
|
836
1001
|
</div>
|
|
837
1002
|
</div>
|
|
838
1003
|
<div class="tags">
|
|
839
1004
|
|
|
1005
|
+
<p class="tag_title">Since:</p>
|
|
1006
|
+
<ul class="since">
|
|
1007
|
+
|
|
1008
|
+
<li>
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
<div class='inline'>
|
|
1015
|
+
<p>legacy</p>
|
|
1016
|
+
</div>
|
|
1017
|
+
|
|
1018
|
+
</li>
|
|
1019
|
+
|
|
1020
|
+
</ul>
|
|
840
1021
|
|
|
841
1022
|
</div><table class="source_code">
|
|
842
1023
|
<tr>
|
|
@@ -844,12 +1025,12 @@ accessed.</p>
|
|
|
844
1025
|
<pre class="lines">
|
|
845
1026
|
|
|
846
1027
|
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
1028
|
+
27
|
|
1029
|
+
28
|
|
1030
|
+
29</pre>
|
|
850
1031
|
</td>
|
|
851
1032
|
<td>
|
|
852
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
1033
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 27</span>
|
|
853
1034
|
|
|
854
1035
|
<span class='kw'>def</span> <span class='id identifier rubyid_displayed_width'>displayed_width</span>
|
|
855
1036
|
<span class='ivar'>@displayed_width</span>
|
|
@@ -873,13 +1054,27 @@ accessed.</p>
|
|
|
873
1054
|
</h3><div class="docstring">
|
|
874
1055
|
<div class="discussion">
|
|
875
1056
|
|
|
876
|
-
<p>Attribute accessor.</p>
|
|
877
|
-
|
|
878
1057
|
|
|
879
1058
|
</div>
|
|
880
1059
|
</div>
|
|
881
1060
|
<div class="tags">
|
|
882
1061
|
|
|
1062
|
+
<p class="tag_title">Since:</p>
|
|
1063
|
+
<ul class="since">
|
|
1064
|
+
|
|
1065
|
+
<li>
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
<div class='inline'>
|
|
1072
|
+
<p>legacy</p>
|
|
1073
|
+
</div>
|
|
1074
|
+
|
|
1075
|
+
</li>
|
|
1076
|
+
|
|
1077
|
+
</ul>
|
|
883
1078
|
|
|
884
1079
|
</div><table class="source_code">
|
|
885
1080
|
<tr>
|
|
@@ -887,12 +1082,12 @@ accessed.</p>
|
|
|
887
1082
|
<pre class="lines">
|
|
888
1083
|
|
|
889
1084
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
1085
|
+
27
|
|
1086
|
+
28
|
|
1087
|
+
29</pre>
|
|
893
1088
|
</td>
|
|
894
1089
|
<td>
|
|
895
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
1090
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 27</span>
|
|
896
1091
|
|
|
897
1092
|
<span class='kw'>def</span> <span class='id identifier rubyid_height'>height</span>
|
|
898
1093
|
<span class='ivar'>@height</span>
|
|
@@ -903,11 +1098,11 @@ accessed.</p>
|
|
|
903
1098
|
</div>
|
|
904
1099
|
|
|
905
1100
|
|
|
906
|
-
<span id="
|
|
1101
|
+
<span id="sizing_mode=-instance_method"></span>
|
|
907
1102
|
<div class="method_details ">
|
|
908
|
-
<h3 class="signature " id="
|
|
1103
|
+
<h3 class="signature " id="sizing_mode-instance_method">
|
|
909
1104
|
|
|
910
|
-
#<strong>
|
|
1105
|
+
#<strong>sizing_mode</strong> ⇒ <tt>Object</tt>
|
|
911
1106
|
|
|
912
1107
|
|
|
913
1108
|
|
|
@@ -916,56 +1111,27 @@ accessed.</p>
|
|
|
916
1111
|
</h3><div class="docstring">
|
|
917
1112
|
<div class="discussion">
|
|
918
1113
|
|
|
919
|
-
<p>Attribute accessor.</p>
|
|
920
|
-
|
|
921
1114
|
|
|
922
1115
|
</div>
|
|
923
1116
|
</div>
|
|
924
1117
|
<div class="tags">
|
|
925
1118
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
<tr>
|
|
929
|
-
<td>
|
|
930
|
-
<pre class="lines">
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
1280
|
|
934
|
-
1281
|
|
935
|
-
1282</pre>
|
|
936
|
-
</td>
|
|
937
|
-
<td>
|
|
938
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 1280</span>
|
|
939
|
-
|
|
940
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_left_crop'>left_crop</span>
|
|
941
|
-
<span class='ivar'>@left_crop</span>
|
|
942
|
-
<span class='kw'>end</span></pre>
|
|
943
|
-
</td>
|
|
944
|
-
</tr>
|
|
945
|
-
</table>
|
|
946
|
-
</div>
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
<span id="right_crop=-instance_method"></span>
|
|
950
|
-
<div class="method_details ">
|
|
951
|
-
<h3 class="signature " id="right_crop-instance_method">
|
|
952
|
-
|
|
953
|
-
#<strong>right_crop</strong> ⇒ <tt>Object</tt>
|
|
1119
|
+
<p class="tag_title">Since:</p>
|
|
1120
|
+
<ul class="since">
|
|
954
1121
|
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
<p>
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
</div>
|
|
1122
|
+
<li>
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
<div class='inline'>
|
|
1129
|
+
<p>legacy</p>
|
|
966
1130
|
</div>
|
|
967
|
-
|
|
1131
|
+
|
|
1132
|
+
</li>
|
|
968
1133
|
|
|
1134
|
+
</ul>
|
|
969
1135
|
|
|
970
1136
|
</div><table class="source_code">
|
|
971
1137
|
<tr>
|
|
@@ -973,15 +1139,15 @@ accessed.</p>
|
|
|
973
1139
|
<pre class="lines">
|
|
974
1140
|
|
|
975
1141
|
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1142
|
+
27
|
|
1143
|
+
28
|
|
1144
|
+
29</pre>
|
|
979
1145
|
</td>
|
|
980
1146
|
<td>
|
|
981
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
1147
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 27</span>
|
|
982
1148
|
|
|
983
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
984
|
-
<span class='ivar'>@
|
|
1149
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sizing_mode'>sizing_mode</span>
|
|
1150
|
+
<span class='ivar'>@sizing_mode</span>
|
|
985
1151
|
<span class='kw'>end</span></pre>
|
|
986
1152
|
</td>
|
|
987
1153
|
</tr>
|
|
@@ -989,11 +1155,11 @@ accessed.</p>
|
|
|
989
1155
|
</div>
|
|
990
1156
|
|
|
991
1157
|
|
|
992
|
-
<span id="
|
|
1158
|
+
<span id=""></span>
|
|
993
1159
|
<div class="method_details ">
|
|
994
|
-
<h3 class="signature " id="
|
|
1160
|
+
<h3 class="signature " id="type-instance_method">
|
|
995
1161
|
|
|
996
|
-
#<strong>
|
|
1162
|
+
#<strong>type</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
997
1163
|
|
|
998
1164
|
|
|
999
1165
|
|
|
@@ -1002,13 +1168,27 @@ accessed.</p>
|
|
|
1002
1168
|
</h3><div class="docstring">
|
|
1003
1169
|
<div class="discussion">
|
|
1004
1170
|
|
|
1005
|
-
<p>Attribute accessor.</p>
|
|
1006
|
-
|
|
1007
1171
|
|
|
1008
1172
|
</div>
|
|
1009
1173
|
</div>
|
|
1010
1174
|
<div class="tags">
|
|
1011
1175
|
|
|
1176
|
+
<p class="tag_title">Since:</p>
|
|
1177
|
+
<ul class="since">
|
|
1178
|
+
|
|
1179
|
+
<li>
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
<div class='inline'>
|
|
1186
|
+
<p>legacy</p>
|
|
1187
|
+
</div>
|
|
1188
|
+
|
|
1189
|
+
</li>
|
|
1190
|
+
|
|
1191
|
+
</ul>
|
|
1012
1192
|
|
|
1013
1193
|
</div><table class="source_code">
|
|
1014
1194
|
<tr>
|
|
@@ -1016,15 +1196,15 @@ accessed.</p>
|
|
|
1016
1196
|
<pre class="lines">
|
|
1017
1197
|
|
|
1018
1198
|
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1199
|
+
27
|
|
1200
|
+
28
|
|
1201
|
+
29</pre>
|
|
1022
1202
|
</td>
|
|
1023
1203
|
<td>
|
|
1024
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
1204
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 27</span>
|
|
1025
1205
|
|
|
1026
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
1027
|
-
<span class='ivar'>@
|
|
1206
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
|
|
1207
|
+
<span class='ivar'>@type</span>
|
|
1028
1208
|
<span class='kw'>end</span></pre>
|
|
1029
1209
|
</td>
|
|
1030
1210
|
</tr>
|
|
@@ -1045,13 +1225,27 @@ accessed.</p>
|
|
|
1045
1225
|
</h3><div class="docstring">
|
|
1046
1226
|
<div class="discussion">
|
|
1047
1227
|
|
|
1048
|
-
<p>Attribute accessor.</p>
|
|
1049
|
-
|
|
1050
1228
|
|
|
1051
1229
|
</div>
|
|
1052
1230
|
</div>
|
|
1053
1231
|
<div class="tags">
|
|
1054
1232
|
|
|
1233
|
+
<p class="tag_title">Since:</p>
|
|
1234
|
+
<ul class="since">
|
|
1235
|
+
|
|
1236
|
+
<li>
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
<div class='inline'>
|
|
1243
|
+
<p>legacy</p>
|
|
1244
|
+
</div>
|
|
1245
|
+
|
|
1246
|
+
</li>
|
|
1247
|
+
|
|
1248
|
+
</ul>
|
|
1055
1249
|
|
|
1056
1250
|
</div><table class="source_code">
|
|
1057
1251
|
<tr>
|
|
@@ -1059,12 +1253,12 @@ accessed.</p>
|
|
|
1059
1253
|
<pre class="lines">
|
|
1060
1254
|
|
|
1061
1255
|
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1256
|
+
27
|
|
1257
|
+
28
|
|
1258
|
+
29</pre>
|
|
1065
1259
|
</td>
|
|
1066
1260
|
<td>
|
|
1067
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
1261
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 27</span>
|
|
1068
1262
|
|
|
1069
1263
|
<span class='kw'>def</span> <span class='id identifier rubyid_width'>width</span>
|
|
1070
1264
|
<span class='ivar'>@width</span>
|
|
@@ -1074,12 +1268,17 @@ accessed.</p>
|
|
|
1074
1268
|
</table>
|
|
1075
1269
|
</div>
|
|
1076
1270
|
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
<
|
|
1271
|
+
</div>
|
|
1272
|
+
|
|
1273
|
+
|
|
1274
|
+
<div id="class_method_details" class="method_details_list">
|
|
1275
|
+
<h2>Class Method Details</h2>
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
<div class="method_details first">
|
|
1279
|
+
<h3 class="signature first" id="inspect-class_method">
|
|
1081
1280
|
|
|
1082
|
-
|
|
1281
|
+
.<strong>inspect</strong>(source) ⇒ <tt>Array<Object></tt>
|
|
1083
1282
|
|
|
1084
1283
|
|
|
1085
1284
|
|
|
@@ -1088,13 +1287,69 @@ accessed.</p>
|
|
|
1088
1287
|
</h3><div class="docstring">
|
|
1089
1288
|
<div class="discussion">
|
|
1090
1289
|
|
|
1091
|
-
<p>
|
|
1290
|
+
<p>Attempts to extract the type, width, and height of an image using
|
|
1291
|
+
FastImage.</p>
|
|
1092
1292
|
|
|
1093
1293
|
|
|
1094
1294
|
</div>
|
|
1095
1295
|
</div>
|
|
1096
1296
|
<div class="tags">
|
|
1297
|
+
<p class="tag_title">Parameters:</p>
|
|
1298
|
+
<ul class="param">
|
|
1299
|
+
|
|
1300
|
+
<li>
|
|
1301
|
+
|
|
1302
|
+
<span class='name'>source</span>
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1306
|
+
|
|
1307
|
+
|
|
1308
|
+
|
|
1309
|
+
—
|
|
1310
|
+
<div class='inline'>
|
|
1311
|
+
<p>the file path to the source image.</p>
|
|
1312
|
+
</div>
|
|
1313
|
+
|
|
1314
|
+
</li>
|
|
1315
|
+
|
|
1316
|
+
</ul>
|
|
1317
|
+
|
|
1318
|
+
<p class="tag_title">Returns:</p>
|
|
1319
|
+
<ul class="return">
|
|
1320
|
+
|
|
1321
|
+
<li>
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
<span class='type'>(<tt>Array<Object></tt>)</span>
|
|
1325
|
+
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
—
|
|
1329
|
+
<div class='inline'>
|
|
1330
|
+
<p>a 3-tuple containing the type, width, and height of the image, respectively
|
|
1331
|
+
(type is a symbol, dimensions in pixels).</p>
|
|
1332
|
+
</div>
|
|
1333
|
+
|
|
1334
|
+
</li>
|
|
1335
|
+
|
|
1336
|
+
</ul>
|
|
1337
|
+
<p class="tag_title">Since:</p>
|
|
1338
|
+
<ul class="since">
|
|
1339
|
+
|
|
1340
|
+
<li>
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
|
|
1346
|
+
<div class='inline'>
|
|
1347
|
+
<p>legacy</p>
|
|
1348
|
+
</div>
|
|
1349
|
+
|
|
1350
|
+
</li>
|
|
1097
1351
|
|
|
1352
|
+
</ul>
|
|
1098
1353
|
|
|
1099
1354
|
</div><table class="source_code">
|
|
1100
1355
|
<tr>
|
|
@@ -1102,27 +1357,35 @@ accessed.</p>
|
|
|
1102
1357
|
<pre class="lines">
|
|
1103
1358
|
|
|
1104
1359
|
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1360
|
+
36
|
|
1361
|
+
37
|
|
1362
|
+
38
|
|
1363
|
+
39
|
|
1364
|
+
40
|
|
1365
|
+
41
|
|
1366
|
+
42
|
|
1367
|
+
43</pre>
|
|
1108
1368
|
</td>
|
|
1109
1369
|
<td>
|
|
1110
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
1370
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 36</span>
|
|
1371
|
+
|
|
1372
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</span><span class='rparen'>)</span>
|
|
1373
|
+
<span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
|
1111
1374
|
|
|
1112
|
-
<span class='
|
|
1113
|
-
<span class='
|
|
1375
|
+
<span class='id identifier rubyid_type'>type</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#TYPE_DICTIONARY-constant" title="RRTF::ImageNode::TYPE_DICTIONARY (constant)">TYPE_DICTIONARY</a></span></span><span class='lbracket'>[</span><span class='const'>FastImage</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</span><span class='rparen'>)</span><span class='rbracket'>]</span>
|
|
1376
|
+
<span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span> <span class='op'>=</span> <span class='const'>FastImage</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_type'>type</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
1377
|
+
|
|
1378
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span><span class='rbracket'>]</span>
|
|
1114
1379
|
<span class='kw'>end</span></pre>
|
|
1115
1380
|
</td>
|
|
1116
1381
|
</tr>
|
|
1117
1382
|
</table>
|
|
1118
1383
|
</div>
|
|
1119
1384
|
|
|
1120
|
-
|
|
1121
|
-
<span id="y_scaling=-instance_method"></span>
|
|
1122
1385
|
<div class="method_details ">
|
|
1123
|
-
<h3 class="signature " id="
|
|
1386
|
+
<h3 class="signature " id="parse_border_array-class_method">
|
|
1124
1387
|
|
|
1125
|
-
|
|
1388
|
+
.<strong>parse_border_array</strong>(border) ⇒ <tt>Object</tt>
|
|
1126
1389
|
|
|
1127
1390
|
|
|
1128
1391
|
|
|
@@ -1131,13 +1394,29 @@ accessed.</p>
|
|
|
1131
1394
|
</h3><div class="docstring">
|
|
1132
1395
|
<div class="discussion">
|
|
1133
1396
|
|
|
1134
|
-
<p>
|
|
1397
|
+
<p>inspect()</p>
|
|
1135
1398
|
|
|
1136
1399
|
|
|
1137
1400
|
</div>
|
|
1138
1401
|
</div>
|
|
1139
1402
|
<div class="tags">
|
|
1140
1403
|
|
|
1404
|
+
<p class="tag_title">Since:</p>
|
|
1405
|
+
<ul class="since">
|
|
1406
|
+
|
|
1407
|
+
<li>
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
|
|
1412
|
+
|
|
1413
|
+
<div class='inline'>
|
|
1414
|
+
<p>legacy</p>
|
|
1415
|
+
</div>
|
|
1416
|
+
|
|
1417
|
+
</li>
|
|
1418
|
+
|
|
1419
|
+
</ul>
|
|
1141
1420
|
|
|
1142
1421
|
</div><table class="source_code">
|
|
1143
1422
|
<tr>
|
|
@@ -1145,15 +1424,37 @@ accessed.</p>
|
|
|
1145
1424
|
<pre class="lines">
|
|
1146
1425
|
|
|
1147
1426
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1427
|
+
45
|
|
1428
|
+
46
|
|
1429
|
+
47
|
|
1430
|
+
48
|
|
1431
|
+
49
|
|
1432
|
+
50
|
|
1433
|
+
51
|
|
1434
|
+
52
|
|
1435
|
+
53
|
|
1436
|
+
54
|
|
1437
|
+
55
|
|
1438
|
+
56
|
|
1439
|
+
57
|
|
1440
|
+
58</pre>
|
|
1151
1441
|
</td>
|
|
1152
1442
|
<td>
|
|
1153
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
1154
|
-
|
|
1155
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
1156
|
-
<span class='
|
|
1443
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 45</span>
|
|
1444
|
+
|
|
1445
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_border_array'>parse_border_array</span><span class='lparen'>(</span><span class='id identifier rubyid_border'>border</span><span class='rparen'>)</span>
|
|
1446
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_border'>border</span>
|
|
1447
|
+
<span class='kw'>when</span> <span class='kw'>nil</span>
|
|
1448
|
+
<span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
1449
|
+
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="BorderStyle.html" title="RRTF::BorderStyle (class)">BorderStyle</a></span></span>
|
|
1450
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_border'>border</span><span class='rbracket'>]</span>
|
|
1451
|
+
<span class='kw'>when</span> <span class='const'>Hash</span>
|
|
1452
|
+
<span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="BorderStyle.html" title="RRTF::BorderStyle (class)">BorderStyle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="BorderStyle.html#initialize-instance_method" title="RRTF::BorderStyle#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_border'>border</span><span class='rparen'>)</span><span class='rbracket'>]</span>
|
|
1453
|
+
<span class='kw'>when</span> <span class='const'>Array</span>
|
|
1454
|
+
<span class='id identifier rubyid_border'>border</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='id identifier rubyid_parse_border_array'>parse_border_array</span><span class='lparen'>(</span><span class='id identifier rubyid_b'>b</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
|
|
1455
|
+
<span class='kw'>else</span>
|
|
1456
|
+
<span class='const'><span class='object_link'><a href="RTFError.html" title="RRTF::RTFError (class)">RTFError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_fire'><span class='object_link'><a href="RTFError.html#fire-class_method" title="RRTF::RTFError.fire (method)">fire</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Invalid border </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_b'>b</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
1457
|
+
<span class='kw'>end</span>
|
|
1157
1458
|
<span class='kw'>end</span></pre>
|
|
1158
1459
|
</td>
|
|
1159
1460
|
</tr>
|
|
@@ -1162,15 +1463,14 @@ accessed.</p>
|
|
|
1162
1463
|
|
|
1163
1464
|
</div>
|
|
1164
1465
|
|
|
1165
|
-
|
|
1166
1466
|
<div id="instance_method_details" class="method_details_list">
|
|
1167
1467
|
<h2>Instance Method Details</h2>
|
|
1168
1468
|
|
|
1169
1469
|
|
|
1170
1470
|
<div class="method_details first">
|
|
1171
|
-
<h3 class="signature first" id="
|
|
1471
|
+
<h3 class="signature first" id="to_rtf-instance_method">
|
|
1172
1472
|
|
|
1173
|
-
#<strong>
|
|
1473
|
+
#<strong>to_rtf</strong> ⇒ <tt>Object</tt>
|
|
1174
1474
|
|
|
1175
1475
|
|
|
1176
1476
|
|
|
@@ -1179,102 +1479,29 @@ accessed.</p>
|
|
|
1179
1479
|
</h3><div class="docstring">
|
|
1180
1480
|
<div class="discussion">
|
|
1181
1481
|
|
|
1182
|
-
<p>This method
|
|
1183
|
-
two call approaches. If called without a block then the method considers
|
|
1184
|
-
the size parameter it is passed. If called with a block the method executes
|
|
1185
|
-
until the block returns true.</p>
|
|
1186
|
-
|
|
1187
|
-
<h4 id="label-Parameters">Parameters</h4>
|
|
1188
|
-
<dl class="rdoc-list note-list"><dt>size
|
|
1189
|
-
<dd>
|
|
1190
|
-
<p>The maximum number of bytes to be read from the file. Defaults to nil to
|
|
1191
|
-
indicate that the remainder of the file should be read in.</p>
|
|
1192
|
-
</dd></dl>
|
|
1482
|
+
<p>This method generates the RTF for an ImageNode object.</p>
|
|
1193
1483
|
|
|
1194
1484
|
|
|
1195
1485
|
</div>
|
|
1196
1486
|
</div>
|
|
1197
1487
|
<div class="tags">
|
|
1198
1488
|
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
<tr>
|
|
1202
|
-
<td>
|
|
1203
|
-
<pre class="lines">
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
1445
|
|
1207
|
-
1446
|
|
1208
|
-
1447
|
|
1209
|
-
1448
|
|
1210
|
-
1449
|
|
1211
|
-
1450
|
|
1212
|
-
1451
|
|
1213
|
-
1452
|
|
1214
|
-
1453
|
|
1215
|
-
1454
|
|
1216
|
-
1455
|
|
1217
|
-
1456
|
|
1218
|
-
1457
|
|
1219
|
-
1458
|
|
1220
|
-
1459
|
|
1221
|
-
1460
|
|
1222
|
-
1461
|
|
1223
|
-
1462
|
|
1224
|
-
1463
|
|
1225
|
-
1464
|
|
1226
|
-
1465
|
|
1227
|
-
1466</pre>
|
|
1228
|
-
</td>
|
|
1229
|
-
<td>
|
|
1230
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line 1445</span>
|
|
1231
|
-
|
|
1232
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_read_source'>read_source</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='id identifier rubyid_read'>read</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
|
1233
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
|
1234
|
-
<span class='id identifier rubyid_done'>done</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
1235
|
-
|
|
1236
|
-
<span class='kw'>while</span> <span class='op'>!</span><span class='id identifier rubyid_done'>done</span> <span class='kw'>and</span> <span class='op'>!</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_eof?'>eof?</span>
|
|
1237
|
-
<span class='id identifier rubyid_read'>read</span> <span class='op'><<</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_getbyte'>getbyte</span>
|
|
1238
|
-
<span class='id identifier rubyid_done'>done</span> <span class='op'>=</span> <span class='kw'>yield</span> <span class='id identifier rubyid_read'>read</span><span class='lbracket'>[</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span>
|
|
1239
|
-
<span class='kw'>end</span>
|
|
1240
|
-
<span class='kw'>else</span>
|
|
1241
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_size'>size</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
|
1242
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_size'>size</span> <span class='op'>></span> <span class='int'>0</span>
|
|
1243
|
-
<span class='id identifier rubyid_total'>total</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
1244
|
-
<span class='kw'>while</span> <span class='op'>!</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_eof?'>eof?</span> <span class='kw'>and</span> <span class='id identifier rubyid_total'>total</span> <span class='op'><</span> <span class='id identifier rubyid_size'>size</span>
|
|
1245
|
-
<span class='id identifier rubyid_read'>read</span> <span class='op'><<</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_getbyte'>getbyte</span>
|
|
1246
|
-
<span class='id identifier rubyid_total'>total</span> <span class='op'>+=</span> <span class='int'>1</span>
|
|
1247
|
-
<span class='kw'>end</span>
|
|
1248
|
-
<span class='kw'>end</span>
|
|
1249
|
-
<span class='kw'>else</span>
|
|
1250
|
-
<span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_each_byte'>each_byte</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_byte'>byte</span><span class='op'>|</span> <span class='id identifier rubyid_read'>read</span> <span class='op'><<</span> <span class='id identifier rubyid_byte'>byte</span><span class='rbrace'>}</span>
|
|
1251
|
-
<span class='kw'>end</span>
|
|
1252
|
-
<span class='kw'>end</span>
|
|
1253
|
-
<span class='kw'>end</span></pre>
|
|
1254
|
-
</td>
|
|
1255
|
-
</tr>
|
|
1256
|
-
</table>
|
|
1257
|
-
</div>
|
|
1258
|
-
|
|
1259
|
-
<div class="method_details ">
|
|
1260
|
-
<h3 class="signature " id="to_rtf-instance_method">
|
|
1489
|
+
<p class="tag_title">Since:</p>
|
|
1490
|
+
<ul class="since">
|
|
1261
1491
|
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
<p>This method generates the RTF for an ImageNode object.</p>
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
</div>
|
|
1492
|
+
<li>
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
<div class='inline'>
|
|
1499
|
+
<p>legacy</p>
|
|
1275
1500
|
</div>
|
|
1276
|
-
|
|
1501
|
+
|
|
1502
|
+
</li>
|
|
1277
1503
|
|
|
1504
|
+
</ul>
|
|
1278
1505
|
|
|
1279
1506
|
</div><table class="source_code">
|
|
1280
1507
|
<tr>
|
|
@@ -1282,60 +1509,47 @@ indicate that the remainder of the file should be read in.</p>
|
|
|
1282
1509
|
<pre class="lines">
|
|
1283
1510
|
|
|
1284
1511
|
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
1398
|
|
1313
|
-
1399
|
|
1314
|
-
1400
|
|
1315
|
-
1401
|
|
1316
|
-
1402
|
|
1317
|
-
1403
|
|
1318
|
-
1404</pre>
|
|
1512
|
+
120
|
|
1513
|
+
121
|
|
1514
|
+
122
|
|
1515
|
+
123
|
|
1516
|
+
124
|
|
1517
|
+
125
|
|
1518
|
+
126
|
|
1519
|
+
127
|
|
1520
|
+
128
|
|
1521
|
+
129
|
|
1522
|
+
130
|
|
1523
|
+
131
|
|
1524
|
+
132
|
|
1525
|
+
133
|
|
1526
|
+
134
|
|
1527
|
+
135
|
|
1528
|
+
136
|
|
1529
|
+
137
|
|
1530
|
+
138
|
|
1531
|
+
139
|
|
1532
|
+
140
|
|
1533
|
+
141
|
|
1534
|
+
142
|
|
1535
|
+
143
|
|
1536
|
+
144
|
|
1537
|
+
145
|
|
1538
|
+
146</pre>
|
|
1319
1539
|
</td>
|
|
1320
1540
|
<td>
|
|
1321
|
-
<pre class="code"><span class="info file"># File 'lib/rrtf/node.rb', line
|
|
1541
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/node/image_node.rb', line 120</span>
|
|
1322
1542
|
|
|
1323
1543
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_rtf'>to_rtf</span>
|
|
1324
1544
|
<span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
1325
1545
|
<span class='id identifier rubyid_count'>count</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
1326
1546
|
|
|
1327
|
-
<span class='
|
|
1328
|
-
</span>
|
|
1329
|
-
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\picscalex</span><span class='embexpr_beg'>#{</span><span class='ivar'>@x_scaling</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@x_scaling</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
|
1330
|
-
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\picscaley</span><span class='embexpr_beg'>#{</span><span class='ivar'>@y_scaling</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@y_scaling</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
|
1331
|
-
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\piccropl</span><span class='embexpr_beg'>#{</span><span class='ivar'>@left_crop</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@left_crop</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
|
1332
|
-
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\piccropr</span><span class='embexpr_beg'>#{</span><span class='ivar'>@right_crop</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@right_crop</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
|
1333
|
-
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\piccropt</span><span class='embexpr_beg'>#{</span><span class='ivar'>@top_crop</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@top_crop</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
|
1334
|
-
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\piccropb</span><span class='embexpr_beg'>#{</span><span class='ivar'>@bottom_crop</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@bottom_crop</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
|
1547
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>{\pict</span><span class='tstring_end'>'</span></span>
|
|
1548
|
+
<span class='ivar'>@border</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_b'>b</span><span class='op'>|</span> <span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_b'>b</span><span class='period'>.</span><span class='id identifier rubyid_prefix'>prefix</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_root'><span class='object_link'><a href="../top-level-namespace.html" title="Top Level Namespace (root)">root</a></span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
|
1335
1549
|
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\picwgoal</span><span class='embexpr_beg'>#{</span><span class='ivar'>@displayed_width</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@displayed_width</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
|
1336
1550
|
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\pichgoal</span><span class='embexpr_beg'>#{</span><span class='ivar'>@displayed_height</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@displayed_height</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
|
1337
1551
|
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\picw</span><span class='embexpr_beg'>#{</span><span class='ivar'>@width</span><span class='embexpr_end'>}</span><span class='tstring_content'>\\pich</span><span class='embexpr_beg'>#{</span><span class='ivar'>@height</span><span class='embexpr_end'>}</span><span class='tstring_content'>\\bliptag</span><span class='embexpr_beg'>#{</span><span class='ivar'>@id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
1338
|
-
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\</span><span class='embexpr_beg'>#{</span><span class='ivar'>@type</span><span class='
|
|
1552
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\\</span><span class='embexpr_beg'>#{</span><span class='ivar'>@type</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
|
1339
1553
|
|
|
1340
1554
|
<span class='id identifier rubyid_open_file'>open_file</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span>
|
|
1341
1555
|
<span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_each_byte'>each_byte</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_byte'>byte</span><span class='op'>|</span>
|
|
@@ -1346,11 +1560,10 @@ indicate that the remainder of the file should be read in.</p>
|
|
|
1346
1560
|
<span class='kw'>if</span> <span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='int'>40</span>
|
|
1347
1561
|
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
|
1348
1562
|
<span class='id identifier rubyid_count'>count</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
1349
|
-
<span class='kw'>end</span>
|
|
1350
|
-
<span class='kw'>end</span>
|
|
1351
|
-
<span class='kw'>end</span>
|
|
1352
|
-
<span class='
|
|
1353
|
-
</span> <span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n}}</span><span class='tstring_end'>"</span></span>
|
|
1563
|
+
<span class='kw'>end</span> <span class='comment'># if
|
|
1564
|
+
</span> <span class='kw'>end</span> <span class='comment'># each_byte
|
|
1565
|
+
</span> <span class='kw'>end</span> <span class='comment'># open_file
|
|
1566
|
+
</span> <span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n}</span><span class='tstring_end'>"</span></span>
|
|
1354
1567
|
|
|
1355
1568
|
<span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span>
|
|
1356
1569
|
<span class='kw'>end</span></pre>
|
|
@@ -1364,7 +1577,7 @@ indicate that the remainder of the file should be read in.</p>
|
|
|
1364
1577
|
</div>
|
|
1365
1578
|
|
|
1366
1579
|
<div id="footer">
|
|
1367
|
-
Generated on Mon Jul
|
|
1580
|
+
Generated on Mon Jul 31 21:49:00 2017 by
|
|
1368
1581
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1369
1582
|
0.9.9 (ruby-2.3.3).
|
|
1370
1583
|
</div>
|