blob: de1b80831c73a3b35779cc5cf3b9cadfd3046dac [file] [log] [blame]
cristy91469932014-07-25 11:00:25 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html version="-//W3C//DTD XHTML 1.1//EN"
4 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
5 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 xsi:schemaLocation="http://www.w3.org/1999/xhtml
7 http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
cristy06f63f22012-10-31 00:50:07 +00008<head>
cristy91469932014-07-25 11:00:25 +00009 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
10 <meta name=viewport content="width=device-width, initial-scale=0.3333334">
11 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"/>
cristyffb69ed2010-12-25 00:06:48 +000012 <title>ImageMagick: MagickCore, C API for ImageMagick: Monitor or Limit Resource Consumption</title>
cristy91469932014-07-25 11:00:25 +000013 <meta http-equiv="content-language" content="en-US"/>
14 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
15 <meta http-equiv="reply-to" content="magick-users@imagemagick.org"/>
16 <meta name="application-name" content="ImageMagick"/>
17 <meta name="description" content="A collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats."/>
18 <meta name="application-url" content="http://www.imagemagick.org"/>
19 <meta name="generator" content="PHP"/>
20 <meta name="keywords" content="magickcore, c, api, for, imagemagick:, monitor, or, limit, resource, consumption, convert, edit, compose, image, pixel"/>
21 <meta name="rating" content="GENERAL"/>
22 <meta name="robots" content="INDEX, FOLLOW"/>
23 <meta name="generator" content="ImageMagick Studio LLC"/>
24 <meta name="author" content="ImageMagick Studio LLC"/>
25 <meta name="revisit-after" content="2 DAYS"/>
26 <meta name="resource-type" content="document"/>
27 <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"/>
28 <meta name="distribution" content="Global"/>
29 <link rel="icon" href="../../images/wand.png"/>
30 <link rel="shortcut icon" href="../../images/wand.ico" type="images/x-icon"/>
31 <link rel="canonical" href="http://www.imagemagick.org" />
32 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
cristy8ee7f242013-06-20 16:08:44 +000033
34 <!-- Add jQuery library -->
cristy91469932014-07-25 11:00:25 +000035 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
cristy8ee7f242013-06-20 16:08:44 +000036
37 <!-- Add mousewheel plugin (this is optional) -->
38 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
39
40 <!-- Add fancyBox -->
cristy91469932014-07-25 11:00:25 +000041 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
42 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
cristy8ee7f242013-06-20 16:08:44 +000043
44 <!-- Optionally add helpers - button, thumbnail and/or media -->
cristy91469932014-07-25 11:00:25 +000045 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />
46 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
47 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
cristy8ee7f242013-06-20 16:08:44 +000048
cristy91469932014-07-25 11:00:25 +000049 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
50 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
cristy8ee7f242013-06-20 16:08:44 +000051
cristy72da67d2013-02-24 21:40:48 +000052 <script type="text/javascript">
cristy8ee7f242013-06-20 16:08:44 +000053 $(document).ready(function() {
54 $(".fancybox").fancybox();
55 });
cristy72da67d2013-02-24 21:40:48 +000056 </script>
cristy8ee7f242013-06-20 16:08:44 +000057
58 <!-- ImageMagick style -->
59 <style type="text/css" media="all">
60 @import url("../../www/magick.css");
61 </style>
cristy06f63f22012-10-31 00:50:07 +000062</head>
63
64<body id="www-imagemagick-org">
cristy8ee7f242013-06-20 16:08:44 +000065
cristy91469932014-07-25 11:00:25 +000066<script type="text/javascript">
67 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
68 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
69 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
70 })(window,document,'offline-script','//www.google-analytics.com/analytics.js','ga');
cristy8ee7f242013-06-20 16:08:44 +000071
cristy91469932014-07-25 11:00:25 +000072 ga('create', 'UA-40133312-1', 'imagemagick.org');
73 ga('send', 'pageview');
74</script>
cristy8ee7f242013-06-20 16:08:44 +000075
cristy06f63f22012-10-31 00:50:07 +000076<div class="titlebar">
77<div style="margin: 17px auto; float: left;">
78 <script type="text/javascript">
79 <!--
80 google_ad_client = "pub-3129977114552745";
81 google_ad_slot = "5439289906";
82 google_ad_width = 728;
83 google_ad_height = 90;
84 //-->
85 </script>
cristy91469932014-07-25 11:00:25 +000086 <script type="text/javascript"
87 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
88 </script>
cristy06f63f22012-10-31 00:50:07 +000089</div>
cristy417eeb12013-07-28 18:48:22 +000090<a href="../../discourse-server">
cristy91469932014-07-25 11:00:25 +000091 <img src="../../images/logo.jpg"
92 alt="ImageMagick Logo" width="123" height="118"
93 style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
cristyf1b8a092014-02-20 15:46:11 +000094<a href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">
cristy91469932014-07-25 11:00:25 +000095 <img src="../../images/sprite.jpg"
96 alt="ImageMagick Sprite" width="114" height="118"
97 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
cristy06f63f22012-10-31 00:50:07 +000098</div>
99
100<div class="westbar">
101
cristy3ed852e2009-09-05 21:47:34 +0000102<div class="menu">
cristyf1b8a092014-02-20 15:46:11 +0000103 <a title="About ImageMagick" href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">About ImageMagick</a>
cristy3ed852e2009-09-05 21:47:34 +0000104</div>
cristy3ed852e2009-09-05 21:47:34 +0000105<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000106 <a title="Binary Releases" href="../../www/binary-releases.html">Binary Releases</a>
cristybb503372010-05-27 20:51:26 +0000107</div>
108<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000109 <a title="Binary Release: Unix" href="../../www/binary-releases.html#unix">Unix</a>
cristybb503372010-05-27 20:51:26 +0000110</div>
111<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000112 <a title="Binary Release: MacOS X" href="../../www/binary-releases.html#macosx">Mac OS X</a>
cristybb503372010-05-27 20:51:26 +0000113</div>
114<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000115 <a title="Binary Release: iOS" href="../../www/binary-releases.html#iOS">iOS</a>
cristyda16f162011-02-19 23:52:17 +0000116</div>
117<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000118 <a title="Binary Release: Windows" href="../../www/binary-releases.html#windows">Windows</a>
cristybb503372010-05-27 20:51:26 +0000119</div>
cristy06f63f22012-10-31 00:50:07 +0000120<div class="sep"></div>
cristybb503372010-05-27 20:51:26 +0000121<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000122 <a title="Command-line Tools" href="../../www/command-line-tools.html">Command-line Tools</a>
cristy3ed852e2009-09-05 21:47:34 +0000123</div>
124<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000125 <a title="Command-line Tools: Processing" href="../../www/command-line-processing.html">Processing</a>
cristy3ed852e2009-09-05 21:47:34 +0000126</div>
127<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000128 <a title="Command-line Tools: Options" href="../../www/command-line-options.html">Options</a>
cristy3ed852e2009-09-05 21:47:34 +0000129</div>
130<div class="sub">
cristy83a272e2010-05-07 20:40:35 +0000131 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
cristy3ed852e2009-09-05 21:47:34 +0000132</div>
133<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000134 <a title="Program Interfaces" href="../../www/api.html">Program Interfaces</a>
cristy3ed852e2009-09-05 21:47:34 +0000135</div>
136<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000137 <a title="Program Interface: MagickWand" href="../../www/magick-wand.html">MagickWand</a>
cristy3ed852e2009-09-05 21:47:34 +0000138</div>
139<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000140 <a title="Program Interface: MagickCore" href="../../www/magick-core.html">MagickCore</a>
cristy3ed852e2009-09-05 21:47:34 +0000141</div>
142<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000143 <a title="Program Interface: PerlMagick" href="../../www/perl-magick.html">PerlMagick</a>
cristy3ed852e2009-09-05 21:47:34 +0000144</div>
145<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000146 <a title="Program Interface: Magick++" href="../../www/magick++.html">Magick++</a>
cristy3ed852e2009-09-05 21:47:34 +0000147</div>
cristy06f63f22012-10-31 00:50:07 +0000148<div class="sep"></div>
cristy91469932014-07-25 11:00:25 +0000149<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000150 <a title="Install from Source" href="../../www/install-source.html">Install from Source</a>
cristy3ed852e2009-09-05 21:47:34 +0000151</div>
152<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000153 <a title="Install from Source: Unix" href="../../www/install-source.html#unix">Unix</a>
cristy3ed852e2009-09-05 21:47:34 +0000154</div>
155<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000156 <a title="Install from Source: Windows" href="../../www/install-source.html#windows">Windows</a>
cristy3ed852e2009-09-05 21:47:34 +0000157 </div>
158<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000159 <a title="Resources" href="../../www/resources.html">Resources</a>
cristy3ed852e2009-09-05 21:47:34 +0000160</div>
cristybb503372010-05-27 20:51:26 +0000161<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000162 <a title="Architecture" href="../../www/architecture.html">Architecture</a>
cristybb503372010-05-27 20:51:26 +0000163</div>
cristy3ed852e2009-09-05 21:47:34 +0000164<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000165 <a title="Download" href="../../www/download.html">Download</a>
cristy3ed852e2009-09-05 21:47:34 +0000166</div>
cristy06f63f22012-10-31 00:50:07 +0000167<div class="sep"></div>
cristy3ed852e2009-09-05 21:47:34 +0000168<div class="menu">
cristy3dfa2192013-02-24 22:46:05 +0000169 <a title="Search" href="http://www.imagemagick.org/script/search.php">Search</a>
cristy3ed852e2009-09-05 21:47:34 +0000170</div>
cristy06f63f22012-10-31 00:50:07 +0000171<div class="sep"></div>
cristy3ed852e2009-09-05 21:47:34 +0000172<div class="menu">
cristyd8833bf2013-02-24 22:14:53 +0000173 <a title="Site Map" href="../../www/sitemap.html">Site Map</a>
cristy3ed852e2009-09-05 21:47:34 +0000174</div>
cristy91469932014-07-25 11:00:25 +0000175<div class="sub">
cristyd8833bf2013-02-24 22:14:53 +0000176 <a title="Site Map: Links" href="../../www/links.html">Links</a>
cristy3ed852e2009-09-05 21:47:34 +0000177</div>
cristy06f63f22012-10-31 00:50:07 +0000178<div class="sep"></div>
cristy06f63f22012-10-31 00:50:07 +0000179</div>
180
181<div class="eastbar">
cristy91469932014-07-25 11:00:25 +0000182 <script type="text/javascript">
183 /* <![CDATA[ */
184 window.___gcfg = {
185 lang: 'en-US'
186 };
187
188 (function() {
189 var po = document.createElement('offline-script');
190 po.type = 'text/javascript';
191 po.async = true;
192 po.src = 'https://apis.google.com/js/plusone.js';
193 var script = document.getElementsByTagName('offline-script')[0];
194 script.parentNode.insertBefore(po, script);
195 })();
196 var gplusone = document.getElementById("gplusone");
197 gplusone.setAttribute("data-size","medium");
198 gplusone.setAttribute("data-count","true");
199 /* ]]> */
200 </script>
201 <script type="text/javascript">
202 /* <![CDATA[ */
203 (function() {
204 var po = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
205 po.type = 'text/javascript';
206 po.async = true;
207 po.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
208 var script = document.getElementsByTagName('offline-script')[0];
209 script.parentNode.insertBefore(po, script);
210 })();
211 /* ]]> */
212 </script>
cristyf1b8a092014-02-20 15:46:11 +0000213 <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.imagemagick.org/"></a></div>
cristy8ee7f242013-06-20 16:08:44 +0000214 <noscript>
215 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
cristy91469932014-07-25 11:00:25 +0000216 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0" /></a>
cristy8ee7f242013-06-20 16:08:44 +0000217 </noscript>
cristy91469932014-07-25 11:00:25 +0000218 <div class="g-plusone" data-size="standard" data-count="true"></div>
cristy06f63f22012-10-31 00:50:07 +0000219</div>
220
221<div class="main">
222
cristy20398432011-08-11 01:31:50 +0000223<h1>Module resource Methods</h1>
cristy91469932014-07-25 11:00:25 +0000224<p class="navigation-index">[<a href="resource.html#AcquireMagickResource">AcquireMagickResource</a> &#8226; <a href="resource.html#AcquireUniqueFileResource">AcquireUniqueFileResource</a> &#8226; <a href="resource.html#GetMagickResource">GetMagickResource</a> &#8226; <a href="resource.html#GetMagickResourceLimit">GetMagickResourceLimit</a> &#8226; <a href="resource.html#ListMagickResourceInfo">ListMagickResourceInfo</a> &#8226; <a href="resource.html#RelinquishMagickResource">RelinquishMagickResource</a> &#8226; <a href="resource.html#RelinquishUniqueFileResource">RelinquishUniqueFileResource</a> &#8226; <a href="resource.html#SetMagickResourceLimit">SetMagickResourceLimit</a>]</p>
cristy3ed852e2009-09-05 21:47:34 +0000225
cristy20398432011-08-11 01:31:50 +0000226<h2><a href="http://www.imagemagick.org/api/MagickCore/resource_8c.html" id="AcquireMagickResource">AcquireMagickResource</a></h2>
227<div class="doc-section">
228
229<p>AcquireMagickResource() acquires resources of the specified type. MagickFalse is returned if the specified resource is exhausted otherwise MagickTrue.</p>
230
231<p>The format of the AcquireMagickResource() method is:</p>
232
233<pre class="code">
234 MagickBooleanType AcquireMagickResource(const ResourceType type,
235 const MagickSizeType size)
236</pre>
237
238<p>A description of each parameter follows:</p>
239
240<h5>type</h5>
241<p>the type of resource.</p>
242
243<h5>size</h5>
244<p>the number of bytes needed from for this resource.</p>
245
246 </div>
247<h2><a href="http://www.imagemagick.org/api/MagickCore/resource_8c.html" id="AcquireUniqueFileResource">AcquireUniqueFileResource</a></h2>
248<div class="doc-section">
249
250<p>AcquireUniqueFileResource() returns a unique file name, and returns a file descriptor for the file open for reading and writing.</p>
251
252<p>The format of the AcquireUniqueFileResource() method is:</p>
253
254<pre class="code">
255 int AcquireUniqueFileResource(char *path)
256</pre>
257
258<p>A description of each parameter follows:</p>
259
260<h5> path</h5>
261<p>Specifies a pointer to an array of characters. The unique path name is returned in this array.</p>
262
263 </div>
264<h2><a href="http://www.imagemagick.org/api/MagickCore/resource_8c.html" id="GetMagickResource">GetMagickResource</a></h2>
265<div class="doc-section">
266
267<p>GetMagickResource() returns the specified resource.</p>
268
269<p>The format of the GetMagickResource() method is:</p>
270
271<pre class="code">
272 MagickSizeType GetMagickResource(const ResourceType type)
273</pre>
274
275<p>A description of each parameter follows:</p>
276
277<h5>type</h5>
278<p>the type of resource.</p>
279
280 </div>
281<h2><a href="http://www.imagemagick.org/api/MagickCore/resource_8c.html" id="GetMagickResourceLimit">GetMagickResourceLimit</a></h2>
282<div class="doc-section">
283
284<p>GetMagickResourceLimit() returns the specified resource limit.</p>
285
286<p>The format of the GetMagickResourceLimit() method is:</p>
287
288<pre class="code">
289 MagickSizeType GetMagickResourceLimit(const ResourceType type)
290</pre>
291
292<p>A description of each parameter follows:</p>
293
294<h5>type</h5>
295<p>the type of resource.</p>
296
297 </div>
298<h2><a href="http://www.imagemagick.org/api/MagickCore/resource_8c.html" id="ListMagickResourceInfo">ListMagickResourceInfo</a></h2>
299<div class="doc-section">
300
301<p>ListMagickResourceInfo() lists the resource info to a file.</p>
302
303<p>The format of the ListMagickResourceInfo method is:</p>
304
305<pre class="code">
306 MagickBooleanType ListMagickResourceInfo(FILE *file,
307 ExceptionInfo *exception)
308</pre>
309
310<p>A description of each parameter follows.</p>
311
312<h5>file</h5>
313<p>An pointer to a FILE.</p>
314
315<h5>exception</h5>
316<p>return any errors or warnings in this structure.</p>
317
318 </div>
319<h2><a href="http://www.imagemagick.org/api/MagickCore/resource_8c.html" id="RelinquishMagickResource">RelinquishMagickResource</a></h2>
320<div class="doc-section">
321
322<p>RelinquishMagickResource() relinquishes resources of the specified type.</p>
323
324<p>The format of the RelinquishMagickResource() method is:</p>
325
326<pre class="code">
327 void RelinquishMagickResource(const ResourceType type,
328 const MagickSizeType size)
329</pre>
330
331<p>A description of each parameter follows:</p>
332
333<h5>type</h5>
334<p>the type of resource.</p>
335
336<h5>size</h5>
337<p>the size of the resource.</p>
338
339 </div>
340<h2><a href="http://www.imagemagick.org/api/MagickCore/resource_8c.html" id="RelinquishUniqueFileResource">RelinquishUniqueFileResource</a></h2>
341<div class="doc-section">
342
343<p>RelinquishUniqueFileResource() relinquishes a unique file resource.</p>
344
345<p>The format of the RelinquishUniqueFileResource() method is:</p>
346
347<pre class="code">
348 MagickBooleanType RelinquishUniqueFileResource(const char *path)
349</pre>
350
351<p>A description of each parameter follows:</p>
352
353<h5>name</h5>
354<p>the name of the temporary resource.</p>
355
356 </div>
357<h2><a href="http://www.imagemagick.org/api/MagickCore/resource_8c.html" id="SetMagickResourceLimit">SetMagickResourceLimit</a></h2>
358<div class="doc-section">
359
360<p>SetMagickResourceLimit() sets the limit for a particular resource.</p>
361
362<p>The format of the SetMagickResourceLimit() method is:</p>
363
364<pre class="code">
365 MagickBooleanType SetMagickResourceLimit(const ResourceType type,
366 const MagickSizeType limit)
367</pre>
368
369<p>A description of each parameter follows:</p>
370
371<h5>type</h5>
372<p>the type of resource.</p>
373
374<h5>limit</h5>
375<p>the maximum limit for the resource.</p>
376
377 </div>
cristy06f63f22012-10-31 00:50:07 +0000378
379</div>
380
381<div id="linkbar">
cristyac1b4322013-07-28 13:58:06 +0000382 <span id="linkbar-west"> </span>
cristy8ee7f242013-06-20 16:08:44 +0000383
cristy06f63f22012-10-31 00:50:07 +0000384 <span id="linkbar-center">
cristy44cbd482013-08-04 20:53:36 +0000385 <a href="../../discourse-server">Discourse Server</a>
cristy91469932014-07-25 11:00:25 +0000386 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
cristy44cbd482013-08-04 20:53:36 +0000387 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
cristy8ee7f242013-06-20 16:08:44 +0000388 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
cristy06f63f22012-10-31 00:50:07 +0000389 </span>
cristyac1b4322013-07-28 13:58:06 +0000390 <span id="linkbar-east"> </span>
cristy44cbd482013-08-04 20:53:36 +0000391</div>
392<div class="footer">
cristy91469932014-07-25 11:00:25 +0000393 <span id="footer-west">© 1999-2014 ImageMagick Studio LLC</span>
cristy44cbd482013-08-04 20:53:36 +0000394 <span id="footer-east"> <a href="../../www/contact.html">Contact the Wizards</a></span>
395</div>
396<div style="clear: both; margin: 0; width: 100%; "></div>
cristy06f63f22012-10-31 00:50:07 +0000397</body>
398</html>