/usr/share/gtk-doc/html/cairo/cairo-Recording-Surfaces.html is in libcairo2-doc 1.12.2-3.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Recording Surfaces</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
<link rel="up" href="cairo-surfaces.html" title="Surfaces">
<link rel="prev" href="cairo-PostScript-Surfaces.html" title="PostScript Surfaces">
<link rel="next" href="cairo-Win32-Surfaces.html" title="Win32 Surfaces">
<meta name="generator" content="GTK-Doc V1.18 (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-PostScript-Surfaces.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="cairo-surfaces.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-Win32-Surfaces.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-Recording-Surfaces.synopsis" class="shortcut">Top</a>
|
<a href="#cairo-Recording-Surfaces.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="cairo-Recording-Surfaces"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cairo-Recording-Surfaces.top_of_page"></a>Recording Surfaces</span></h2>
<p>Recording Surfaces — Records all drawing operations</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="cairo-Recording-Surfaces.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">#define <a class="link" href="cairo-Recording-Surfaces.html#CAIRO-HAS-RECORDING-SURFACE:CAPS" title="CAIRO_HAS_RECORDING_SURFACE">CAIRO_HAS_RECORDING_SURFACE</a>
<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-Recording-Surfaces.html#cairo-recording-surface-create" title="cairo_recording_surface_create ()">cairo_recording_surface_create</a> (<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>const <a class="link" href="cairo-cairo-t.html#cairo-rectangle-t" title="cairo_rectangle_t"><span class="type">cairo_rectangle_t</span></a> *extents</code></em>);
<span class="returnvalue">void</span> <a class="link" href="cairo-Recording-Surfaces.html#cairo-recording-surface-ink-extents" title="cairo_recording_surface_ink_extents ()">cairo_recording_surface_ink_extents</a> (<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>,
<em class="parameter"><code><span class="type">double</span> *x0</code></em>,
<em class="parameter"><code><span class="type">double</span> *y0</code></em>,
<em class="parameter"><code><span class="type">double</span> *width</code></em>,
<em class="parameter"><code><span class="type">double</span> *height</code></em>);
<a class="link" href="cairo-Types.html#cairo-bool-t" title="cairo_bool_t"><span class="returnvalue">cairo_bool_t</span></a> <a class="link" href="cairo-Recording-Surfaces.html#cairo-recording-surface-get-extents" title="cairo_recording_surface_get_extents ()">cairo_recording_surface_get_extents</a> (<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>,
<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-rectangle-t" title="cairo_rectangle_t"><span class="type">cairo_rectangle_t</span></a> *extents</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="cairo-Recording-Surfaces.description"></a><h2>Description</h2>
<p>
A recording surface is a surface that records all drawing operations at
the highest level of the surface backend interface, (that is, the
level of paint, mask, stroke, fill, and show_text_glyphs). The recording
surface can then be "replayed" against any target surface by using it
as a source surface.
</p>
<p>
If you want to replay a surface so that the results in target will be
identical to the results that would have been obtained if the original
operations applied to the recording surface had instead been applied to the
target surface, you can use code like this:
</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6</pre></td>
<td class="listing_code"><pre class="programlisting">cairo_t <span class="gtkdoc opt">*</span>cr<span class="gtkdoc opt">;</span>
cr <span class="gtkdoc opt">=</span> <span class="function"><a href="../cairo/cairo-cairo-t.html#cairo-create">cairo_create</a></span> <span class="gtkdoc opt">(</span>target<span class="gtkdoc opt">);</span>
<span class="function"><a href="../cairo/cairo-cairo-t.html#cairo-set-source-surface">cairo_set_source_surface</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">,</span> recording_surface<span class="gtkdoc opt">,</span> <span class="number">0.0</span><span class="gtkdoc opt">,</span> <span class="number">0.0</span><span class="gtkdoc opt">);</span>
<span class="function"><a href="../cairo/cairo-cairo-t.html#cairo-paint">cairo_paint</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span>
<span class="function"><a href="../cairo/cairo-cairo-t.html#cairo-destroy">cairo_destroy</a></span> <span class="gtkdoc opt">(</span>cr<span class="gtkdoc opt">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p>
</p>
<p>
A recording surface is logically unbounded, i.e. it has no implicit constraint
on the size of the drawing surface. However, in practice this is rarely
useful as you wish to replay against a particular target surface with
known bounds. For this case, it is more efficient to specify the target
extents to the recording surface upon creation.
</p>
<p>
The recording phase of the recording surface is careful to snapshot all
necessary objects (paths, patterns, etc.), in order to achieve
accurate replay. The efficiency of the recording surface could be
improved by improving the implementation of snapshot for the
various objects. For example, it would be nice to have a
copy-on-write implementation for _cairo_surface_snapshot.
</p>
</div>
<div class="refsect1">
<a name="cairo-Recording-Surfaces.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="CAIRO-HAS-RECORDING-SURFACE:CAPS"></a><h3>CAIRO_HAS_RECORDING_SURFACE</h3>
<pre class="programlisting">#define CAIRO_HAS_RECORDING_SURFACE 1
</pre>
<p>
Defined if the recording surface backend is available.
The recording surface backend is always built in.
This macro was added for completeness in cairo 1.10.
</p>
<p class="since">Since 1.10</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-recording-surface-create"></a><h3>cairo_recording_surface_create ()</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_recording_surface_create (<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>const <a class="link" href="cairo-cairo-t.html#cairo-rectangle-t" title="cairo_rectangle_t"><span class="type">cairo_rectangle_t</span></a> *extents</code></em>);</pre>
<p>
Creates a recording-surface which can be used to record all drawing operations
at the highest level (that is, the level of paint, mask, stroke, fill
and show_text_glyphs). The recording surface can then be "replayed" against
any target surface by using it as a source to drawing operations.
</p>
<p>
The recording phase of the recording surface is careful to snapshot all
necessary objects (paths, patterns, etc.), in order to achieve
accurate replay.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>content</code></em> :</span></p></td>
<td>the content of the recording surface</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>extents</code></em> :</span></p></td>
<td>the extents to record in pixels, can be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to record
unbounded operations.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a pointer to the newly created surface. The caller
owns the surface and should call <a class="link" href="cairo-cairo-surface-t.html#cairo-surface-destroy" title="cairo_surface_destroy ()"><code class="function">cairo_surface_destroy()</code></a> when done
with it.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.10</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-recording-surface-ink-extents"></a><h3>cairo_recording_surface_ink_extents ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> cairo_recording_surface_ink_extents (<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>,
<em class="parameter"><code><span class="type">double</span> *x0</code></em>,
<em class="parameter"><code><span class="type">double</span> *y0</code></em>,
<em class="parameter"><code><span class="type">double</span> *width</code></em>,
<em class="parameter"><code><span class="type">double</span> *height</code></em>);</pre>
<p>
Measures the extents of the operations stored within the recording-surface.
This is useful to compute the required size of an image surface (or
equivalent) into which to replay the full sequence of drawing operations.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>surface</code></em> :</span></p></td>
<td>a <span class="type">cairo_recording_surface_t</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
<td>the x-coordinate of the top-left of the ink bounding box</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
<td>the y-coordinate of the top-left of the ink bounding box</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td>the width of the ink bounding box</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td>the height of the ink bounding box</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.10</p>
</div>
<hr>
<div class="refsect2">
<a name="cairo-recording-surface-get-extents"></a><h3>cairo_recording_surface_get_extents ()</h3>
<pre class="programlisting"><a class="link" href="cairo-Types.html#cairo-bool-t" title="cairo_bool_t"><span class="returnvalue">cairo_bool_t</span></a> cairo_recording_surface_get_extents (<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>,
<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-rectangle-t" title="cairo_rectangle_t"><span class="type">cairo_rectangle_t</span></a> *extents</code></em>);</pre>
<p>
Get the extents of the recording-surface.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>surface</code></em> :</span></p></td>
<td>a <span class="type">cairo_recording_surface_t</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>extents</code></em> :</span></p></td>
<td>the <a class="link" href="cairo-cairo-t.html#cairo-rectangle-t" title="cairo_rectangle_t"><span class="type">cairo_rectangle_t</span></a> to be assigned the extents</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the surface is bounded, of recording type, and
not in an error state, otherwise <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.12</p>
</div>
</div>
<div class="refsect1">
<a name="cairo-Recording-Surfaces.see-also"></a><h2>See Also</h2>
<a class="link" href="cairo-cairo-surface-t.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|