/usr/share/doc/libgraphicsmagick++1-dev/www/Magick++/Pixels.html is in libgraphicsmagick++1-dev 1.3.12-1.1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Solaris (vers 12 April 2005), see www.w3.org">
<meta http-equiv="CONTENT-TYPE" content=
"text/html; charset=us-ascii">
<title>Magick::Pixels Class</title>
<meta name="GENERATOR" content="StarOffice 8 (Solaris x86)">
<meta name="AUTHOR" content="Bob Friesenhahn">
<meta name="CREATED" content="20020805;15302080">
<meta name="CHANGEDBY" content="Bob Friesenhahn">
<meta name="CHANGED" content="20090328;20210800">
<meta name="DESCRIPTION" content=
"Class to access raw image pixels.">
<meta name="KEYWORDS" content="GraphicsMagick,Pixel,Magick++">
<meta name="CHANGEDBY" content="Bob Friesenhahn">
<style type="text/css">
<!--
TD P { color: #000000 }
H1 { color: #000000 }
P { color: #000000 }
A:link { color: #0000ff }
A:visited { color: #ff0000 }
-->
</style>
</head>
<body lang="en-US" text="#000000" link="#0000FF" vlink="#FF0000"
bgcolor="#FFFFFF" dir="ltr">
<h1 align="center">Magick::Pixels</h1>
<p>The <i>Pixels</i> class provides efficient access to raw image
pixels. Image pixels (of type <a href=
"PixelPacket.html"><i>PixelPacket</i></a>) may be accessed directly
via the <i>Image Pixel Cache</i>. The image pixel cache is a
rectangular window (a view) into the actual image pixels (which may
be in memory, memory-mapped from a disk file, or entirely on disk).
Obtain existing image pixels via <i>get()</i>. Create a new pixel
region using <i>set().</i></p>
<p>Depending on the capabilities of the operating system, and the
relationship of the window to the image, the pixel cache may be a
copy of the pixels in the selected window, or it may be the actual
image pixels. In any case calling <i>sync()</i> insures that the
base image is updated with the contents of the modified pixel
cache. The method <i>decode()</i>supports copying foreign pixel
data formats into the pixel cache according to the
<i>QuantumTypes</i>. The method <i>encode()</i> supports copying
the pixels in the cache to a foreign pixel representation according
to the format specified by <i>QuantumTypes</i>.</p>
<p>Setting a view using the Pixels class does not cause the number
of references to the underlying image to be reduced to one.
Therefore, in order to ensure that only the current generation of
the image is modified, the Image's <a href=
"Image.html#modifyimage">modifyImage()</a> method should be invoked
to reduce the reference count on the underlying image to one. If
this is not done, then it is possible for a previous generation of
the image to be modified due to the use of reference counting when
copying or constructing an Image.</p>
<p>The <i>PixelPacket</i>* returned by the <i>set</i> and
<i>get</i> methods, and the <i>IndexPacket</i>* returned by the
<i>indexes</i> method point to pixel data managed by the
<i>Pixels</i> class. The <i>Pixels</i> class is responsible for
releasing resources associated with the pixel view. This means that
the pointer should never be passed to delete() or free().</p>
<p style="margin-bottom: 0in">The pixel view is a small image in
which the pixels may be accessed, addressed, and updated, as shown
in the following example, which produces an image similar to the
one on the right (minus lines and text):</p>
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td>
<p><font color="#FF0000"><font face=
"Courier New, Courier"><font size="2">// Create base
image</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">Image image(Geometry(254,218),
"white");</font></font></font></p>
<p><font color="#FF0000"><font face=
"Courier New, Courier"><font size="2">// Set the image type to
TrueColor DirectClass representation.</font></font></font><br>
<font color="#000099"><font face=
"courier new, courier, monospace"><font size=
"2">image.type(TrueColorType);</font></font></font></p>
<p><font color="#FF0000"><font face=
"Courier New, Courier"><font size="2">// Ensure that there is only
one reference to underlying image</font></font></font><br>
<font color="#FF0000"><font face="Courier New, Courier"><font size=
"2">// If this is not done, then image pixels will not be
modified.</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">image.modifyImage();</font></font></font></p>
<p><font color="#FF0000"><font face=
"Courier New, Courier"><font size="2">// Allocate pixel
view</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">Pixels view(image);</font></font></font></p>
<p><font color="#FF0000"><font face=
"Courier New, Courier"><font size="2">// Set all pixels in region
anchored at 38x36, with size 160x230 to
green.</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">unsigned int columns = 196; unsigned int rows =
162;</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">Color green("green");</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">PixelPacket *pixels =
view.get(38,36,columns,rows);</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">for ( int row = 0; row < rows ; ++row
)</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">for ( int column = 0; column < columns ; ++column
)</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">*pixels++=green;</font></font></font></p>
<p><font color="#FF0000"><font face=
"Courier New, Courier"><font size="2">// Save changes to
image.<br></font></font></font> <font color="#000099"><font face=
"Courier New, Courier"><font size=
"2">view.sync();</font></font></font></p>
<p><font color="#FF0000"><font face=
"Courier New, Courier"><font size="2">// Set all pixels in region
anchored at 86x72, with size 108x67 to
yellow.</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">columns = 108; rows = 67;</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">Color yellow("yellow");</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">pixels = view.get(86,72,columns,rows);</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">for ( int row = 0; row < rows ; ++row
)</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">for ( int column = 0; column < columns ; ++column
)</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">*pixels++=yellow;</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">view.sync();</font></font></font></p>
<p><font color="#FF0000"><font face=
"Courier New, Courier"><font size="2">// Set pixel at position
108,94 to red</font></font></font><br>
<font color="#000099"><font face="Courier New, Courier"><font size=
"2">*(view.get(108,94,1,1)) = Color("red");</font></font></font>
</p>
<p><font color="#FF0000"><font face=
"Courier New, Courier"><font size="2">// Save changes to
image.<br></font></font></font> <font color="#000099"><font face=
"Courier New, Courier"><font size=
"2">view.sync();</font></font></font></p>
</td>
<td>
<p><a name="Graphic1" id="Graphic1"></a><img src="Cache.png" name=
"Graphic1" align="bottom" width="254" height="218" border="0" id=
"Graphic1"></p>
</td>
</tr>
</table>
<p style="margin-bottom: 0in"><i>Pixels</i> supports the following
methods:</p>
<p align="center" style="margin-bottom: 0in"><b>Pixel Cache
Methods</b></p>
<table width="100%" border="1" cellpadding="2" cellspacing="2">
<tr>
<td>
<p align="center"><b>Method</b></p>
</td>
<td>
<p align="center"><b>Returns</b></p>
</td>
<td>
<p align="center"><b>Signature</b></p>
</td>
<td>
<p align="center"><b>Description</b></p>
</td>
</tr>
<tr>
<td>
<p align="center"><a name="get" id="get"></a><font size=
"2">get</font></p>
</td>
<td>
<p><font size="2"><a href=
"PixelPacket.html">PixelPacket</a>*</font></p>
</td>
<td>
<p><font size="2">const int x_, const int y_, const unsigned const
int columns_, const unsigned int rows_</font></p>
</td>
<td>
<p><font size="2">Transfers read-write pixels from the image to the
pixel cache as defined by the specified rectangular region.
Modified pixels may be subsequently transferred back to the image
via <i>sync</i>. The value returned is intended for pixel access
only. It should never be deallocated.</font></p>
</td>
</tr>
<tr>
<td>
<p align="center"><a name="getConst" id="getConst"></a><font size=
"2">getConst</font></p>
</td>
<td>
<p><font size="2">const <a href=
"PixelPacket.html">PixelPacket</a>*</font></p>
</td>
<td>
<p><font size="2">const int x_, const int y_, const unsigned int
columns_, const unsigned int rows_</font></p>
</td>
<td>
<p><font size="2">Transfers read-only pixels from the image to the
pixel cache as defined by the specified rectangular
region.</font></p>
</td>
</tr>
<tr>
<td>
<p align="center"><a name="set" id="set"></a><font size=
"2">set</font></p>
</td>
<td>
<p><font size="2"><a href=
"PixelPacket.html">PixelPacket</a>*</font></p>
</td>
<td>
<p><font size="2">const int x_, const int y_, const unsigned int
columns_, const unsigned int rows_</font></p>
</td>
<td>
<p><font size="2">Allocates a pixel cache region to store image
pixels as defined by the region rectangle. This area is
subsequently transferred from the pixel cache to the image via
<i>sync</i>. The value returned is intended for pixel access only.
It should never be deallocated.</font></p>
</td>
</tr>
<tr>
<td>
<p align="center"><a name="sync" id="sync"></a><font size=
"2">sync</font></p>
</td>
<td>
<p><font size="2">void</font></p>
</td>
<td>
<p><font size="2">void</font></p>
</td>
<td>
<p><font size="2">Transfers the image cache pixels to the
image.</font></p>
</td>
</tr>
<tr>
<td>
<p align="center"><a name="indexes" id="indexes"></a><font size=
"2">indexes</font></p>
</td>
<td>
<p><font size="2">IndexPacket*</font></p>
</td>
<td>
<p><font size="2">void</font></p>
</td>
<td>
<p><font size="2">Returns the PsuedoColor pixel indexes
corresponding to the pixel region defined by the last <a href=
"#get">get</a> , <a href="#getConst">getConst</a>, or <a href=
"#set">set</a> call. Only valid for PseudoColor and CMYKA images.
The pixel indexes (an array of type</font> <font size=
"2"><i>IndexPacket</i></font><font size="2">, which is
typedef</font> <font size="2"><i>Quantum</i></font><font size="2">,
which is itself typedef</font> <font size="2"><i>unsigned
char</i></font><font size="2">, or</font> <font size=
"2"><i>unsigned short</i></font><font size="2">, depending on the
value of the</font> <font size="2"><i>QuantumDepth</i></font>
<font size="2">define) provide the</font> <font size=
"2"><span lang="en-US">colormap</span></font> <font size="2">index
(see <a href="Image.html#colormap">colorMap</a>) for each pixel in
the image. For CMYKA images, the indexes represent the matte
(alpha) channel. The value returned is intended for pixel access
only. It should never be deallocated.</font></p>
</td>
</tr>
<tr>
<td>
<p align="center"><a name="x" id="x"></a><font size=
"2">x</font></p>
</td>
<td>
<p><font size="2">int</font></p>
</td>
<td>
<p><font size="2">void</font></p>
</td>
<td>
<p><font size="2">Left ordinate of view</font></p>
</td>
</tr>
<tr>
<td>
<p align="center"><a name="y" id="y"></a><font size=
"2">y</font></p>
</td>
<td>
<p><font size="2">int</font></p>
</td>
<td>
<p><font size="2">void</font></p>
</td>
<td>
<p><font size="2">Top ordinate of view</font></p>
</td>
</tr>
<tr>
<td>
<p align="center"><a name="columns" id="columns"></a><font size=
"2">columns</font></p>
</td>
<td>
<p><font size="2">unsigned int</font></p>
</td>
<td>
<p><font size="2">void</font></p>
</td>
<td>
<p><font size="2">Width of view</font></p>
</td>
</tr>
<tr>
<td>
<p align="center"><a name="rows" id="rows"></a><font size=
"2">rows</font></p>
</td>
<td>
<p><font size="2">unsigned int</font></p>
</td>
<td>
<p><font size="2">void</font></p>
</td>
<td>
<p><font size="2">Height of view</font></p>
</td>
</tr>
</table>
<p><br>
<br></p>
</body>
</html>
|