Home | History | Annotate | Download | only in api
      1 
      2 
      3 
      4 
      5 <!DOCTYPE html>
      6 <html lang="en">
      7 <head>
      8   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
      9     <title>ImageMagick: MagickWand, C API for ImageMagick: Wand View Methods</title>
     10   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
     11   <meta name="application-name" content="ImageMagick"/>
     12   <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 Bzier curves."/>
     13   <meta name="application-url" content="http://www.imagemagick.org"/>
     14   <meta name="generator" content="PHP"/>
     15   <meta name="keywords" content="magickwc, api, for, imagemagick:, wview, methods, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
     16   <meta name="rating" content="GENERAL"/>
     17   <meta name="robots" content="INDEX, FOLLOW"/>
     18   <meta name="generator" content="ImageMagick Studio LLC"/>
     19   <meta name="author" content="ImageMagick Studio LLC"/>
     20   <meta name="revisit-after" content="2 DAYS"/>
     21   <meta name="resource-type" content="document"/>
     22   <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/>
     23   <meta name="distribution" content="Global"/>
     24   <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
     25   <link rel="icon" href="../image/wand.png"/>
     26   <link rel="shortcut icon" href="../image/wand.ico"/>
     27   <link rel="stylesheet" href="../css/magick.php"/>
     28 </head>
     29 <body>
     30 <div class="main">
     31 <div class="magick-masthead">
     32   <div class="container">
     33     <script async="async" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
     34          style="display:block"
     35          data-ad-client="ca-pub-3129977114552745"
     36          data-ad-slot="6345125851"
     37          data-ad-format="auto"></ins>
     38     <script>
     39       (adsbygoogle = window.adsbygoogle || []).push({});
     40     </script>
     41     <nav class="magick-nav">
     42       <a class="magick-nav-item " href="../index.php">Home</a>
     43       <a class="magick-nav-item " href="../script/binary-releases.php">Download</a>
     44       <a class="magick-nav-item " href="../script/command-line-tools.php">Tools</a>
     45       <a class="magick-nav-item " href="../script/command-line-options.php">Options</a>
     46       <a class="magick-nav-item " href="../script/resources.php">Resources</a>
     47       <a class="magick-nav-item " href="../script/api.php">Develop</a>
     48       <a class="magick-nav-item " href="../script/search.php">Search</a>
     49       <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
     50     </nav>
     51   </div>
     52 </div>
     53 <div class="container">
     54 <div class="magick-header">
     55 <p class="text-center"><a href="wand-view.php#CloneWandView">CloneWandView</a> &bull; <a href="wand-view.php#DestroyWandView">DestroyWandView</a> &bull; <a href="wand-view.php#DuplexTransferWandViewIterator">DuplexTransferWandViewIterator</a> &bull; <a href="wand-view.php#GetWandViewException">GetWandViewException</a> &bull; <a href="wand-view.php#GetWandViewExtent">GetWandViewExtent</a> &bull; <a href="wand-view.php#GetWandViewIterator">GetWandViewIterator</a> &bull; <a href="wand-view.php#GetWandViewPixels">GetWandViewPixels</a> &bull; <a href="wand-view.php#GetWandViewWand">GetWandViewWand</a> &bull; <a href="wand-view.php#IsWandView">IsWandView</a> &bull; <a href="wand-view.php#NewWandView">NewWandView</a> &bull; <a href="wand-view.php#NewWandViewExtent">NewWandViewExtent</a> &bull; <a href="wand-view.php#SetWandViewDescription">SetWandViewDescription</a> &bull; <a href="wand-view.php#SetWandViewIterator">SetWandViewIterator</a> &bull; <a href="wand-view.php#TransferWandViewIterator">TransferWandViewIterator</a> &bull; <a href="wand-view.php#UpdateWandViewIterator">UpdateWandViewIterator</a></p>
     56 
     57 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="CloneWandView">CloneWandView</a></h2>
     58 
     59 <p>CloneWandView() makes a copy of the specified wand view.</p>
     60 
     61 <p>The format of the CloneWandView method is:</p>
     62 
     63 <pre class="text">
     64 WandView *CloneWandView(const WandView *wand_view)
     65 </pre>
     66 
     67 <p>A description of each parameter follows:</p>
     68 
     69 <dd>
     70 </dd>
     71 
     72 <dd> </dd>
     73 <dl class="dl-horizontal">
     74 <dt>wand_view</dt>
     75 <dd>the wand view. </dd>
     76 
     77 <dd>  </dd>
     78 </dl>
     79 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="DestroyWandView">DestroyWandView</a></h2>
     80 
     81 <p>DestroyWandView() deallocates memory associated with a wand view.</p>
     82 
     83 <p>The format of the DestroyWandView method is:</p>
     84 
     85 <pre class="text">
     86 WandView *DestroyWandView(WandView *wand_view)
     87 </pre>
     88 
     89 <p>A description of each parameter follows:</p>
     90 
     91 <dd>
     92 </dd>
     93 
     94 <dd> </dd>
     95 <dl class="dl-horizontal">
     96 <dt>wand_view</dt>
     97 <dd>the wand view. </dd>
     98 
     99 <dd>  </dd>
    100 </dl>
    101 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="DuplexTransferWandViewIterator">DuplexTransferWandViewIterator</a></h2>
    102 
    103 <p>DuplexTransferWandViewIterator() iterates over three wand 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 wand view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.</p>
    104 
    105 <p>The callback signature is:</p>
    106 
    107 <pre class="text">
    108 MagickBooleanType DuplexTransferImageViewMethod(const WandView *source,
    109   const WandView *duplex,WandView *destination,const ssize_t y,
    110   const int thread_id,void *context)
    111 </pre>
    112 
    113 <p>Use this pragma if the view is not single threaded:</p>
    114 
    115 <pre class="text">
    116     #pragma omp critical
    117 </pre>
    118 
    119 <p>to define a section of code in your callback transfer method that must be executed by a single thread at a time.</p>
    120 
    121 <p>The format of the DuplexTransferWandViewIterator method is:</p>
    122 
    123 <pre class="text">
    124 MagickBooleanType DuplexTransferWandViewIterator(WandView *source,
    125   WandView *duplex,WandView *destination,
    126   DuplexTransferWandViewMethod transfer,void *context)
    127 </pre>
    128 
    129 <p>A description of each parameter follows:</p>
    130 
    131 <dd>
    132 </dd>
    133 
    134 <dd> </dd>
    135 <dl class="dl-horizontal">
    136 <dt>source</dt>
    137 <dd>the source wand view. </dd>
    138 
    139 <dd> </dd>
    140 <dt>duplex</dt>
    141 <dd>the duplex wand view. </dd>
    142 
    143 <dd> </dd>
    144 <dt>destination</dt>
    145 <dd>the destination wand view. </dd>
    146 
    147 <dd> </dd>
    148 <dt>transfer</dt>
    149 <dd>the transfer callback method. </dd>
    150 
    151 <dd> </dd>
    152 <dt>context</dt>
    153 <dd>the user defined context. </dd>
    154 
    155 <dd>  </dd>
    156 </dl>
    157 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="GetWandViewException">GetWandViewException</a></h2>
    158 
    159 <p>GetWandViewException() returns the severity, reason, and description of any error that occurs when utilizing a wand view.</p>
    160 
    161 <p>The format of the GetWandViewException method is:</p>
    162 
    163 <pre class="text">
    164 char *GetWandViewException(const WandView *wand_view,
    165   ExceptionType *severity)
    166 </pre>
    167 
    168 <p>A description of each parameter follows:</p>
    169 
    170 <dd>
    171 </dd>
    172 
    173 <dd> </dd>
    174 <dl class="dl-horizontal">
    175 <dt>wand_view</dt>
    176 <dd>the pixel wand_view. </dd>
    177 
    178 <dd> </dd>
    179 <dt>severity</dt>
    180 <dd>the severity of the error is returned here. </dd>
    181 
    182 <dd>  </dd>
    183 </dl>
    184 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="GetWandViewExtent">GetWandViewExtent</a></h2>
    185 
    186 <p>GetWandViewExtent() returns the wand view extent.</p>
    187 
    188 <p>The format of the GetWandViewExtent method is:</p>
    189 
    190 <pre class="text">
    191 RectangleInfo GetWandViewExtent(const WandView *wand_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>wand_view</dt>
    202 <dd>the wand view. </dd>
    203 
    204 <dd>  </dd>
    205 </dl>
    206 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="GetWandViewIterator">GetWandViewIterator</a></h2>
    207 
    208 <p>GetWandViewIterator() iterates over the wand 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>
    209 
    210 <p>The callback signature is:</p>
    211 
    212 <pre class="text">
    213 MagickBooleanType GetImageViewMethod(const WandView *source,
    214   const ssize_t y,const int thread_id,void *context)
    215 </pre>
    216 
    217 <p>Use this pragma if the view is not single threaded:</p>
    218 
    219 <pre class="text">
    220     #pragma omp critical
    221 </pre>
    222 
    223 <p>to define a section of code in your callback get method that must be executed by a single thread at a time.</p>
    224 
    225 <p>The format of the GetWandViewIterator method is:</p>
    226 
    227 <pre class="text">
    228 MagickBooleanType GetWandViewIterator(WandView *source,
    229   GetWandViewMethod get,void *context)
    230 </pre>
    231 
    232 <p>A description of each parameter follows:</p>
    233 
    234 <dd>
    235 </dd>
    236 
    237 <dd> </dd>
    238 <dl class="dl-horizontal">
    239 <dt>source</dt>
    240 <dd>the source wand view. </dd>
    241 
    242 <dd> </dd>
    243 <dt>get</dt>
    244 <dd>the get callback method. </dd>
    245 
    246 <dd> </dd>
    247 <dt>context</dt>
    248 <dd>the user defined context. </dd>
    249 
    250 <dd>  </dd>
    251 </dl>
    252 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="GetWandViewPixels">GetWandViewPixels</a></h2>
    253 
    254 <p>GetWandViewPixels() returns the wand view pixel_wands.</p>
    255 
    256 <p>The format of the GetWandViewPixels method is:</p>
    257 
    258 <pre class="text">
    259 PixelWand *GetWandViewPixels(const WandView *wand_view)
    260 </pre>
    261 
    262 <p>A description of each parameter follows:</p>
    263 
    264 <dd>
    265 </dd>
    266 
    267 <dd> </dd>
    268 <dl class="dl-horizontal">
    269 <dt>wand_view</dt>
    270 <dd>the wand view. </dd>
    271 
    272 <dd>  </dd>
    273 </dl>
    274 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="GetWandViewWand">GetWandViewWand</a></h2>
    275 
    276 <p>GetWandViewWand() returns the magick wand associated with the wand view.</p>
    277 
    278 <p>The format of the GetWandViewWand method is:</p>
    279 
    280 <pre class="text">
    281 MagickWand *GetWandViewWand(const WandView *wand_view)
    282 </pre>
    283 
    284 <p>A description of each parameter follows:</p>
    285 
    286 <dd>
    287 </dd>
    288 
    289 <dd> </dd>
    290 <dl class="dl-horizontal">
    291 <dt>wand_view</dt>
    292 <dd>the wand view. </dd>
    293 
    294 <dd>  </dd>
    295 </dl>
    296 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="IsWandView">IsWandView</a></h2>
    297 
    298 <p>IsWandView() returns MagickTrue if the the parameter is verified as a wand view object.</p>
    299 
    300 <p>The format of the IsWandView method is:</p>
    301 
    302 <pre class="text">
    303 MagickBooleanType IsWandView(const WandView *wand_view)
    304 </pre>
    305 
    306 <p>A description of each parameter follows:</p>
    307 
    308 <dd>
    309 </dd>
    310 
    311 <dd> </dd>
    312 <dl class="dl-horizontal">
    313 <dt>wand_view</dt>
    314 <dd>the wand view. </dd>
    315 
    316 <dd>  </dd>
    317 </dl>
    318 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="NewWandView">NewWandView</a></h2>
    319 
    320 <p>NewWandView() returns a wand view required for all other methods in the Wand View API.</p>
    321 
    322 <p>The format of the NewWandView method is:</p>
    323 
    324 <pre class="text">
    325 WandView *NewWandView(MagickWand *wand)
    326 </pre>
    327 
    328 <p>A description of each parameter follows:</p>
    329 
    330 <dd>
    331 </dd>
    332 
    333 <dd> </dd>
    334 <dl class="dl-horizontal">
    335 <dt>wand</dt>
    336 <dd>the wand. </dd>
    337 
    338 <dd>  </dd>
    339 </dl>
    340 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="NewWandViewExtent">NewWandViewExtent</a></h2>
    341 
    342 <p>NewWandViewExtent() returns a wand view required for all other methods in the Wand View API.</p>
    343 
    344 <p>The format of the NewWandViewExtent method is:</p>
    345 
    346 <pre class="text">
    347 WandView *NewWandViewExtent(MagickWand *wand,const ssize_t x,
    348   const ssize_t y,const size_t width,const size_t height)
    349 </pre>
    350 
    351 <p>A description of each parameter follows:</p>
    352 
    353 <dd>
    354 </dd>
    355 
    356 <dd> </dd>
    357 <dl class="dl-horizontal">
    358 <dt>wand</dt>
    359 <dd>the magick wand. </dd>
    360 
    361 <dd> </dd>
    362 <dt>x,y,columns,rows</dt>
    363 <dd> These values define the perimeter of a extent of pixel_wands view. </dd>
    364 
    365 <dd>  </dd>
    366 </dl>
    367 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="SetWandViewDescription">SetWandViewDescription</a></h2>
    368 
    369 <p>SetWandViewDescription() associates a description with an image view.</p>
    370 
    371 <p>The format of the SetWandViewDescription method is:</p>
    372 
    373 <pre class="text">
    374 void SetWandViewDescription(WandView *image_view,const char *description)
    375 </pre>
    376 
    377 <p>A description of each parameter follows:</p>
    378 
    379 <dd>
    380 </dd>
    381 
    382 <dd> </dd>
    383 <dl class="dl-horizontal">
    384 <dt>wand_view</dt>
    385 <dd>the wand view. </dd>
    386 
    387 <dd> </dd>
    388 <dt>description</dt>
    389 <dd>the wand view description. </dd>
    390 
    391 <dd>  </dd>
    392 </dl>
    393 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="SetWandViewIterator">SetWandViewIterator</a></h2>
    394 
    395 <p>SetWandViewIterator() iterates over the wand 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>
    396 
    397 <p>The callback signature is:</p>
    398 
    399 <pre class="text">
    400 MagickBooleanType SetImageViewMethod(ImageView *destination,
    401   const ssize_t y,const int thread_id,void *context)
    402 </pre>
    403 
    404 <p>Use this pragma if the view is not single threaded:</p>
    405 
    406 <pre class="text">
    407     #pragma omp critical
    408 </pre>
    409 
    410 <p>to define a section of code in your callback set method that must be executed by a single thread at a time.</p>
    411 
    412 <p>The format of the SetWandViewIterator method is:</p>
    413 
    414 <pre class="text">
    415 MagickBooleanType SetWandViewIterator(WandView *destination,
    416   SetWandViewMethod set,void *context)
    417 </pre>
    418 
    419 <p>A description of each parameter follows:</p>
    420 
    421 <dd>
    422 </dd>
    423 
    424 <dd> </dd>
    425 <dl class="dl-horizontal">
    426 <dt>destination</dt>
    427 <dd>the wand view. </dd>
    428 
    429 <dd> </dd>
    430 <dt>set</dt>
    431 <dd>the set callback method. </dd>
    432 
    433 <dd> </dd>
    434 <dt>context</dt>
    435 <dd>the user defined context. </dd>
    436 
    437 <dd>  </dd>
    438 </dl>
    439 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="TransferWandViewIterator">TransferWandViewIterator</a></h2>
    440 
    441 <p>TransferWandViewIterator() iterates over two wand 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 wand view is confined to the image canvas-- that is no negative offsets or widths or heights that exceed the image dimension are permitted.</p>
    442 
    443 <p>The callback signature is:</p>
    444 
    445 <pre class="text">
    446 MagickBooleanType TransferImageViewMethod(const WandView *source,
    447   WandView *destination,const ssize_t y,const int thread_id,
    448   void *context)
    449 </pre>
    450 
    451 <p>Use this pragma if the view is not single threaded:</p>
    452 
    453 <pre class="text">
    454     #pragma omp critical
    455 </pre>
    456 
    457 <p>to define a section of code in your callback transfer method that must be executed by a single thread at a time.</p>
    458 
    459 <p>The format of the TransferWandViewIterator method is:</p>
    460 
    461 <pre class="text">
    462 MagickBooleanType TransferWandViewIterator(WandView *source,
    463   WandView *destination,TransferWandViewMethod transfer,void *context)
    464 </pre>
    465 
    466 <p>A description of each parameter follows:</p>
    467 
    468 <dd>
    469 </dd>
    470 
    471 <dd> </dd>
    472 <dl class="dl-horizontal">
    473 <dt>source</dt>
    474 <dd>the source wand view. </dd>
    475 
    476 <dd> </dd>
    477 <dt>destination</dt>
    478 <dd>the destination wand view. </dd>
    479 
    480 <dd> </dd>
    481 <dt>transfer</dt>
    482 <dd>the transfer callback method. </dd>
    483 
    484 <dd> </dd>
    485 <dt>context</dt>
    486 <dd>the user defined context. </dd>
    487 
    488 <dd>  </dd>
    489 </dl>
    490 <h2><a href="http://nextgen.imagemagick.org/api/MagickWand/wand-view_8c.html" id="UpdateWandViewIterator">UpdateWandViewIterator</a></h2>
    491 
    492 <p>UpdateWandViewIterator() iterates over the wand 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>
    493 
    494 <p>The callback signature is:</p>
    495 
    496 <pre class="text">
    497 MagickBooleanType UpdateImageViewMethod(WandView *source,const ssize_t y,
    498   const int thread_id,void *context)
    499 </pre>
    500 
    501 <p>Use this pragma if the view is not single threaded:</p>
    502 
    503 <pre class="text">
    504     #pragma omp critical
    505 </pre>
    506 
    507 <p>to define a section of code in your callback update method that must be executed by a single thread at a time.</p>
    508 
    509 <p>The format of the UpdateWandViewIterator method is:</p>
    510 
    511 <pre class="text">
    512 MagickBooleanType UpdateWandViewIterator(WandView *source,
    513   UpdateWandViewMethod update,void *context)
    514 </pre>
    515 
    516 <p>A description of each parameter follows:</p>
    517 
    518 <dd>
    519 </dd>
    520 
    521 <dd> </dd>
    522 <dl class="dl-horizontal">
    523 <dt>source</dt>
    524 <dd>the source wand view. </dd>
    525 
    526 <dd> </dd>
    527 <dt>update</dt>
    528 <dd>the update callback method. </dd>
    529 
    530 <dd> </dd>
    531 <dt>context</dt>
    532 <dd>the user defined context. </dd>
    533 
    534 <dd>  </dd>
    535 </dl>
    536 </div>
    537   <footer class="magick-footer">
    538     <p><a href="../script/support.php">Donate</a> 
    539      <a href="../script/sitemap.php">Sitemap</a> 
    540     <a href="../script/links.php">Related</a> 
    541     <a href="../script/architecture.php">Architecture</a>
    542 </p>
    543     <p><a href="wand-view.php#">Back to top</a> 
    544     <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> 
    545     <a href="../script/contact.php">Contact Us</a></p>
    546         <p><small>  1999-2016 ImageMagick Studio LLC</small></p>
    547   </footer>
    548 </div><!-- /.container -->
    549 
    550   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    551   <script src="http://nextgen.imagemagick.org/js/magick.php"></script>
    552 </div>
    553 </body>
    554 </html>
    555