1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org" />
<title>RMagick 0.0.0: module Magick</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<meta name="GENERATOR" content="Quanta Plus" />
<meta name="Copyright" content="Copyright (C) 2006 by Timothy P. Hunter" />
<link rel="stylesheet" type="text/css" href="css/doc.css" />
<script type="text/javascript" src="scripts/doc.js"></script>
<style type="text/css">
/*<![CDATA[*/
/* Styles local to this page. */
/*]]>*/
</style>
</head>
<body>
<h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
<div class="nav">« <a href="comtasks.html">Prev</a> | <a href="index.html">Contents</a> | <a href="ilist.html">Next</a> »</div>
<h1>module Magick</h1>
<div id="toc">
<h2>Table of Contents</h2>
<h3>module methods</h3>
<ul>
<li><a href="#colors">colors</a></li>
<li><a href="#fonts">fonts</a></li>
<li><a href="#formats">formats</a></li>
<li><a href="#limit_resource">limit_resource</a></li>
<li><a href="#set_cache_threshold">set_cache_threshold</a></li>
<li><a href="#set_log_event_mask">set_log_event_mask</a></li>
<li><a href="#set_log_format">set_log_format</a></li>
</ul>
</div>
<h2 class="methods">module methods</h2>
<div class="sig">
<h3 id="colors">colors</h3>
<p>
Magick.colors <span class="arg">{ |color| block }</span> -> <em>Magick</em><br />
Magick.colors -> <em>array</em>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Lists the <a href="imusage.html#color_names">named colors</a>. If the optional block is present, calls the block once for each color, passing a
Magick::Color object. Otherwise, returns an array of Magick::Color objects, one for each color.
</p>
<p>The Magick::Color class is a Struct class with the following attributes:</p>
<table class="simple_table" summary="magic color attributes">
<caption>
Magick::Color attributes
</caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>name</td>
<td>The color name. For example, "red".</td>
</tr>
<tr>
<td>compliance</td>
<td>A <a href="constants.html#ComplianceType">ComplianceType</a> value such as X11Compliance.</td>
</tr>
<tr>
<td>color</td>
<td>A <a href="struct.html#Pixel">Pixel</a> object containing the RGB values.</td>
</tr>
</table>
<h4>Returns</h4>
<p>If no block is associated with the call, returns an array of Magick::Color objects.</p>
<h4>Example</h4>
<p>This is a small sample of <code>colors.miff</code>, the complete image created by the example program.</p>
<p>
<a href="javascript:popup('colors.rb.html')"><img src="ex/colors.gif" title="Click to see the example script" alt="Magick::colors example" /></a>
</p>
<h4>Magick API</h4>
<p>GetColorInfo</p>
</div>
<div class="sig">
<h3 id="fonts">fonts</h3>
<p>
Magick.fonts <span class="arg">{ |font| block }</span> -> <em>Magick</em><br />
Magick.fonts -> <em>array</em>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Lists the fonts that ImageMagick knows about. If the optional block is present, calls the block once for each font, passing a Magick::Font object.
Otherwise, returns an array of Magick::Font objects, one for each font.
</p>
<p>The Magick::Font class is a Struct class with the following attributes:</p>
<table summary="font class attributes" class="simple_table">
<caption>
Magick::Font attributes
</caption>
<tr>
<th>Attribute</th>
<th>Value</th>
</tr>
<tr>
<td>name</td>
<td>The font name. For example, "Palatino-Roman".</td>
</tr>
<tr>
<td>description</td>
<td>The font description. For example, "Palatino Roman".</td>
</tr>
<tr>
<td>family</td>
<td>The font family. For example, "Palatino", "Helvetica", or "Courier".</td>
</tr>
<tr>
<td>style</td>
<td>A <a href="constants.html#StyleType">StyleType</a> value such as <code>NormalStyle</code>.</td>
</tr>
<tr>
<td>stretch</td>
<td>A <a href="constants.html#StretchType">StretchType</a> value such as <code>NormalStretch</code>.</td>
</tr>
<tr>
<td>weight</td>
<td>The font weight, one of 100, 200, 300, 400, 500, 600, 700, 800, or 900.</td>
</tr>
<tr>
<td>encoding</td>
<td>The font encoding, such as "AppleRoman". May be <code>nil</code>.</td>
</tr>
<tr>
<td>foundry</td>
<td>The font foundry. "URW", for example. May be <code>nil</code>.</td>
</tr>
<tr>
<td>format</td>
<td>
If the font is a Type1 font, has the value "type1", otherwise
<code>nil</code>.
</td>
</tr>
</table>
<h4>Returns</h4>
<p>If no block is associated with the call, returns an array of Magick::Font objects.</p>
<h4>Example</h4>
<p>
<a href="javascript:popup('fonts.rb.html')" title="The example script">fonts.rb</a>
</p>
<h4>Magick API</h4>
<p>GetFontInfo</p>
</div>
<div class="sig">
<h3 id="formats">formats</h3>
<p>
Magick.formats <span class="arg">{ |f,v| block }</span> -> <em>Magick</em><br />
Magick.formats -> <em>hash</em>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Describes the image formats supported by ImageMagick. If the optional block is present, calls the block once for each image format. The first argument,
<em>f</em>, is the format name. The second argument, <em>v</em>, is the properties string described below.
</p>
<h4>Returns</h4>
A hash of image formats and their properties. Each key in the returned hash is the name of a supported image format. Each value is a string in the form
"BRWA". The details are in this table:
<table summary="format string symbols" class="simple_table">
<caption>
Format property codes
</caption>
<tr>
<th>Code</th>
<th>Definition</th>
</tr>
<tr>
<td>B</td>
<td>is "*" if the format has native blob support, and "-" otherwise.</td>
</tr>
<tr>
<td>R</td>
<td>is "r" if ImageMagick can read the format, and "-" otherwise.</td>
</tr>
<tr>
<td>W</td>
<td>is "w" if ImageMagick can write the format, and "-" otherwise.</td>
</tr>
<tr>
<td>A</td>
<td>is "+" if the format supports multi-image files, and "-" otherwise.</td>
</tr>
</table>
<h4>Example</h4>
<pre>
p Magick.formats »
{"TIF"=>"*rw+",
"H"=>"*rw-",
"MNG"=>"*rw+",
"NULL"=>"*rw-",
...
"G"=>"*rw+",
"GIF"=>"*rw+",
"PDB"=>"*rw+"}
</pre
>
<h4>Magick API</h4>
<p>GetMagickInfo</p>
<h4>Note</h4>
<p>
ImageMagick depends on external programs for some formats. Depending on how ImageMagick was installed on your system, some formats may not be available.
If you have questions, ask your system administrator.
</p>
</div>
<div class="sig">
<h3 id="limit_resource">limit_resource</h3>
<p>
Magick.limit_resource(<span class="arg">resource_type</span> [, <span class="arg">limit</span>]) ->
<span class="arg">old_limit</span>
</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Sets a limit to the amount of a resource, or gets the current limit for the resource.
<span class="imquote">When the limit is reached, ImageMagick will fail in some fashion or take compensating actions if possible.</span>
The default limits vary according to the platform. See the ImageMagick documentation for the <em>-limit</em> option for more information.
</p>
<h4>Arguments</h4>
This method may be called with one or two arguments. The first argument identifies the resource. If specified, the second argument is the limit.
<dl>
<dt>resource_type</dt>
<dd>
One of the symbols <code>:area</code>, <code>:disk</code>, <code>:file</code>, <code>:map</code>, <code>:memory</code>, or <code>:time</code>. You may
use a string instead of a symbol.
</dd>
<dt>limit</dt>
<dd>
If present, the limit for the resource. This argument is always an integer number. If the <span class="arg">resource_type</span> is
<code>:file</code>, the limit is the number of open files. If <code>:memory</code> or <code>:map</code>, the limit is measured megabytes. If
<code>:disk</code>, the limit is measured in gigabytes. If the <span class="arg">resource_type</span> is <code>:area</code> the limit is the maximum
width * height of an image in pixels that can reside in pixel cache memory. If <code>:time</code>, the limit is measured in seconds. If this argument
is omitted the limit is not changed.
</dd>
</dl>
<h4>Returns</h4>
<p>The current resource limit. If a new limit is specified this is the limit <em>before</em> the change.</p>
<h4>Notes</h4>
<p>This method supercedes <code>set_cache_threshold</code>.</p>
<p>
Setting the <code>:time</code> limit resets the elapsed time to zero in the pixel cache. Call it before any operation that you need to set a time limit
on.
</p>
</div>
<div class="sig">
<h3 id="set_cache_threshold">set_cache_threshold</h3>
<p>Magick.set_cache_threshold(<span class="arg">threshold</span>)</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>
Set the amount of free memory allocated for the pixel cache. Once this threshold is exceeded, all subsequent pixels cache operations are to/from disk.
</p>
<h4>Argument</h4>
<p>A number of megabytes to set.</p>
</div>
<div class="sig">
<h3 id="set_log_event_mask">set_log_event_mask</h3>
<p>Magick.set_log_event_mask(<span class="arg">event_list</span>)</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Specify which events to log.</p>
<h4>Argument</h4>
<p>A string composed of one or more of the following event types. If more than one event type is specified, separate the event types with commas.</p>
<p>
<code>All, Annotate, Blob, Cache, Coder, Configure, Deprecate, Draw, Exception, Locale, Module, None, Resource, Trace, Transform, User, Wand, X11</code>
</p>
<h4>Example</h4>
<pre>
Magick.set_log_event_mask("Module,Coder")
</pre
>
<h4>Magick API</h4>
<p>SetLogEventMask</p>
<h4>See also</h4>
<p><a href="#set_log_format">set_log_format</a></p>
<h4>Log configuration</h4>
<p>
Magick logging is configured with the log.xml file in Magick's config directory. See
<a href="https://imagemagick.org/script/resources.php">Resources</a> in the ImageMagick documentation for more information.
</p>
<p>Use this command to find out about the current log configuration.</p>
<pre>
convert -list log
</pre
>
</div>
<div class="sig">
<h3 id="set_log_format">set_log_format</h3>
<p>Magick.set_log_format(<span class="arg">format</span>)</p>
</div>
<div class="desc">
<h4>Description</h4>
<p>Specify the event log format.</p>
<h4>Argument</h4>
<p>A fprintf-like format string composed of optional "normal" text (to which no meaning is assigned) and the following format characters:</p>
<dl>
<dt>%d</dt>
<dd>domain</dd>
<dt>%e</dt>
<dd>event</dd>
<dt>%f</dt>
<dd>function</dd>
<dt>%l</dt>
<dd>line</dd>
<dt>%m</dt>
<dd>module</dd>
<dt>%p</dt>
<dd>process ID</dd>
<dt>%r</dt>
<dd>read CPU time</dd>
<dt>%t</dt>
<dd>wall clock time</dd>
<dt>%u</dt>
<dd>user CPU time</dd>
<dt>%%</dt>
<dd>percent sign</dd>
<dt>\n</dt>
<dd>newline</dd>
<dt>\r</dt>
<dd>carriage return</dd>
</dl>
</div>
<p class="spacer"> </p>
<div class="nav">« <a href="comtasks.html">Prev</a> | <a href="index.html">Contents</a> | <a href="ilist.html">Next</a> »</div>
</body>
</html>
|