1
2
3
4
5<!DOCTYPE html>
6<html lang="en">
7<head>
8    <title>ImageMagick: MagickCore, C API for ImageMagick: Image View Methods</title>
9  <meta charset="utf-8" />
10  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
11  <meta name="viewport" content="width=device-width, initial-scale=1" />
12  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
13  <meta name="application-name" content="ImageMagick"/>
14  <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves."/>
15  <meta name="application-url" content="http://www.imagemagick.org"/>
16  <meta name="generator" content="PHP"/>
17  <meta name="keywords" content="magickcore, c, api, for, imagemagick:, image, view, methods, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
18  <meta name="rating" content="GENERAL"/>
19  <meta name="robots" content="INDEX, FOLLOW"/>
20  <meta name="generator" content="ImageMagick Studio LLC"/>
21  <meta name="author" content="ImageMagick Studio LLC"/>
22  <meta name="revisit-after" content="2 DAYS"/>
23  <meta name="resource-type" content="document"/>
24  <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/>
25  <meta name="distribution" content="Global"/>
26  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
27  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
28  <link rel="icon" href="../images/wand.png"/>
29  <link rel="shortcut icon" href="../images/wand.ico"/>
30  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:900,400,400italic,700,700italic,300,300italic|Open+Sans:300italic,400italic,700italic,300,400,600,700">
31  <link rel="stylesheet" href="../css/magick.html"/>
32</head>
33<body>
34<div class="main">
35<div class="magick-masthead">
36  <div class="container">
37    <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
38         style="display:block"
39         data-ad-client="ca-pub-3129977114552745"
40         data-ad-slot="6345125851"
41         data-ad-format="auto"></ins>
42    <script>
43      (adsbygoogle = window.adsbygoogle || []).push({});
44    </script>
45    <nav class="magick-nav">
46      <a class="magick-nav-item " href="../index.html">Home</a>
47      <a class="magick-nav-item " href="../binary-releases.html">Download</a>
48      <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
49      <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a>
50      <a class="magick-nav-item " href="../resources.html">Resources</a>
51      <a class="magick-nav-item " href="api.html">Develop</a>
52      <a class="magick-nav-item " href="http://www.imagemagick.org/script/search.php">Search</a>
53      <a class="magick-nav-item pull-right" href="https://www.imagemagick.org/discourse-server/">Community</a>
54    </nav>
55  </div>
56</div>
57<div class="container">
58<div class="magick-header">
59<p class="text-center"><a href="image-view.html#CloneImageView">CloneImageView</a> &#8226; <a href="image-view.html#DestroyImageView">DestroyImageView</a> &#8226; <a href="image-view.html#DuplexTransferImageViewIterator">DuplexTransferImageViewIterator</a> &#8226; <a href="image-view.html#GetImageViewAuthenticMetacontent">GetImageViewAuthenticMetacontent</a> &#8226; <a href="image-view.html#GetImageViewAuthenticPixels">GetImageViewAuthenticPixels</a> &#8226; <a href="image-view.html#GetImageViewException">GetImageViewException</a> &#8226; <a href="image-view.html#GetImageViewExtent">GetImageViewExtent</a> &#8226; <a href="image-view.html#GetImageViewImage">GetImageViewImage</a> &#8226; <a href="image-view.html#GetImageViewIterator">GetImageViewIterator</a> &#8226; <a href="image-view.html#GetImageViewVirtualMetacontent">GetImageViewVirtualMetacontent</a> &#8226; <a href="image-view.html#GetImageViewVirtualPixels">GetImageViewVirtualPixels</a> &#8226; <a href="image-view.html#IsImageView">IsImageView</a> &#8226; <a href="image-view.html#NewImageView">NewImageView</a> &#8226; <a href="image-view.html#NewImageViewRegion">NewImageViewRegion</a> &#8226; <a href="image-view.html#SetImageViewDescription">SetImageViewDescription</a> &#8226; <a href="image-view.html#SetImageViewIterator">SetImageViewIterator</a> &#8226; <a href="image-view.html#TransferImageViewIterator">TransferImageViewIterator</a> &#8226; <a href="image-view.html#UpdateImageViewIterator">UpdateImageViewIterator</a></p>
60
61<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="CloneImageView">CloneImageView</a></h2>
62
63<p>CloneImageView() makes a copy of the specified image view.</p>
64
65<p>The format of the CloneImageView method is:</p>
66
67<pre class="text">
68ImageView *CloneImageView(const ImageView *image_view)
69</pre>
70
71<p>A description of each parameter follows:</p>
72
73<dd>
74</dd>
75
76<dd> </dd>
77<dl class="dl-horizontal">
78<dt>image_view</dt>
79<dd>the image view. </dd>
80
81<dd>  </dd>
82</dl>
83<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="DestroyImageView">DestroyImageView</a></h2>
84
85<p>DestroyImageView() deallocates memory associated with a image view.</p>
86
87<p>The format of the DestroyImageView method is:</p>
88
89<pre class="text">
90ImageView *DestroyImageView(ImageView *image_view)
91</pre>
92
93<p>A description of each parameter follows:</p>
94
95<dd>
96</dd>
97
98<dd> </dd>
99<dl class="dl-horizontal">
100<dt>image_view</dt>
101<dd>the image view. </dd>
102
103<dd>  </dd>
104</dl>
105<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="DuplexTransferImageViewIterator">DuplexTransferImageViewIterator</a></h2>
106
107<p>DuplexTransferImageViewIterator() iterates over three image views in parallel and calls your transfer method for each scanline of the view.  The source and duplex pixel extent is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension.  However, the destination image view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.</p>
108
109<p>The callback signature is:</p>
110
111<pre class="text">
112MagickBooleanType DuplexTransferImageViewMethod(const ImageView *source,
113  const ImageView *duplex,ImageView *destination,const ssize_t y,
114  const int thread_id,void *context)
115</pre>
116
117<p>Use this pragma if the view is not single threaded:</p>
118
119<pre class="text">
120    #pragma omp critical
121</pre>
122
123<p>to define a section of code in your callback transfer method that must be executed by a single thread at a time.</p>
124
125<p>The format of the DuplexTransferImageViewIterator method is:</p>
126
127<pre class="text">
128MagickBooleanType DuplexTransferImageViewIterator(ImageView *source,
129  ImageView *duplex,ImageView *destination,
130  DuplexTransferImageViewMethod transfer,void *context)
131</pre>
132
133<p>A description of each parameter follows:</p>
134
135<dd>
136</dd>
137
138<dd> </dd>
139<dl class="dl-horizontal">
140<dt>source</dt>
141<dd>the source image view. </dd>
142
143<dd> </dd>
144<dt>duplex</dt>
145<dd>the duplex image view. </dd>
146
147<dd> </dd>
148<dt>destination</dt>
149<dd>the destination image view. </dd>
150
151<dd> </dd>
152<dt>transfer</dt>
153<dd>the transfer callback method. </dd>
154
155<dd> </dd>
156<dt>context</dt>
157<dd>the user defined context. </dd>
158
159<dd>  </dd>
160</dl>
161<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="GetImageViewAuthenticMetacontent">GetImageViewAuthenticMetacontent</a></h2>
162
163<p>GetImageViewAuthenticMetacontent() returns the image view authentic meta-content.</p>
164
165<p>The format of the GetImageViewAuthenticPixels method is:</p>
166
167<pre class="text">
168void *GetImageViewAuthenticMetacontent(
169  const ImageView *image_view)
170</pre>
171
172<p>A description of each parameter follows:</p>
173
174<dd>
175</dd>
176
177<dd> </dd>
178<dl class="dl-horizontal">
179<dt>image_view</dt>
180<dd>the image view. </dd>
181
182<dd>  </dd>
183</dl>
184<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="GetImageViewAuthenticPixels">GetImageViewAuthenticPixels</a></h2>
185
186<p>GetImageViewAuthenticPixels() returns the image view authentic pixels.</p>
187
188<p>The format of the GetImageViewAuthenticPixels method is:</p>
189
190<pre class="text">
191Quantum *GetImageViewAuthenticPixels(const ImageView *image_view)
192</pre>
193
194<p>A description of each parameter follows:</p>
195
196<dd>
197</dd>
198
199<dd> </dd>
200<dl class="dl-horizontal">
201<dt>image_view</dt>
202<dd>the image view. </dd>
203
204<dd>  </dd>
205</dl>
206<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="GetImageViewException">GetImageViewException</a></h2>
207
208<p>GetImageViewException() returns the severity, reason, and description of any error that occurs when utilizing a image view.</p>
209
210<p>The format of the GetImageViewException method is:</p>
211
212<pre class="text">
213char *GetImageViewException(const PixelImage *image_view,
214  ExceptionType *severity)
215</pre>
216
217<p>A description of each parameter follows:</p>
218
219<dd>
220</dd>
221
222<dd> </dd>
223<dl class="dl-horizontal">
224<dt>image_view</dt>
225<dd>the pixel image_view. </dd>
226
227<dd> </dd>
228<dt>severity</dt>
229<dd>the severity of the error is returned here. </dd>
230
231<dd>  </dd>
232</dl>
233<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="GetImageViewExtent">GetImageViewExtent</a></h2>
234
235<p>GetImageViewExtent() returns the image view extent.</p>
236
237<p>The format of the GetImageViewExtent method is:</p>
238
239<pre class="text">
240RectangleInfo GetImageViewExtent(const ImageView *image_view)
241</pre>
242
243<p>A description of each parameter follows:</p>
244
245<dd>
246</dd>
247
248<dd> </dd>
249<dl class="dl-horizontal">
250<dt>image_view</dt>
251<dd>the image view. </dd>
252
253<dd>  </dd>
254</dl>
255<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="GetImageViewImage">GetImageViewImage</a></h2>
256
257<p>GetImageViewImage() returns the image associated with the image view.</p>
258
259<p>The format of the GetImageViewImage method is:</p>
260
261<pre class="text">
262MagickCore *GetImageViewImage(const ImageView *image_view)
263</pre>
264
265<p>A description of each parameter follows:</p>
266
267<dd>
268</dd>
269
270<dd> </dd>
271<dl class="dl-horizontal">
272<dt>image_view</dt>
273<dd>the image view. </dd>
274
275<dd>  </dd>
276</dl>
277<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="GetImageViewIterator">GetImageViewIterator</a></h2>
278
279<p>GetImageViewIterator() iterates over the image view in parallel and calls your get method for each scanline of the view.  The pixel extent is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension.  Any updates to the pixels in your callback are ignored.</p>
280
281<p>The callback signature is:</p>
282
283<pre class="text">
284MagickBooleanType GetImageViewMethod(const ImageView *source,
285  const ssize_t y,const int thread_id,void *context)
286</pre>
287
288<p>Use this pragma if the view is not single threaded:</p>
289
290<pre class="text">
291    #pragma omp critical
292</pre>
293
294<p>to define a section of code in your callback get method that must be executed by a single thread at a time.</p>
295
296<p>The format of the GetImageViewIterator method is:</p>
297
298<pre class="text">
299MagickBooleanType GetImageViewIterator(ImageView *source,
300  GetImageViewMethod get,void *context)
301</pre>
302
303<p>A description of each parameter follows:</p>
304
305<dd>
306</dd>
307
308<dd> </dd>
309<dl class="dl-horizontal">
310<dt>source</dt>
311<dd>the source image view. </dd>
312
313<dd> </dd>
314<dt>get</dt>
315<dd>the get callback method. </dd>
316
317<dd> </dd>
318<dt>context</dt>
319<dd>the user defined context. </dd>
320
321<dd>  </dd>
322</dl>
323<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="GetImageViewVirtualMetacontent">GetImageViewVirtualMetacontent</a></h2>
324
325<p>GetImageViewVirtualMetacontent() returns the image view virtual meta-content.</p>
326
327<p>The format of the GetImageViewVirtualMetacontent method is:</p>
328
329<pre class="text">
330const void *GetImageViewVirtualMetacontent(
331  const ImageView *image_view)
332</pre>
333
334<p>A description of each parameter follows:</p>
335
336<dd>
337</dd>
338
339<dd> </dd>
340<dl class="dl-horizontal">
341<dt>image_view</dt>
342<dd>the image view. </dd>
343
344<dd>  </dd>
345</dl>
346<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="GetImageViewVirtualPixels">GetImageViewVirtualPixels</a></h2>
347
348<p>GetImageViewVirtualPixels() returns the image view virtual pixels.</p>
349
350<p>The format of the GetImageViewVirtualPixels method is:</p>
351
352<pre class="text">
353const Quantum *GetImageViewVirtualPixels(const ImageView *image_view)
354</pre>
355
356<p>A description of each parameter follows:</p>
357
358<dd>
359</dd>
360
361<dd> </dd>
362<dl class="dl-horizontal">
363<dt>image_view</dt>
364<dd>the image view. </dd>
365
366<dd>  </dd>
367</dl>
368<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="IsImageView">IsImageView</a></h2>
369
370<p>IsImageView() returns MagickTrue if the the parameter is verified as a image view object.</p>
371
372<p>The format of the IsImageView method is:</p>
373
374<pre class="text">
375MagickBooleanType IsImageView(const ImageView *image_view)
376</pre>
377
378<p>A description of each parameter follows:</p>
379
380<dd>
381</dd>
382
383<dd> </dd>
384<dl class="dl-horizontal">
385<dt>image_view</dt>
386<dd>the image view. </dd>
387
388<dd>  </dd>
389</dl>
390<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="NewImageView">NewImageView</a></h2>
391
392<p>NewImageView() returns a image view required for all other methods in the Image View API.</p>
393
394<p>The format of the NewImageView method is:</p>
395
396<pre class="text">
397ImageView *NewImageView(MagickCore *wand,ExceptionInfo *exception)
398</pre>
399
400<p>A description of each parameter follows:</p>
401
402<dd>
403</dd>
404
405<dd> </dd>
406<dl class="dl-horizontal">
407<dt>image</dt>
408<dd>the image. </dd>
409
410<dd> </dd>
411<dt>exception</dt>
412<dd>return any errors or warnings in this structure. </dd>
413
414<dd>  </dd>
415</dl>
416<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="NewImageViewRegion">NewImageViewRegion</a></h2>
417
418<p>NewImageViewRegion() returns a image view required for all other methods in the Image View API.</p>
419
420<p>The format of the NewImageViewRegion method is:</p>
421
422<pre class="text">
423ImageView *NewImageViewRegion(MagickCore *wand,const ssize_t x,
424  const ssize_t y,const size_t width,const size_t height,
425  ExceptionInfo *exception)
426</pre>
427
428<p>A description of each parameter follows:</p>
429
430<dd>
431</dd>
432
433<dd> </dd>
434<dl class="dl-horizontal">
435<dt>wand</dt>
436<dd>the magick wand. </dd>
437
438<dd> </dd>
439<dt>x,y,columns,rows</dt>
440<dd> These values define the perimeter of a extent of pixel_wands view. </dd>
441
442<dd> </dd>
443<dt>exception</dt>
444<dd>return any errors or warnings in this structure. </dd>
445
446<dd>  </dd>
447</dl>
448<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="SetImageViewDescription">SetImageViewDescription</a></h2>
449
450<p>SetImageViewDescription() associates a description with an image view.</p>
451
452<p>The format of the SetImageViewDescription method is:</p>
453
454<pre class="text">
455void SetImageViewDescription(ImageView *image_view,
456  const char *description)
457</pre>
458
459<p>A description of each parameter follows:</p>
460
461<dd>
462</dd>
463
464<dd> </dd>
465<dl class="dl-horizontal">
466<dt>image_view</dt>
467<dd>the image view. </dd>
468
469<dd> </dd>
470<dt>description</dt>
471<dd>the image view description. </dd>
472
473<dd>  </dd>
474</dl>
475<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="SetImageViewIterator">SetImageViewIterator</a></h2>
476
477<p>SetImageViewIterator() iterates over the image view in parallel and calls your set method for each scanline of the view.  The pixel extent is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension.  The pixels are initiallly undefined and any settings you make in the callback method are automagically synced back to your image.</p>
478
479<p>The callback signature is:</p>
480
481<pre class="text">
482MagickBooleanType SetImageViewMethod(ImageView *destination,
483  const ssize_t y,const int thread_id,void *context)
484</pre>
485
486<p>Use this pragma if the view is not single threaded:</p>
487
488<pre class="text">
489    #pragma omp critical
490</pre>
491
492<p>to define a section of code in your callback set method that must be executed by a single thread at a time.</p>
493
494<p>The format of the SetImageViewIterator method is:</p>
495
496<pre class="text">
497MagickBooleanType SetImageViewIterator(ImageView *destination,
498  SetImageViewMethod set,void *context)
499</pre>
500
501<p>A description of each parameter follows:</p>
502
503<dd>
504</dd>
505
506<dd> </dd>
507<dl class="dl-horizontal">
508<dt>destination</dt>
509<dd>the image view. </dd>
510
511<dd> </dd>
512<dt>set</dt>
513<dd>the set callback method. </dd>
514
515<dd> </dd>
516<dt>context</dt>
517<dd>the user defined context. </dd>
518
519<dd>  </dd>
520</dl>
521<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="TransferImageViewIterator">TransferImageViewIterator</a></h2>
522
523<p>TransferImageViewIterator() iterates over two image views in parallel and calls your transfer method for each scanline of the view.  The source pixel extent is not confined to the image canvas-- that is you can include negative offsets or widths or heights that exceed the image dimension. However, the destination image view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.</p>
524
525<p>The callback signature is:</p>
526
527<pre class="text">
528MagickBooleanType TransferImageViewMethod(const ImageView *source,
529  ImageView *destination,const ssize_t y,const int thread_id,
530  void *context)
531</pre>
532
533<p>Use this pragma if the view is not single threaded:</p>
534
535<pre class="text">
536    #pragma omp critical
537</pre>
538
539<p>to define a section of code in your callback transfer method that must be executed by a single thread at a time.</p>
540
541<p>The format of the TransferImageViewIterator method is:</p>
542
543<pre class="text">
544MagickBooleanType TransferImageViewIterator(ImageView *source,
545  ImageView *destination,TransferImageViewMethod transfer,void *context)
546</pre>
547
548<p>A description of each parameter follows:</p>
549
550<dd>
551</dd>
552
553<dd> </dd>
554<dl class="dl-horizontal">
555<dt>source</dt>
556<dd>the source image view. </dd>
557
558<dd> </dd>
559<dt>destination</dt>
560<dd>the destination image view. </dd>
561
562<dd> </dd>
563<dt>transfer</dt>
564<dd>the transfer callback method. </dd>
565
566<dd> </dd>
567<dt>context</dt>
568<dd>the user defined context. </dd>
569
570<dd>  </dd>
571</dl>
572<h2><a href="http://www.imagemagick.org/api/MagickCore/image-view_8c.html" id="UpdateImageViewIterator">UpdateImageViewIterator</a></h2>
573
574<p>UpdateImageViewIterator() iterates over the image view in parallel and calls your update method for each scanline of the view.  The pixel extent is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.  Updates to pixels in your callback are automagically synced back to the image.</p>
575
576<p>The callback signature is:</p>
577
578<pre class="text">
579MagickBooleanType UpdateImageViewMethod(ImageView *source,
580  const ssize_t y,const int thread_id,void *context)
581</pre>
582
583<p>Use this pragma if the view is not single threaded:</p>
584
585<pre class="text">
586    #pragma omp critical
587</pre>
588
589<p>to define a section of code in your callback update method that must be executed by a single thread at a time.</p>
590
591<p>The format of the UpdateImageViewIterator method is:</p>
592
593<pre class="text">
594MagickBooleanType UpdateImageViewIterator(ImageView *source,
595  UpdateImageViewMethod update,void *context)
596</pre>
597
598<p>A description of each parameter follows:</p>
599
600<dd>
601</dd>
602
603<dd> </dd>
604<dl class="dl-horizontal">
605<dt>source</dt>
606<dd>the source image view. </dd>
607
608<dd> </dd>
609<dt>update</dt>
610<dd>the update callback method. </dd>
611
612<dd> </dd>
613<dt>context</dt>
614<dd>the user defined context. </dd>
615
616<dd>  </dd>
617</dl>
618</div>
619  <footer class="magick-footer">
620    <p><a href="../support.html">Donate</a> •
621     <a href="../sitemap.html">Sitemap</a> •
622    <a href="../links.html">Related</a> •
623    <a href="../architecture.html">Architecture</a>
624</p>
625    <p><a href="image-view.html#">Back to top</a> •
626    <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
627    <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p>
628        <p><small>©  1999-2016 ImageMagick Studio LLC</small></p>
629  </footer>
630</div><!-- /.container -->
631
632  <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
633  <script src="../js/magick.html"></script>
634</div>
635</body>
636</html>
637