/usr/share/gtk-doc/html/cairo/cairo-Raster-Sources.html is in libcairo2-doc 1.13.0~20140204-0ubuntu1.
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 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Raster Sources</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
<link rel="up" href="cairo-drawing.html" title="Drawing">
<link rel="prev" href="cairo-text.html" title="text">
<link rel="next" href="cairo-fonts.html" title="Fonts">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="cairo-text.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="cairo-drawing.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
<td><a accesskey="n" href="cairo-fonts.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#cairo-Raster-Sources.synopsis" class="shortcut">Top</a>
|
<a href="#cairo-Raster-Sources.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="cairo-Raster-Sources"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cairo-Raster-Sources.top_of_page"></a>Raster Sources</span></h2>
<p>Raster Sources — Supplying arbitrary image data</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="cairo-Raster-Sources.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="returnvalue">cairo_pattern_t</span></a> * <a class="link" href="cairo-Raster-Sources.html#cairo-pattern-create-raster-source" title="cairo_pattern_create_raster_source ()">cairo_pattern_create_raster_source</a> (<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="cairo-cairo-surface-t.html#cairo-content-t" title="enum cairo_content_t"><span class="type">cairo_content_t</span></a> content</code></em>,
<em class="parameter"><code><span class="type">int</span> width</code></em>,
<em class="parameter"><code><span class="type">int</span> height</code></em>);
<span class="returnvalue">void</span> <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-set-callback-data" title="cairo_raster_source_pattern_set_callback_data ()">cairo_raster_source_pattern_set_callback_data</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *data</code></em>);
<span class="returnvalue">void</span> * <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-get-callback-data" title="cairo_raster_source_pattern_get_callback_data ()">cairo_raster_source_pattern_get_callback_data</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>);
<span class="returnvalue">void</span> <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-set-acquire" title="cairo_raster_source_pattern_set_acquire ()">cairo_raster_source_pattern_set_acquire</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-acquire-func-t" title="cairo_raster_source_acquire_func_t ()"><span class="type">cairo_raster_source_acquire_func_t</span></a> acquire</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-release-func-t" title="cairo_raster_source_release_func_t ()"><span class="type">cairo_raster_source_release_func_t</span></a> release</code></em>);
<span class="returnvalue">void</span> <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-get-acquire" title="cairo_raster_source_pattern_get_acquire ()">cairo_raster_source_pattern_get_acquire</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-acquire-func-t" title="cairo_raster_source_acquire_func_t ()"><span class="type">cairo_raster_source_acquire_func_t</span></a> *acquire</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-release-func-t" title="cairo_raster_source_release_func_t ()"><span class="type">cairo_raster_source_release_func_t</span></a> *release</code></em>);
<span class="returnvalue">void</span> <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-set-snapshot" title="cairo_raster_source_pattern_set_snapshot ()">cairo_raster_source_pattern_set_snapshot</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-snapshot-func-t" title="cairo_raster_source_snapshot_func_t ()"><span class="type">cairo_raster_source_snapshot_func_t</span></a> snapshot</code></em>);
<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-snapshot-func-t" title="cairo_raster_source_snapshot_func_t ()"><span class="returnvalue">cairo_raster_source_snapshot_func_t</span></a> <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-get-snapshot" title="cairo_raster_source_pattern_get_snapshot ()">cairo_raster_source_pattern_get_snapshot</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>);
<span class="returnvalue">void</span> <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-set-copy" title="cairo_raster_source_pattern_set_copy ()">cairo_raster_source_pattern_set_copy</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-copy-func-t" title="cairo_raster_source_copy_func_t ()"><span class="type">cairo_raster_source_copy_func_t</span></a> copy</code></em>);
<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-copy-func-t" title="cairo_raster_source_copy_func_t ()"><span class="returnvalue">cairo_raster_source_copy_func_t</span></a> <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-get-copy" title="cairo_raster_source_pattern_get_copy ()">cairo_raster_source_pattern_get_copy</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>);
<span class="returnvalue">void</span> <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-set-finish" title="cairo_raster_source_pattern_set_finish ()">cairo_raster_source_pattern_set_finish</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-finish-func-t" title="cairo_raster_source_finish_func_t ()"><span class="type">cairo_raster_source_finish_func_t</span></a> finish</code></em>);
<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-finish-func-t" title="cairo_raster_source_finish_func_t ()"><span class="returnvalue">cairo_raster_source_finish_func_t</span></a> <a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-pattern-get-finish" title="cairo_raster_source_pattern_get_finish ()">cairo_raster_source_pattern_get_finish</a>
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>);
<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="returnvalue">cairo_surface_t</span></a> (<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-acquire-func-t" title="cairo_raster_source_acquire_func_t ()">*cairo_raster_source_acquire_func_t</a>)
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>,
<em class="parameter"><code><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a> *target</code></em>,
<em class="parameter"><code>const <a class="link" href="cairo-Types.html#cairo-rectangle-int-t" title="cairo_rectangle_int_t"><span class="type">cairo_rectangle_int_t</span></a> *extents</code></em>);
<span class="returnvalue">void</span> (<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-release-func-t" title="cairo_raster_source_release_func_t ()">*cairo_raster_source_release_func_t</a>)
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>,
<em class="parameter"><code><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a> *surface</code></em>);
<a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a> (<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-snapshot-func-t" title="cairo_raster_source_snapshot_func_t ()">*cairo_raster_source_snapshot_func_t</a>)
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>);
<a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a> (<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-copy-func-t" title="cairo_raster_source_copy_func_t ()">*cairo_raster_source_copy_func_t</a>) (<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>,
<em class="parameter"><code>const <a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *other</code></em>);
<span class="returnvalue">void</span> (<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-finish-func-t" title="cairo_raster_source_finish_func_t ()">*cairo_raster_source_finish_func_t</a>)
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="cairo-Raster-Sources.description"></a><h2>Description</h2>
<p>
The raster source provides the ability to supply arbitrary pixel data
whilst rendering. The pixels are queried at the time of rasterisation
by means of user callback functions, allowing for the ultimate
flexibility. For example, in handling compressed image sources, you
may keep a MRU cache of decompressed images and decompress sources on the
fly and discard old ones to conserve memory.
</p>
<p>
For the raster source to be effective, you must at least specify
the acquire and release callbacks which are used to retrieve the pixel
data for the region of interest and demark when it can be freed afterwards.
Other callbacks are provided for when the pattern is copied temporarily
during rasterisation, or more permanently as a snapshot in order to keep
the pixel data available for printing.
</p>
</div>
<div class="refsect1">
<a name="cairo-Raster-Sources.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="cairo-pattern-create-raster-source"></a><h3>cairo_pattern_create_raster_source ()</h3>
<pre class="programlisting"><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="returnvalue">cairo_pattern_t</span></a> * cairo_pattern_create_raster_source (<em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
<em class="parameter"><code><a class="link" href="cairo-cairo-surface-t.html#cairo-content-t" title="enum cairo_content_t"><span class="type">cairo_content_t</span></a> content</code></em>,
<em class="parameter"><code><span class="type">int</span> width</code></em>,
<em class="parameter"><code><span class="type">int</span> height</code></em>);</pre>
<p>
Creates a new user pattern for providing pixel data.
</p>
<p>
Use the setter functions to associate callbacks with the returned
pattern. The only mandatory callback is acquire.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>the user data to be passed to all callbacks</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>content</code></em> :</span></p></td>
<td>content type for the pixel data that will be returned. Knowing
the content type ahead of time is used for analysing the operation and
picking the appropriate rendering path.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td>maximum size of the sample area</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td>maximum size of the sample area</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly created <a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>. Free with
<a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-destroy" title="cairo_pattern_destroy ()"><code class="function">cairo_pattern_destroy()</code></a> when you are done using it.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-set-callback-data"></a><h3>cairo_raster_source_pattern_set_callback_data ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> cairo_raster_source_pattern_set_callback_data
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *data</code></em>);</pre>
<p>
Updates the user data that is provided to all callbacks.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to update</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the user data to be passed to all callbacks</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-get-callback-data"></a><h3>cairo_raster_source_pattern_get_callback_data ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> * cairo_raster_source_pattern_get_callback_data
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>);</pre>
<p>
Queries the current user data.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to update</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the current user-data passed to each callback</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-set-acquire"></a><h3>cairo_raster_source_pattern_set_acquire ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> cairo_raster_source_pattern_set_acquire
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-acquire-func-t" title="cairo_raster_source_acquire_func_t ()"><span class="type">cairo_raster_source_acquire_func_t</span></a> acquire</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-release-func-t" title="cairo_raster_source_release_func_t ()"><span class="type">cairo_raster_source_release_func_t</span></a> release</code></em>);</pre>
<p>
Specifies the callbacks used to generate the image surface for a rendering
operation (acquire) and the function used to cleanup that surface afterwards.
</p>
<p>
The <em class="parameter"><code>acquire</code></em> callback should create a surface (preferably an image
surface created to match the target using
<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-create-similar-image" title="cairo_surface_create_similar_image ()"><code class="function">cairo_surface_create_similar_image()</code></a>) that defines at least the region
of interest specified by extents. The surface is allowed to be the entire
sample area, but if it does contain a subsection of the sample area,
the surface extents should be provided by setting the device offset (along
with its width and height) using <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-set-device-offset" title="cairo_surface_set_device_offset ()"><code class="function">cairo_surface_set_device_offset()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to update</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>acquire</code></em> :</span></p></td>
<td>acquire callback</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>release</code></em> :</span></p></td>
<td>release callback</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-get-acquire"></a><h3>cairo_raster_source_pattern_get_acquire ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> cairo_raster_source_pattern_get_acquire
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-acquire-func-t" title="cairo_raster_source_acquire_func_t ()"><span class="type">cairo_raster_source_acquire_func_t</span></a> *acquire</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-release-func-t" title="cairo_raster_source_release_func_t ()"><span class="type">cairo_raster_source_release_func_t</span></a> *release</code></em>);</pre>
<p>
Queries the current acquire and release callbacks.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to query</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>acquire</code></em> :</span></p></td>
<td>return value for the current acquire callback</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>release</code></em> :</span></p></td>
<td>return value for the current release callback</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-set-snapshot"></a><h3>cairo_raster_source_pattern_set_snapshot ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> cairo_raster_source_pattern_set_snapshot
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-snapshot-func-t" title="cairo_raster_source_snapshot_func_t ()"><span class="type">cairo_raster_source_snapshot_func_t</span></a> snapshot</code></em>);</pre>
<p>
Sets the callback that will be used whenever a snapshot is taken of the
pattern, that is whenever the current contents of the pattern should be
preserved for later use. This is typically invoked whilst printing.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to update</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>snapshot</code></em> :</span></p></td>
<td>snapshot callback</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-get-snapshot"></a><h3>cairo_raster_source_pattern_get_snapshot ()</h3>
<pre class="programlisting"><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-snapshot-func-t" title="cairo_raster_source_snapshot_func_t ()"><span class="returnvalue">cairo_raster_source_snapshot_func_t</span></a> cairo_raster_source_pattern_get_snapshot
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>);</pre>
<p>
Queries the current snapshot callback.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to query</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the current snapshot callback</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-set-copy"></a><h3>cairo_raster_source_pattern_set_copy ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> cairo_raster_source_pattern_set_copy
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-copy-func-t" title="cairo_raster_source_copy_func_t ()"><span class="type">cairo_raster_source_copy_func_t</span></a> copy</code></em>);</pre>
<p>
Updates the copy callback which is used whenever a temporary copy of the
pattern is taken.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to update</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>copy</code></em> :</span></p></td>
<td>the copy callback</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-get-copy"></a><h3>cairo_raster_source_pattern_get_copy ()</h3>
<pre class="programlisting"><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-copy-func-t" title="cairo_raster_source_copy_func_t ()"><span class="returnvalue">cairo_raster_source_copy_func_t</span></a> cairo_raster_source_pattern_get_copy
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>);</pre>
<p>
Queries the current copy callback.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to query</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the current copy callback</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-set-finish"></a><h3>cairo_raster_source_pattern_set_finish ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> cairo_raster_source_pattern_set_finish
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-finish-func-t" title="cairo_raster_source_finish_func_t ()"><span class="type">cairo_raster_source_finish_func_t</span></a> finish</code></em>);</pre>
<p>
Updates the finish callback which is used whenever a pattern (or a copy
thereof) will no longer be used.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to update</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>finish</code></em> :</span></p></td>
<td>the finish callback</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-pattern-get-finish"></a><h3>cairo_raster_source_pattern_get_finish ()</h3>
<pre class="programlisting"><a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-finish-func-t" title="cairo_raster_source_finish_func_t ()"><span class="returnvalue">cairo_raster_source_finish_func_t</span></a> cairo_raster_source_pattern_get_finish
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>);</pre>
<p>
Queries the current finish callback.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern to query</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the current finish callback</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-acquire-func-t"></a><h3>cairo_raster_source_acquire_func_t ()</h3>
<pre class="programlisting"><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="returnvalue">cairo_surface_t</span></a> (*cairo_raster_source_acquire_func_t)
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>,
<em class="parameter"><code><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a> *target</code></em>,
<em class="parameter"><code>const <a class="link" href="cairo-Types.html#cairo-rectangle-int-t" title="cairo_rectangle_int_t"><span class="type">cairo_rectangle_int_t</span></a> *extents</code></em>);</pre>
<p>
<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-acquire-func-t" title="cairo_raster_source_acquire_func_t ()"><span class="type">cairo_raster_source_acquire_func_t</span></a> is the type of function which is
called when a pattern is being rendered from. It should create a surface
that provides the pixel data for the region of interest as defined by
extents, though the surface itself does not have to be limited to that
area. For convenience the surface should probably be of image type,
created with <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-create-similar-image" title="cairo_surface_create_similar_image ()"><code class="function">cairo_surface_create_similar_image()</code></a> for the target (which
enables the number of copies to be reduced during transfer to the
device). Another option, might be to return a similar surface to the
target for explicit handling by the application of a set of cached sources
on the device. The region of sample data provided should be defined using
<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-set-device-offset" title="cairo_surface_set_device_offset ()"><code class="function">cairo_surface_set_device_offset()</code></a> to specify the top-left corner of the
sample data (along with width and height of the surface).
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern being rendered from</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
<td>the user data supplied during creation</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>target</code></em> :</span></p></td>
<td>the rendering target surface</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>extents</code></em> :</span></p></td>
<td>rectangular region of interest in pixels in sample space</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-release-func-t"></a><h3>cairo_raster_source_release_func_t ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> (*cairo_raster_source_release_func_t)
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>,
<em class="parameter"><code><a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a> *surface</code></em>);</pre>
<p>
<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-release-func-t" title="cairo_raster_source_release_func_t ()"><span class="type">cairo_raster_source_release_func_t</span></a> is the type of function which is
called when the pixel data is no longer being access by the pattern
for the rendering operation. Typically this function will simply
destroy the surface created during acquire.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern being rendered from</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
<td>the user data supplied during creation</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>surface</code></em> :</span></p></td>
<td>the surface created during acquire</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-snapshot-func-t"></a><h3>cairo_raster_source_snapshot_func_t ()</h3>
<pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a> (*cairo_raster_source_snapshot_func_t)
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>);</pre>
<p>
<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-snapshot-func-t" title="cairo_raster_source_snapshot_func_t ()"><span class="type">cairo_raster_source_snapshot_func_t</span></a> is the type of function which is
called when the pixel data needs to be preserved for later use
during printing. This pattern will be accessed again later, and it
is expected to provide the pixel data that was current at the time
of snapshotting.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern being rendered from</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
<td>the user data supplied during creation</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>CAIRO_STATUS_SUCCESS on success, or one of the
<a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="type">cairo_status_t</span></a> error codes for failure.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-copy-func-t"></a><h3>cairo_raster_source_copy_func_t ()</h3>
<pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a> (*cairo_raster_source_copy_func_t) (<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>,
<em class="parameter"><code>const <a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *other</code></em>);</pre>
<p>
<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-copy-func-t" title="cairo_raster_source_copy_func_t ()"><span class="type">cairo_raster_source_copy_func_t</span></a> is the type of function which is
called when the pattern gets copied as a normal part of rendering.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the <a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> that was copied to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
<td>the user data supplied during creation</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>other</code></em> :</span></p></td>
<td>the <a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> being used as the source for the copy</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>CAIRO_STATUS_SUCCESS on success, or one of the
<a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="type">cairo_status_t</span></a> error codes for failure.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-raster-source-finish-func-t"></a><h3>cairo_raster_source_finish_func_t ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> (*cairo_raster_source_finish_func_t)
(<em class="parameter"><code><a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a> *pattern</code></em>,
<em class="parameter"><code><span class="type">void</span> *callback_data</code></em>);</pre>
<p>
<a class="link" href="cairo-Raster-Sources.html#cairo-raster-source-finish-func-t" title="cairo_raster_source_finish_func_t ()"><span class="type">cairo_raster_source_finish_func_t</span></a> is the type of function which is
called when the pattern (or a copy thereof) is no longer required.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>pattern</code></em> :</span></p></td>
<td>the pattern being rendered from</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback_data</code></em> :</span></p></td>
<td>the user data supplied during creation</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
</div>
<div class="refsect1">
<a name="cairo-Raster-Sources.see-also"></a><h2>See Also</h2>
<a class="link" href="cairo-cairo-pattern-t.html#cairo-pattern-t" title="cairo_pattern_t"><span class="type">cairo_pattern_t</span></a>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.19</div>
</body>
</html>
|