Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 1 | |
| 2 | |
| 3 | |
| 4 | |
cristy | 29dc865 | 2015-05-12 16:26:21 +0000 | [diff] [blame] | 5 | <!DOCTYPE html> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 6 | <html lang="en"> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 7 | <head> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 8 | <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 9 | <title>ImageMagick: MagickCore, C API for ImageMagick: Get or Set Image Pixels</title> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 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 Bézier curves."/> |
| 13 | <meta name="application-url" content="http://www.imagemagick.org"/> |
| 14 | <meta name="generator" content="PHP"/> |
| 15 | <meta name="keywords" content="magickcore, c, api, for, imagemagick:, get, or, set, image, pixels, 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"/> |
Cristy | ce4a355 | 2015-12-14 13:53:35 -0500 | [diff] [blame] | 22 | <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC"/> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 23 | <meta name="distribution" content="Global"/> |
| 24 | <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/> |
| 25 | <link rel="icon" href="../images/wand.png"/> |
| 26 | <link rel="shortcut icon" href="../images/wand.ico"/> |
| 27 | <link rel="stylesheet" href="../css/magick.html"/> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 28 | </head> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 29 | <body> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 30 | <div class="main"> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 31 | <div class="magick-masthead"> |
| 32 | <div class="container"> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 33 | <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 34 | style="display:block" |
| 35 | data-ad-client="ca-pub-3129977114552745" |
| 36 | data-ad-slot="6345125851" |
| 37 | data-ad-format="auto"></ins> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 38 | <script> |
Cristy | 542697a | 2015-10-12 20:10:32 -0400 | [diff] [blame] | 39 | (adsbygoogle = window.adsbygoogle || []).push({}); |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 40 | </script> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 41 | <nav class="magick-nav"> |
cristy | 2f563d4 | 2015-05-06 23:36:51 +0000 | [diff] [blame] | 42 | <a class="magick-nav-item " href="../index.html">Home</a> |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 43 | <a class="magick-nav-item " href="../binary-releases.html">Download</a> |
cristy | 3818536 | 2015-05-07 20:09:56 +0000 | [diff] [blame] | 44 | <a class="magick-nav-item " href="../command-line-tools.html">Tools</a> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 45 | <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a> |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 46 | <a class="magick-nav-item " href="../resources.html">Resources</a> |
| 47 | <a class="magick-nav-item " href="api.html">Develop</a> |
cristy | 5b8fe76 | 2015-06-09 16:24:03 +0000 | [diff] [blame] | 48 | <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a> |
cristy | a1890f0 | 2015-05-15 23:32:44 +0000 | [diff] [blame] | 49 | <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 50 | </nav> |
| 51 | </div> |
| 52 | </div> |
| 53 | <div class="container"> |
cristy | 4e638cd | 2015-05-07 16:47:40 +0000 | [diff] [blame] | 54 | <div class="magick-header"> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 55 | <p class="text-center"><a href="cache.html#AcquirePixelCacheNexus">AcquirePixelCacheNexus</a> • <a href="cache.html#GetAuthenticMetacontent">GetAuthenticMetacontent</a> • <a href="cache.html#GetAuthenticPixelQueue">GetAuthenticPixelQueue</a> • <a href="cache.html#GetAuthenticPixels">GetAuthenticPixels</a> • <a href="cache.html#GetOneAuthenticPixel">GetOneAuthenticPixel</a> • <a href="cache.html#GetOneVirtualPixel">GetOneVirtualPixel</a> • <a href="cache.html#GetOneVirtualPixelInfo">GetOneVirtualPixelInfo</a> • <a href="cache.html#GetVirtualMetacontent">GetVirtualMetacontent</a> • <a href="cache.html#GetVirtualPixelQueue">GetVirtualPixelQueue</a> • <a href="cache.html#GetVirtualPixels">GetVirtualPixels</a> • <a href="cache.html#QueueAuthenticPixels">QueueAuthenticPixels</a> • <a href="cache.html#SetPixelCacheVirtualMethod">SetPixelCacheVirtualMethod</a> • <a href="cache.html#SyncAuthenticPixels">SyncAuthenticPixels</a></p> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 56 | |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 57 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="AcquirePixelCacheNexus">AcquirePixelCacheNexus</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 58 | |
| 59 | <p>AcquirePixelCacheNexus() allocates the NexusInfo structure.</p> |
| 60 | |
| 61 | <p>The format of the AcquirePixelCacheNexus method is:</p> |
| 62 | |
| 63 | <pre class="text"> |
| 64 | NexusInfo **AcquirePixelCacheNexus(const size_t number_threads) |
| 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>number_threads</dt> |
| 75 | <dd>the number of nexus threads. </dd> |
| 76 | |
| 77 | <dd> </dd> |
| 78 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 79 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="GetAuthenticMetacontent">GetAuthenticMetacontent</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 80 | |
| 81 | <p>GetAuthenticMetacontent() returns the authentic metacontent corresponding with the last call to QueueAuthenticPixels() or GetVirtualPixels(). NULL is returned if the associated pixels are not available.</p> |
| 82 | |
| 83 | <p>The format of the GetAuthenticMetacontent() method is:</p> |
| 84 | |
| 85 | <pre class="text"> |
| 86 | void *GetAuthenticMetacontent(const Image *image) |
| 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>image</dt> |
| 97 | <dd>the image. </dd> |
| 98 | |
| 99 | <dd> </dd> |
| 100 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 101 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="GetAuthenticPixelQueue">GetAuthenticPixelQueue</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 102 | |
| 103 | <p>GetAuthenticPixelQueue() returns the authentic pixels associated corresponding with the last call to QueueAuthenticPixels() or GetAuthenticPixels().</p> |
| 104 | |
| 105 | <p>The format of the GetAuthenticPixelQueue() method is:</p> |
| 106 | |
| 107 | <pre class="text"> |
| 108 | Quantum *GetAuthenticPixelQueue(const Image image) |
| 109 | </pre> |
| 110 | |
| 111 | <p>A description of each parameter follows:</p> |
| 112 | |
| 113 | <dd> |
| 114 | </dd> |
| 115 | |
| 116 | <dd> </dd> |
| 117 | <dl class="dl-horizontal"> |
| 118 | <dt>image</dt> |
| 119 | <dd>the image. </dd> |
| 120 | |
| 121 | <dd> </dd> |
| 122 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 123 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="GetAuthenticPixels">GetAuthenticPixels</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 124 | |
| 125 | <p>GetAuthenticPixels() obtains a pixel region for read/write access. If the region is successfully accessed, a pointer to a Quantum array representing the region is returned, otherwise NULL is returned.</p> |
| 126 | |
| 127 | <p>The returned pointer may point to a temporary working copy of the pixels or it may point to the original pixels in memory. Performance is maximized if the selected region is part of one row, or one or more full rows, since then there is opportunity to access the pixels in-place (without a copy) if the image is in memory, or in a memory-mapped file. The returned pointer must *never* be deallocated by the user.</p> |
| 128 | |
| 129 | <p>Pixels accessed via the returned pointer represent a simple array of type Quantum. If the image has corresponding metacontent,call GetAuthenticMetacontent() after invoking GetAuthenticPixels() to obtain the meta-content corresponding to the region. Once the Quantum array has been updated, the changes must be saved back to the underlying image using SyncAuthenticPixels() or they may be lost.</p> |
| 130 | |
| 131 | <p>The format of the GetAuthenticPixels() method is:</p> |
| 132 | |
| 133 | <pre class="text"> |
| 134 | Quantum *GetAuthenticPixels(Image *image,const ssize_t x, |
| 135 | const ssize_t y,const size_t columns,const size_t rows, |
| 136 | ExceptionInfo *exception) |
| 137 | </pre> |
| 138 | |
| 139 | <p>A description of each parameter follows:</p> |
| 140 | |
| 141 | <dd> |
| 142 | </dd> |
| 143 | |
| 144 | <dd> </dd> |
| 145 | <dl class="dl-horizontal"> |
| 146 | <dt>image</dt> |
| 147 | <dd>the image. </dd> |
| 148 | |
| 149 | <dd> </dd> |
| 150 | <dt>x,y,columns,rows</dt> |
| 151 | <dd> These values define the perimeter of a region of pixels. </dd> |
| 152 | |
| 153 | <dd> </dd> |
| 154 | <dt>exception</dt> |
| 155 | <dd>return any errors or warnings in this structure. </dd> |
| 156 | |
| 157 | <dd> </dd> |
| 158 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 159 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="GetOneAuthenticPixel">GetOneAuthenticPixel</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 160 | |
| 161 | <p>GetOneAuthenticPixel() returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs.</p> |
| 162 | |
| 163 | <p>The format of the GetOneAuthenticPixel() method is:</p> |
| 164 | |
| 165 | <pre class="text"> |
| 166 | MagickBooleanType GetOneAuthenticPixel(const Image image,const ssize_t x, |
| 167 | const ssize_t y,Quantum *pixel,ExceptionInfo *exception) |
| 168 | </pre> |
| 169 | |
| 170 | <p>A description of each parameter follows:</p> |
| 171 | |
| 172 | <dd> |
| 173 | </dd> |
| 174 | |
| 175 | <dd> </dd> |
| 176 | <dl class="dl-horizontal"> |
| 177 | <dt>image</dt> |
| 178 | <dd>the image. </dd> |
| 179 | |
| 180 | <dd> </dd> |
| 181 | <dt>x,y</dt> |
| 182 | <dd> These values define the location of the pixel to return. </dd> |
| 183 | |
| 184 | <dd> </dd> |
| 185 | <dt>pixel</dt> |
| 186 | <dd>return a pixel at the specified (x,y) location. </dd> |
| 187 | |
| 188 | <dd> </dd> |
| 189 | <dt>exception</dt> |
| 190 | <dd>return any errors or warnings in this structure. </dd> |
| 191 | |
| 192 | <dd> </dd> |
| 193 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 194 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="GetOneVirtualPixel">GetOneVirtualPixel</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 195 | |
| 196 | <p>GetOneVirtualPixel() returns a single virtual pixel at the specified (x,y) location. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOneAuthenticPixel() instead.</p> |
| 197 | |
| 198 | <p>The format of the GetOneVirtualPixel() method is:</p> |
| 199 | |
| 200 | <pre class="text"> |
| 201 | MagickBooleanType GetOneVirtualPixel(const Image image,const ssize_t x, |
| 202 | const ssize_t y,Quantum *pixel,ExceptionInfo exception) |
| 203 | </pre> |
| 204 | |
| 205 | <p>A description of each parameter follows:</p> |
| 206 | |
| 207 | <dd> |
| 208 | </dd> |
| 209 | |
| 210 | <dd> </dd> |
| 211 | <dl class="dl-horizontal"> |
| 212 | <dt>image</dt> |
| 213 | <dd>the image. </dd> |
| 214 | |
| 215 | <dd> </dd> |
| 216 | <dt>x,y</dt> |
| 217 | <dd> These values define the location of the pixel to return. </dd> |
| 218 | |
| 219 | <dd> </dd> |
| 220 | <dt>pixel</dt> |
| 221 | <dd>return a pixel at the specified (x,y) location. </dd> |
| 222 | |
| 223 | <dd> </dd> |
| 224 | <dt>exception</dt> |
| 225 | <dd>return any errors or warnings in this structure. </dd> |
| 226 | |
| 227 | <dd> </dd> |
| 228 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 229 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="GetOneVirtualPixelInfo">GetOneVirtualPixelInfo</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 230 | |
| 231 | <p>GetOneVirtualPixelInfo() returns a single pixel at the specified (x,y) location. The image background color is returned if an error occurs. If you plan to modify the pixel, use GetOneAuthenticPixel() instead.</p> |
| 232 | |
| 233 | <p>The format of the GetOneVirtualPixelInfo() method is:</p> |
| 234 | |
| 235 | <pre class="text"> |
| 236 | MagickBooleanType GetOneVirtualPixelInfo(const Image image, |
| 237 | const VirtualPixelMethod virtual_pixel_method,const ssize_t x, |
| 238 | const ssize_t y,PixelInfo *pixel,ExceptionInfo exception) |
| 239 | </pre> |
| 240 | |
| 241 | <p>A description of each parameter follows:</p> |
| 242 | |
| 243 | <dd> |
| 244 | </dd> |
| 245 | |
| 246 | <dd> </dd> |
| 247 | <dl class="dl-horizontal"> |
| 248 | <dt>image</dt> |
| 249 | <dd>the image. </dd> |
| 250 | |
| 251 | <dd> </dd> |
| 252 | <dt>virtual_pixel_method</dt> |
| 253 | <dd>the virtual pixel method. </dd> |
| 254 | |
| 255 | <dd> </dd> |
| 256 | <dt>x,y</dt> |
| 257 | <dd> these values define the location of the pixel to return. </dd> |
| 258 | |
| 259 | <dd> </dd> |
| 260 | <dt>pixel</dt> |
| 261 | <dd>return a pixel at the specified (x,y) location. </dd> |
| 262 | |
| 263 | <dd> </dd> |
| 264 | <dt>exception</dt> |
| 265 | <dd>return any errors or warnings in this structure. </dd> |
| 266 | |
| 267 | <dd> </dd> |
| 268 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 269 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="GetVirtualMetacontent">GetVirtualMetacontent</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 270 | |
| 271 | <p>GetVirtualMetacontent() returns the virtual metacontent corresponding with the last call to QueueAuthenticPixels() or GetVirtualPixels(). NULL is returned if the meta-content are not available.</p> |
| 272 | |
| 273 | <p>The format of the GetVirtualMetacontent() method is:</p> |
| 274 | |
| 275 | <pre class="text"> |
| 276 | const void *GetVirtualMetacontent(const Image *image) |
| 277 | </pre> |
| 278 | |
| 279 | <p>A description of each parameter follows:</p> |
| 280 | |
| 281 | <dd> |
| 282 | </dd> |
| 283 | |
| 284 | <dd> </dd> |
| 285 | <dl class="dl-horizontal"> |
| 286 | <dt>image</dt> |
| 287 | <dd>the image. </dd> |
| 288 | |
| 289 | <dd> </dd> |
| 290 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 291 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="GetVirtualPixelQueue">GetVirtualPixelQueue</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 292 | |
| 293 | <p>GetVirtualPixelQueue() returns the virtual pixels associated corresponding with the last call to QueueAuthenticPixels() or GetVirtualPixels().</p> |
| 294 | |
| 295 | <p>The format of the GetVirtualPixelQueue() method is:</p> |
| 296 | |
| 297 | <pre class="text"> |
| 298 | const Quantum *GetVirtualPixelQueue(const Image image) |
| 299 | </pre> |
| 300 | |
| 301 | <p>A description of each parameter follows:</p> |
| 302 | |
| 303 | <dd> |
| 304 | </dd> |
| 305 | |
| 306 | <dd> </dd> |
| 307 | <dl class="dl-horizontal"> |
| 308 | <dt>image</dt> |
| 309 | <dd>the image. </dd> |
| 310 | |
| 311 | <dd> </dd> |
| 312 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 313 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="GetVirtualPixels">GetVirtualPixels</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 314 | |
| 315 | <p>GetVirtualPixels() returns an immutable pixel region. If the region is successfully accessed, a pointer to it is returned, otherwise NULL is returned. The returned pointer may point to a temporary working copy of the pixels or it may point to the original pixels in memory. Performance is maximized if the selected region is part of one row, or one or more full rows, since there is opportunity to access the pixels in-place (without a copy) if the image is in memory, or in a memory-mapped file. The returned pointer must *never* be deallocated by the user.</p> |
| 316 | |
| 317 | <p>Pixels accessed via the returned pointer represent a simple array of type Quantum. If the image type is CMYK or the storage class is PseudoClass, call GetAuthenticMetacontent() after invoking GetAuthenticPixels() to access the meta-content (of type void) corresponding to the the region.</p> |
| 318 | |
| 319 | <p>If you plan to modify the pixels, use GetAuthenticPixels() instead.</p> |
| 320 | |
| 321 | <p>Note, the GetVirtualPixels() and GetAuthenticPixels() methods are not thread- safe. In a threaded environment, use GetCacheViewVirtualPixels() or GetCacheViewAuthenticPixels() instead.</p> |
| 322 | |
| 323 | <p>The format of the GetVirtualPixels() method is:</p> |
| 324 | |
| 325 | <pre class="text"> |
| 326 | const Quantum *GetVirtualPixels(const Image *image,const ssize_t x, |
| 327 | const ssize_t y,const size_t columns,const size_t rows, |
| 328 | ExceptionInfo *exception) |
| 329 | </pre> |
| 330 | |
| 331 | <p>A description of each parameter follows:</p> |
| 332 | |
| 333 | <dd> |
| 334 | </dd> |
| 335 | |
| 336 | <dd> </dd> |
| 337 | <dl class="dl-horizontal"> |
| 338 | <dt>image</dt> |
| 339 | <dd>the image. </dd> |
| 340 | |
| 341 | <dd> </dd> |
| 342 | <dt>x,y,columns,rows</dt> |
| 343 | <dd> These values define the perimeter of a region of pixels. </dd> |
| 344 | |
| 345 | <dd> </dd> |
| 346 | <dt>exception</dt> |
| 347 | <dd>return any errors or warnings in this structure. </dd> |
| 348 | |
| 349 | <dd> </dd> |
| 350 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 351 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="QueueAuthenticPixels">QueueAuthenticPixels</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 352 | |
| 353 | <p>QueueAuthenticPixels() queues a mutable pixel region. If the region is successfully initialized a pointer to a Quantum array representing the region is returned, otherwise NULL is returned. The returned pointer may point to a temporary working buffer for the pixels or it may point to the final location of the pixels in memory.</p> |
| 354 | |
| 355 | <p>Write-only access means that any existing pixel values corresponding to the region are ignored. This is useful if the initial image is being created from scratch, or if the existing pixel values are to be completely replaced without need to refer to their pre-existing values. The application is free to read and write the pixel buffer returned by QueueAuthenticPixels() any way it pleases. QueueAuthenticPixels() does not initialize the pixel array values. Initializing pixel array values is the application's responsibility.</p> |
| 356 | |
| 357 | <p>Performance is maximized if the selected region is part of one row, or one or more full rows, since then there is opportunity to access the pixels in-place (without a copy) if the image is in memory, or in a memory-mapped file. The returned pointer must *never* be deallocated by the user.</p> |
| 358 | |
| 359 | <p>Pixels accessed via the returned pointer represent a simple array of type Quantum. If the image type is CMYK or the storage class is PseudoClass, call GetAuthenticMetacontent() after invoking GetAuthenticPixels() to obtain the meta-content (of type void) corresponding to the region. Once the Quantum (and/or Quantum) array has been updated, the changes must be saved back to the underlying image using SyncAuthenticPixels() or they may be lost.</p> |
| 360 | |
| 361 | <p>The format of the QueueAuthenticPixels() method is:</p> |
| 362 | |
| 363 | <pre class="text"> |
| 364 | Quantum *QueueAuthenticPixels(Image *image,const ssize_t x, |
| 365 | const ssize_t y,const size_t columns,const size_t rows, |
| 366 | ExceptionInfo *exception) |
| 367 | </pre> |
| 368 | |
| 369 | <p>A description of each parameter follows:</p> |
| 370 | |
| 371 | <dd> |
| 372 | </dd> |
| 373 | |
| 374 | <dd> </dd> |
| 375 | <dl class="dl-horizontal"> |
| 376 | <dt>image</dt> |
| 377 | <dd>the image. </dd> |
| 378 | |
| 379 | <dd> </dd> |
| 380 | <dt>x,y,columns,rows</dt> |
| 381 | <dd> These values define the perimeter of a region of pixels. </dd> |
| 382 | |
| 383 | <dd> </dd> |
| 384 | <dt>exception</dt> |
| 385 | <dd>return any errors or warnings in this structure. </dd> |
| 386 | |
| 387 | <dd> </dd> |
| 388 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 389 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="SetPixelCacheVirtualMethod">SetPixelCacheVirtualMethod</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 390 | |
| 391 | <p>SetPixelCacheVirtualMethod() sets the "virtual pixels" method for the pixel cache and returns the previous setting. A virtual pixel is any pixel access that is outside the boundaries of the image cache.</p> |
| 392 | |
| 393 | <p>The format of the SetPixelCacheVirtualMethod() method is:</p> |
| 394 | |
| 395 | <pre class="text"> |
| 396 | VirtualPixelMethod SetPixelCacheVirtualMethod(Image *image, |
| 397 | const VirtualPixelMethod virtual_pixel_method,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>virtual_pixel_method</dt> |
| 412 | <dd>choose the type of virtual pixel. </dd> |
| 413 | |
| 414 | <dd> </dd> |
| 415 | <dt>exception</dt> |
| 416 | <dd>return any errors or warnings in this structure. </dd> |
| 417 | |
| 418 | <dd> </dd> |
| 419 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 420 | <h2><a href="http://www.imagemagick.org/api/MagickCore/cache_8c.html" id="SyncAuthenticPixels">SyncAuthenticPixels</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 421 | |
| 422 | <p>SyncAuthenticPixels() saves the image pixels to the in-memory or disk cache. The method returns MagickTrue if the pixel region is flushed, otherwise MagickFalse.</p> |
| 423 | |
| 424 | <p>The format of the SyncAuthenticPixels() method is:</p> |
| 425 | |
| 426 | <pre class="text"> |
| 427 | MagickBooleanType SyncAuthenticPixels(Image *image, |
| 428 | ExceptionInfo *exception) |
| 429 | </pre> |
| 430 | |
| 431 | <p>A description of each parameter follows:</p> |
| 432 | |
| 433 | <dd> |
| 434 | </dd> |
| 435 | |
| 436 | <dd> </dd> |
| 437 | <dl class="dl-horizontal"> |
| 438 | <dt>image</dt> |
| 439 | <dd>the image. </dd> |
| 440 | |
| 441 | <dd> </dd> |
| 442 | <dt>exception</dt> |
| 443 | <dd>return any errors or warnings in this structure. </dd> |
| 444 | |
| 445 | <dd> </dd> |
| 446 | </dl> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 447 | </div> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 448 | <footer class="magick-footer"> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 449 | <p><a href="../support.html">Donate</a> • |
| 450 | <a href="../sitemap.html">Sitemap</a> • |
cristy | 3818536 | 2015-05-07 20:09:56 +0000 | [diff] [blame] | 451 | <a href="../links.html">Related</a> • |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 452 | <a href="../architecture.html">Architecture</a> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 453 | </p> |
| 454 | <p><a href="cache.html#">Back to top</a> • |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 455 | <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • |
cristy | 5b8fe76 | 2015-06-09 16:24:03 +0000 | [diff] [blame] | 456 | <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p> |
Cristy | ce4a355 | 2015-12-14 13:53:35 -0500 | [diff] [blame] | 457 | <p><small>© 1999-2015 ImageMagick Studio LLC</small></p> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 458 | </footer> |
| 459 | </div><!-- /.container --> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 460 | |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 461 | <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 462 | <script src="http://nextgen.imagemagick.org/js/magick.html"></script> |
cristy | 44cbd48 | 2013-08-04 20:53:36 +0000 | [diff] [blame] | 463 | </div> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 464 | </body> |
cristy | 5a367e4 | 2015-05-05 12:39:18 +0000 | [diff] [blame] | 465 | </html> |