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
|
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.2: http://docutils.sourceforge.net/" />
<title>magick</title>
<link rel="stylesheet" href="../docutils-api.css" type="text/css" />
</head>
<body>
<div class="banner">
<img src="../images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" />
<span class="title">GraphicsMagick</span>
<form action="http://www.google.com/search">
<input type="hidden" name="domains" value="www.graphicsmagick.org" />
<input type="hidden" name="sitesearch" value="www.graphicsmagick.org" />
<span class="nowrap"><input type="text" name="q" size="25" maxlength="255" /> <input type="submit" name="sa" value="Search" /></span>
</form>
</div>
<div class="navmenu">
<ul>
<li><a href="../index.html">Home</a></li>
<li><a href="../project.html">Project</a></li>
<li><a href="../download.html">Download</a></li>
<li><a href="../README.html">Install</a></li>
<li><a href="../Hg.html">Source</a></li>
<li><a href="../NEWS.html">News</a> </li>
<li><a href="../utilities.html">Utilities</a></li>
<li><a href="../programming.html">Programming</a></li>
<li><a href="../reference.html">Reference</a></li>
</ul>
</div>
<div class="document" id="magick">
<h1 class="title">magick</h1>
<h2 class="subtitle" id="image-format-support-interfaces">Image format support interfaces</h2>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#destroymagick" id="id31">DestroyMagick</a></li>
<li><a class="reference internal" href="#destroymagickinfo" id="id32">DestroyMagickInfo</a></li>
<li><a class="reference internal" href="#destroymagickinfolist" id="id33">DestroyMagickInfoList</a></li>
<li><a class="reference internal" href="#getimagemagick" id="id34">GetImageMagick</a></li>
<li><a class="reference internal" href="#getmagickinfo" id="id35">GetMagickInfo</a></li>
<li><a class="reference internal" href="#getmagickinfoarray" id="id36">GetMagickInfoArray</a></li>
<li><a class="reference internal" href="#initializemagick" id="id37">InitializeMagick</a></li>
<li><a class="reference internal" href="#initializemagickex" id="id38">InitializeMagickEx</a></li>
<li><a class="reference internal" href="#ismagickconflict" id="id39">IsMagickConflict</a></li>
<li><a class="reference internal" href="#listmagickinfo" id="id40">ListMagickInfo</a></li>
<li><a class="reference internal" href="#listmodulemap" id="id41">ListModuleMap</a></li>
<li><a class="reference internal" href="#magicktomime" id="id42">MagickToMime</a></li>
<li><a class="reference internal" href="#registermagickinfo" id="id43">RegisterMagickInfo</a></li>
<li><a class="reference internal" href="#panicdestroymagick" id="id44">PanicDestroyMagick</a></li>
<li><a class="reference internal" href="#setmagickinfo" id="id45">SetMagickInfo</a></li>
<li><a class="reference internal" href="#unregistermagickinfo" id="id46">UnregisterMagickInfo</a></li>
</ul>
</div>
<div class="section" id="destroymagick">
<h1><a class="toc-backref" href="#id31">DestroyMagick</a></h1>
<div class="section" id="synopsis">
<h2>Synopsis</h2>
<pre class="literal-block">
DestroyMagick( void );
</pre>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>DestroyMagick() destroys the GraphicsMagick environment, releasing all
allocated semaphores, memory, and temporary files. This function
should be invoked in the primary (original) thread of the application's
process while shutting down, and only after any threads which might be
using GraphicsMagick functions have terminated. Since GraphicsMagick
uses threads internally via OpenMP, it is also necessary for any function
calls into GraphicsMagick to have already returned so that OpenMP worker
threads are quiesced and won't be accessing any semaphores or data
structures which are destroyed by this function.</p>
<p>The format of the DestroyMagick function is:</p>
<pre class="literal-block">
DestroyMagick( void );
</pre>
</div>
</div>
<div class="section" id="destroymagickinfo">
<h1><a class="toc-backref" href="#id32">DestroyMagickInfo</a></h1>
<div class="section" id="id1">
<h2>Synopsis</h2>
<pre class="literal-block">
void DestroyMagickInfo( <a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> ** magick_info );
</pre>
</div>
<div class="section" id="id2">
<h2>Description</h2>
<p>DestroyMagickInfo() destroys a MagickInfo structure.</p>
<p>The format of the DestroyMagickInfoList method is:</p>
<pre class="literal-block">
void DestroyMagickInfo( <a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> ** magick_info );
</pre>
</div>
</div>
<div class="section" id="destroymagickinfolist">
<h1><a class="toc-backref" href="#id33">DestroyMagickInfoList</a></h1>
<div class="section" id="id3">
<h2>Synopsis</h2>
<pre class="literal-block">
void DestroyMagickInfoList( void );
</pre>
</div>
<div class="section" id="id4">
<h2>Description</h2>
<p>DestroyMagickInfo() deallocates memory associated with the MagickInfo list.</p>
<p>The format of the DestroyMagickInfoList method is:</p>
<pre class="literal-block">
void DestroyMagickInfoList( void );
</pre>
</div>
</div>
<div class="section" id="getimagemagick">
<h1><a class="toc-backref" href="#id34">GetImageMagick</a></h1>
<div class="section" id="id5">
<h2>Synopsis</h2>
<pre class="literal-block">
const char *GetImageMagick( const unsigned char *magick, const size_t length );
</pre>
</div>
<div class="section" id="id6">
<h2>Description</h2>
<p>GetImageMagick() searches for an image format that matches the specified
magick string. If one is found the name is returned otherwise NULL.</p>
<p>The format of the GetImageMagick method is:</p>
<pre class="literal-block">
const char *GetImageMagick( const unsigned char *magick, const size_t length );
</pre>
<dl class="docutils">
<dt>magick:</dt>
<dd>The image format we are searching for.</dd>
<dt>length:</dt>
<dd>The length of the binary string.</dd>
</dl>
</div>
</div>
<div class="section" id="getmagickinfo">
<h1><a class="toc-backref" href="#id35">GetMagickInfo</a></h1>
<div class="section" id="id7">
<h2>Synopsis</h2>
<pre class="literal-block">
const <a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> *GetMagickInfo( const char *name, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
</div>
<div class="section" id="id8">
<h2>Description</h2>
<p>GetMagickInfo() returns a pointer MagickInfo structure that matches
the specified name. If name is NULL, the head of the image format list
is returned. It is not safe to traverse the list by using the previous and
next pointers in the MagickInfo structure since the list contents or order
may be altered while the list is being traversed. If the list must be
traversed, access it via the GetMagickInfoArray function instead.</p>
<p>If GraphicsMagick has not been initialized via InitializeMagick()
then this function will not work.</p>
<p>The format of the GetMagickInfo method is:</p>
<pre class="literal-block">
const <a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> *GetMagickInfo( const char *name, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
<p>A description of each parameter follows:</p>
<dl class="docutils">
<dt>name:</dt>
<dd>The image format we are looking for.</dd>
<dt>exception:</dt>
<dd>Return any errors or warnings in this structure.</dd>
</dl>
</div>
</div>
<div class="section" id="getmagickinfoarray">
<h1><a class="toc-backref" href="#id36">GetMagickInfoArray</a></h1>
<div class="section" id="id9">
<h2>Synopsis</h2>
<pre class="literal-block">
<a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> ** GetMagickInfoArray( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
</div>
<div class="section" id="id10">
<h2>Description</h2>
<p>GetMagickInfoArray() returns a sorted null-terminated array of MagickInfo
pointers corresponding to the available format registrations. If necessarly
all modules are loaded in order to return a complete list. This function
should be used to access the entire list rather than GetMagickInfo since
the list returned by GetMagickInfo may be re-ordered every time it is
invoked. Once the returned array is no longer needed, the allocated array
should be deallocated. Do not attempt to deallocate the MagickInfo
structures based on pointers in the array!</p>
<p>The format of the GetMagickList method is:</p>
<pre class="literal-block">
<a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> ** GetMagickInfoArray( <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
<p>A description of each parameter follows:</p>
<dl class="docutils">
<dt>exception:</dt>
<dd>Return any errors or warnings in this structure.</dd>
</dl>
</div>
</div>
<div class="section" id="initializemagick">
<h1><a class="toc-backref" href="#id37">InitializeMagick</a></h1>
<div class="section" id="id11">
<h2>Synopsis</h2>
<pre class="literal-block">
InitializeMagick( const char *path );
</pre>
</div>
<div class="section" id="id12">
<h2>Description</h2>
<p>InitializeMagick() initializes the GraphicsMagick environment.</p>
<p>InitializeMagick() or InitializeMagickEx() MUST be invoked by the using
program before making use of GraphicsMagick functions or else the library
will be unusable and any usage is likely to cause a crash.</p>
<p>This function should be invoked in the primary (original) thread of the
application's process, and before starting any OpenMP threads, as part
of program initialization.</p>
<p>If alternate memory allocations are provided via MagickAllocFunctions()
then that function should be invoked before InitializeMagickEx() since
the memory allocation functions need to be consistent.</p>
<p>The format of the InitializeMagick function is:</p>
<pre class="literal-block">
InitializeMagick( const char *path );
</pre>
<p>A description of each parameter follows:</p>
<dl class="docutils">
<dt>path:</dt>
<dd>The execution path of the current GraphicsMagick client (or NULL)</dd>
</dl>
</div>
</div>
<div class="section" id="initializemagickex">
<h1><a class="toc-backref" href="#id38">InitializeMagickEx</a></h1>
<div class="section" id="id13">
<h2>Synopsis</h2>
<pre class="literal-block">
MagickPassFail InitializeMagickEx( const char *path, unsigned int options,
<a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
</div>
<div class="section" id="id14">
<h2>Description</h2>
<p>InitializeMagickEx() initializes the GraphicsMagick environment,
providing a bit more more control and visibility over initialization
than the original InitializeMagick().</p>
<p>InitializeMagick() or InitializeMagickEx() MUST be invoked by the using
program before making use of GraphicsMagick functions or else the library
will be unusable and any usage is likely to cause a crash.</p>
<p>This function should be invoked in the primary (original) thread of the
application's process, and before starting any OpenMP threads, as part
of program initialization.</p>
<p>If alternate memory allocations are provided via MagickAllocFunctions()
then that function should be invoked before InitializeMagickEx() since
the memory allocation functions need to be consistent.</p>
<p>The format of the InitializeMagickEx function is:</p>
<pre class="literal-block">
MagickPassFail InitializeMagickEx( const char *path, unsigned int options,
<a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
<dl class="docutils">
<dt>path:</dt>
<dd>The execution path of the current GraphicsMagick client (or NULL)</dd>
<dt>options:</dt>
<dd>Options flags tailoring initializations performed</dd>
<dt>exception:</dt>
<dd>Information about initialization failure is reported here.</dd>
</dl>
</div>
</div>
<div class="section" id="ismagickconflict">
<h1><a class="toc-backref" href="#id39">IsMagickConflict</a></h1>
<div class="section" id="id15">
<h2>Synopsis</h2>
<pre class="literal-block">
MagickBool IsMagickConflict( const char *magick );
</pre>
</div>
<div class="section" id="id16">
<h2>Description</h2>
<p>Method IsMagickConflict returns true if the image format conflicts with
a logical drive (.e.g. X:).</p>
<p>The format of the IsMagickConflict method is:</p>
<pre class="literal-block">
MagickBool IsMagickConflict( const char *magick );
</pre>
<p>A description of each parameter follows:</p>
<dl class="docutils">
<dt>status:</dt>
<dd>Method IsMagickConflict returns true if the image format
conflicts with a logical drive.</dd>
<dt>magick:</dt>
<dd>Specifies the image format.</dd>
</dl>
</div>
</div>
<div class="section" id="listmagickinfo">
<h1><a class="toc-backref" href="#id40">ListMagickInfo</a></h1>
<div class="section" id="id17">
<h2>Synopsis</h2>
<pre class="literal-block">
MagickPassFail ListMagickInfo( FILE *file, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
</div>
<div class="section" id="id18">
<h2>Description</h2>
<p>ListMagickInfo() lists the image formats to a file.</p>
<p>The format of the ListMagickInfo method is:</p>
<pre class="literal-block">
MagickPassFail ListMagickInfo( FILE *file, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
<p>A description of each parameter follows.</p>
<dl class="docutils">
<dt>file:</dt>
<dd>A file handle.</dd>
<dt>exception:</dt>
<dd>Return any errors or warnings in this structure.</dd>
</dl>
</div>
</div>
<div class="section" id="listmodulemap">
<h1><a class="toc-backref" href="#id41">ListModuleMap</a></h1>
<div class="section" id="id19">
<h2>Synopsis</h2>
<pre class="literal-block">
MagickPassFail ListModuleMap( FILE *file, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
</div>
<div class="section" id="id20">
<h2>Description</h2>
<p>Method ListModuleMap lists the module alias info to a file in the XML
format used by modules.mgk. True is returned on success.</p>
<p>The format of the ListModuleMap method is:</p>
<pre class="literal-block">
MagickPassFail ListModuleMap( FILE *file, <a class="reference external" href="../api/types.html#exceptioninfo">ExceptionInfo</a> *exception );
</pre>
<p>A description of each parameter follows.</p>
<dl class="docutils">
<dt>file:</dt>
<dd>An pointer to a FILE.</dd>
<dt>exception:</dt>
<dd>Return any errors or warnings in this structure.</dd>
</dl>
</div>
</div>
<div class="section" id="magicktomime">
<h1><a class="toc-backref" href="#id42">MagickToMime</a></h1>
<div class="section" id="id21">
<h2>Synopsis</h2>
<pre class="literal-block">
char *MagickToMime( const char *magick );
</pre>
</div>
<div class="section" id="id22">
<h2>Description</h2>
<p>Method MagickToMime returns the officially registered (or de facto) MIME
media-type corresponding to a magick string. If there is no registered
media-type, then the string "image/x-magick" (all lower case) is returned.
The returned string must be deallocated by the user.</p>
<p>The format of the MagickToMime method is:</p>
<pre class="literal-block">
char *MagickToMime( const char *magick );
</pre>
<p>A description of each parameter follows.</p>
<dl class="docutils">
<dt>magick:</dt>
<dd>GraphicsMagick format specification "magick" tag.</dd>
</dl>
</div>
</div>
<div class="section" id="registermagickinfo">
<h1><a class="toc-backref" href="#id43">RegisterMagickInfo</a></h1>
<div class="section" id="id23">
<h2>Synopsis</h2>
<pre class="literal-block">
<a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> *RegisterMagickInfo( <a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> *magick_info );
</pre>
</div>
<div class="section" id="id24">
<h2>Description</h2>
<p>RegisterMagickInfo() adds attributes for a particular image format to the
list of supported formats. The attributes include the image format name,
a method to read and/or write the format, whether the format supports the
saving of more than one frame to the same file or blob, whether the format
supports native in-memory I/O, and a brief description of the format.</p>
<p>The format of the RegisterMagickInfo method is:</p>
<pre class="literal-block">
<a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> *RegisterMagickInfo( <a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> *magick_info );
</pre>
<p>A description of each parameter follows:</p>
<dl class="docutils">
<dt>magick_info:</dt>
<dd>The magick info.</dd>
</dl>
</div>
</div>
<div class="section" id="panicdestroymagick">
<h1><a class="toc-backref" href="#id44">PanicDestroyMagick</a></h1>
<div class="section" id="id25">
<h2>Synopsis</h2>
<pre class="literal-block">
void PanicDestroyMagick( void );
</pre>
</div>
<div class="section" id="id26">
<h2>Description</h2>
<p>PanicDestroyMagick() destroys only persistent allocations such as
temporary files. Other allocations (e.g. semaphores and heap memory)
remain allocated. This function is an alternative to DestroyMagick()
which is async-safe so it may be invoked from signal handers, and
may be invoked from thread context. No semaphores are taken and no
additional heap memory is allocated by this function. The program
must quit immediately after invoking this function.</p>
<p>The format of the PanicDestroyMagick function is:</p>
<pre class="literal-block">
void PanicDestroyMagick( void );
</pre>
</div>
</div>
<div class="section" id="setmagickinfo">
<h1><a class="toc-backref" href="#id45">SetMagickInfo</a></h1>
<div class="section" id="id27">
<h2>Synopsis</h2>
<pre class="literal-block">
<a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> *SetMagickInfo( const char *name );
</pre>
</div>
<div class="section" id="id28">
<h2>Description</h2>
<p>Method SetMagickInfo allocates a MagickInfo structure and initializes the
members to default values.</p>
<p>The format of the SetMagickInfo method is:</p>
<pre class="literal-block">
<a class="reference external" href="../api/types.html#magickinfo">MagickInfo</a> *SetMagickInfo( const char *name );
</pre>
<p>A description of each parameter follows:</p>
<dl class="docutils">
<dt>magick_info:</dt>
<dd>Method SetMagickInfo returns the allocated and initialized
MagickInfo structure.</dd>
<dt>name:</dt>
<dd>a character string that represents the image format associated
with the MagickInfo structure.</dd>
</dl>
</div>
</div>
<div class="section" id="unregistermagickinfo">
<h1><a class="toc-backref" href="#id46">UnregisterMagickInfo</a></h1>
<div class="section" id="id29">
<h2>Synopsis</h2>
<pre class="literal-block">
unsigned int UnregisterMagickInfo( const char *name );
</pre>
</div>
<div class="section" id="id30">
<h2>Description</h2>
<p>Method UnregisterMagickInfo removes a name from the magick info list. It
returns MagickFail if the name does not exist in the list otherwise
MagickPass.</p>
<p>The format of the UnregisterMagickInfo method is:</p>
<pre class="literal-block">
unsigned int UnregisterMagickInfo( const char *name );
</pre>
<p>A description of each parameter follows:</p>
<dl class="docutils">
<dt>status:</dt>
<dd>Method UnregisterMagickInfo returns False if the name does not
exist in the list otherwise True.</dd>
<dt>name:</dt>
<dd>a character string that represents the image format we are
looking for.</dd>
</dl>
</div>
</div>
</div>
</body>
</html>
|