Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 2a38b732199ac205772f2322bdd57a78 > files > 68

lib64cairomm1.0-devel-1.10.0-3.mga4.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
        <title>cairomm: Cairo::ImageSurface Class Reference</title>
        <link href="cairomm.css" rel="stylesheet" type="text/css">
    </head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceCairo.html">Cairo</a> </li>
      <li class="navelem"><a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a> </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> </div>
  <div class="headertitle">
<h1>Cairo::ImageSurface Class Reference</h1> </div>
</div>
<div class="contents">
<!-- doxytag: class="Cairo::ImageSurface" --><!-- doxytag: inherits="Cairo::Surface" -->
<p>Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the calling code. <a href="#_details">More...</a></p>
<div class="dynheader">
Inheritance diagram for Cairo::ImageSurface:</div>
<div class="dyncontent">
<div class="center"><img src="classCairo_1_1ImageSurface__inherit__graph.png" border="0" usemap="#Cairo_1_1ImageSurface_inherit__map" alt="Inheritance graph"/></div>
<map name="Cairo_1_1ImageSurface_inherit__map" id="Cairo_1_1ImageSurface_inherit__map">
<area shape="rect" id="node2" href="classCairo_1_1Surface.html" title="A cairo surface represents an image, either as the destination of a drawing operation or as source wh..." alt="" coords="24,6,128,37"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classCairo_1_1ImageSurface-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#a19a7d3c6f4320c4d812629b3c18925ac">ImageSurface</a> (cairo_surface_t*<a class="el" href="classCairo_1_1Surface.html#ad176eb7343b5902df3c19f9f56e59fb4">cobject</a>, bool has_reference=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a C++ wrapper for the C instance. <a href="#a19a7d3c6f4320c4d812629b3c18925ac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#a489f33357db18c23bdf8ebd5d07d8264">~ImageSurface</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#af75b30cde988ad6959bb75862f5b6e2a">get_width</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the width of the <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the ca...">ImageSurface</a> in pixels. <a href="#af75b30cde988ad6959bb75862f5b6e2a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#aa0e17bed71b125fd4725386ee1f14d07">get_height</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the height of the <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the ca...">ImageSurface</a> in pixels. <a href="#aa0e17bed71b125fd4725386ee1f14d07"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#a94ba52fe4a201579c8a5541717822bdb">get_data</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a pointer to the data of the image surface, for direct inspection or modification. <a href="#a94ba52fe4a201579c8a5541717822bdb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const unsigned char*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#a8858eb704ebe2118baf83f2a104b9140">get_data</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Format</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#aedccf9d08b3e5852c0bbb195cf1379a8">get_format</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">gets the format of the surface <a href="#aedccf9d08b3e5852c0bbb195cf1379a8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#a4b33c7f1c03197eb66dac3e909c5a39a">get_stride</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return value: the stride of the image surface in bytes (or 0 if is not an image surface). <a href="#a4b33c7f1c03197eb66dac3e909c5a39a"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#ac74f130a3bb36bd9fd70003cd8562ce5">format_stride_for_width</a> (<a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Cairo::Format</a> format, int width)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This function provides a stride value that will respect all alignment requirements of the accelerated image-rendering code within cairo. <a href="#ac74f130a3bb36bd9fd70003cd8562ce5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt; <a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#a82887e1a0480ab16aa891e135f2b28d6">create</a> (<a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Format</a> format, int width, int height)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an image surface of the specified format and dimensions. <a href="#a82887e1a0480ab16aa891e135f2b28d6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt; <a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#afeb1b8203f9fa23ff4bca7b70723f370">create</a> (unsigned char* data, <a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Format</a> format, int width, int height, int <a class="elRef" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01176.html#ga4d464eb22d9ad823ecb9b7eab22c6300">stride</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an image surface for the provided pixel data. <a href="#afeb1b8203f9fa23ff4bca7b70723f370"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt; <a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#aac35bcd255347574036746810f8a2978">create_from_png</a> (<a class="elRef" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00254.html">std::string</a> filename)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new image surface and initializes the contents to the given PNG file. <a href="#aac35bcd255347574036746810f8a2978"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt; <a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#a7ac275170e7235457c9806aec7cf6f6a">create_from_png_stream</a> (const <a class="elRef" href="../../../libsigc++-2.0/reference/html/classsigc_1_1slot.html">SlotReadFunc</a>&amp; read_func)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new image surface from PNG data read incrementally via the read_func function. <a href="#a7ac275170e7235457c9806aec7cf6f6a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt; <a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1ImageSurface.html#a43a9cf2aaaa8b2ef91da00bb244c7098">create_from_png</a> (cairo_read_func_t read_func, void* closure)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the calling code. </p>
<p>The supported image formats are those defined in <a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Cairo::Format</a></p>
<p>An <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the ca...">ImageSurface</a> is the most generic type of <a class="el" href="classCairo_1_1Surface.html" title="A cairo surface represents an image, either as the destination of a drawing operation or as source wh...">Surface</a> and the only one that is available by default. You can either create an <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the ca...">ImageSurface</a> whose data is managed by <a class="el" href="namespaceCairo.html">Cairo</a>, or you can create an <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the ca...">ImageSurface</a> with a data buffer that you allocated yourself so that you can have full access to the data.</p>
<p>When you create an <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the ca...">ImageSurface</a> with your own data buffer, you are free to examine the results at any point and do whatever you want with it. Note that if you modify anything and later want to continue to draw to the surface with cairo, you must let cairo know via <a class="el" href="classCairo_1_1Surface.html#a77b1f860cc55f4ad168e100108e0b7bb" title="Tells cairo to consider the data buffer dirty.">Cairo::Surface::mark_dirty()</a></p>
<p>Note that like all surfaces, an <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the ca...">ImageSurface</a> is a reference-counted object that should be used via <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">Cairo::RefPtr</a>. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a19a7d3c6f4320c4d812629b3c18925ac"></a><!-- doxytag: member="Cairo::ImageSurface::ImageSurface" ref="a19a7d3c6f4320c4d812629b3c18925ac" args="(cairo_surface_t *cobject, bool has_reference=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cairo::ImageSurface::ImageSurface </td>
          <td>(</td>
          <td class="paramtype">cairo_surface_t *&#160;</td>
          <td class="paramname"><em>cobject</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>has_reference</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a C++ wrapper for the C instance. </p>
<p>This C++ instance should then be given to a <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">RefPtr</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">cobject</td><td>The C instance. </td></tr>
    <tr><td class="paramname">has_reference</td><td>Whether we already have a reference. Otherwise, the constructor will take an extra reference. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a489f33357db18c23bdf8ebd5d07d8264"></a><!-- doxytag: member="Cairo::ImageSurface::~ImageSurface" ref="a489f33357db18c23bdf8ebd5d07d8264" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual Cairo::ImageSurface::~ImageSurface </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a82887e1a0480ab16aa891e135f2b28d6"></a><!-- doxytag: member="Cairo::ImageSurface::create" ref="a82887e1a0480ab16aa891e135f2b28d6" args="(Format format, int width, int height)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt;<a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a>&gt; Cairo::ImageSurface::create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Format</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates an image surface of the specified format and dimensions. </p>
<p>Initially the surface contents are all 0. (Specifically, within each pixel, each color or alpha channel belonging to format will be 0. The contents of bits within a pixel, but not belonging to the given format are undefined).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">format</td><td>format of pixels in the surface to create </td></tr>
    <tr><td class="paramname">width</td><td>width of the surface, in pixels </td></tr>
    <tr><td class="paramname">height</td><td>height of the surface, in pixels </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">RefPtr</a> to the newly created surface. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="image-surface_8cc-example.html#a1">image-surface.cc</a>, <a class="el" href="toy-text_8cc-example.html#a1">toy-text.cc</a>, and <a class="el" href="user-font_8cc-example.html#a2">user-font.cc</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="afeb1b8203f9fa23ff4bca7b70723f370"></a><!-- doxytag: member="Cairo::ImageSurface::create" ref="afeb1b8203f9fa23ff4bca7b70723f370" args="(unsigned char *data, Format format, int width, int height, int stride)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt;<a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a>&gt; Cairo::ImageSurface::create </td>
          <td>(</td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Format</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stride</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates an image surface for the provided pixel data. </p>
<p>The output buffer must be kept around until the surface is destroyed or <a class="el" href="classCairo_1_1Surface.html#a8d8afee4ddb4935b85698f27099646a0" title="This function finishes the surface and drops all references to external resources.">finish()</a> is called on the surface. The initial contents of buffer will be used as the initial image contents; you must explicitly clear the buffer, using, for example, <a class="el" href="classCairo_1_1Context.html#a85ee124b89c43dc29ff0d964bd005c11" title="Adds a closed-subpath rectangle of the given size to the current path at position (x...">Context::rectangle()</a> and <a class="el" href="classCairo_1_1Context.html#a0a484790884dd138108b07c0ebbbe21d" title="A drawing operator that fills the current path according to the current fill rule, (each sub-path is implicitly closed before being filled).">Context::fill()</a> if you want it cleared.</p>
<p>Note that the stride may be larger than <em>width</em>* <em>bytes_per_pixel</em> to provide proper alignment for each pixel and row. This alignment is required to allow high-performance rendering within cairo. The correct way to obtain a legal stride value is to call <a class="el" href="classCairo_1_1ImageSurface.html#ac74f130a3bb36bd9fd70003cd8562ce5" title="This function provides a stride value that will respect all alignment requirements of the accelerated...">format_stride_for_width()</a> with the desired format and maximum image width value, and the use the resulting stride value to allocate the data and to create the image surface. See <a class="el" href="classCairo_1_1ImageSurface.html#ac74f130a3bb36bd9fd70003cd8562ce5" title="This function provides a stride value that will respect all alignment requirements of the accelerated...">format_stride_for_width()</a> for example code.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>a pointer to a buffer supplied by the application in which to write contents. This pointer must be suitably aligned for any kind of variable, (for example, a pointer returned by malloc). </td></tr>
    <tr><td class="paramname">format</td><td>the format of pixels in the buffer </td></tr>
    <tr><td class="paramname">width</td><td>the width of the image to be stored in the buffer </td></tr>
    <tr><td class="paramname">height</td><td>the height of the image to be stored in the buffer </td></tr>
    <tr><td class="paramname">stride</td><td>the number of bytes between the start of rows in the buffer as allocated. This value should always be computed by cairo_format_stride_for_width() before allocating the data buffer. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">RefPtr</a> to the newly created surface. </dd></dl>

</div>
</div>
<a class="anchor" id="aac35bcd255347574036746810f8a2978"></a><!-- doxytag: member="Cairo::ImageSurface::create_from_png" ref="aac35bcd255347574036746810f8a2978" args="(std::string filename)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt;<a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a>&gt; Cairo::ImageSurface::create_from_png </td>
          <td>(</td>
          <td class="paramtype"><a class="elRef" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00254.html">std::string</a>&#160;</td>
          <td class="paramname"><em>filename</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a new image surface and initializes the contents to the given PNG file. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>For this function to be available, cairo must have been compiled with PNG support.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">filename</td><td>name of PNG file to load </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">RefPtr</a> to the new cairo_surface_t initialized with the contents of the PNG image file. </dd></dl>

</div>
</div>
<a class="anchor" id="a43a9cf2aaaa8b2ef91da00bb244c7098"></a><!-- doxytag: member="Cairo::ImageSurface::create_from_png" ref="a43a9cf2aaaa8b2ef91da00bb244c7098" args="(cairo_read_func_t read_func, void *closure)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt;<a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a>&gt; Cairo::ImageSurface::create_from_png </td>
          <td>(</td>
          <td class="paramtype">cairo_read_func_t&#160;</td>
          <td class="paramname"><em>read_func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>closure</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000012">Deprecated:</a></b></dt><dd>Use create_from_png_stream instead </dd></dl>

</div>
</div>
<a class="anchor" id="a7ac275170e7235457c9806aec7cf6f6a"></a><!-- doxytag: member="Cairo::ImageSurface::create_from_png_stream" ref="a7ac275170e7235457c9806aec7cf6f6a" args="(const SlotReadFunc &amp;read_func)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt;<a class="el" href="classCairo_1_1ImageSurface.html">ImageSurface</a>&gt; Cairo::ImageSurface::create_from_png_stream </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="../../../libsigc++-2.0/reference/html/classsigc_1_1slot.html">SlotReadFunc</a> &amp;&#160;</td>
          <td class="paramname"><em>read_func</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a new image surface from PNG data read incrementally via the read_func function. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>For this function to be available, cairo must have been compiled with PNG support.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">read_func</td><td>function called to read the data of the file </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a <a class="el" href="classCairo_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">RefPtr</a> to the new cairo_surface_t initialized with the contents of the PNG image file. </dd></dl>

</div>
</div>
<a class="anchor" id="ac74f130a3bb36bd9fd70003cd8562ce5"></a><!-- doxytag: member="Cairo::ImageSurface::format_stride_for_width" ref="ac74f130a3bb36bd9fd70003cd8562ce5" args="(Cairo::Format format, int width)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static int Cairo::ImageSurface::format_stride_for_width </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Cairo::Format</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This function provides a stride value that will respect all alignment requirements of the accelerated image-rendering code within cairo. </p>
<p>Typical usage will be of the form:</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">int</span> <a class="codeRef" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01176.html#ga4d464eb22d9ad823ecb9b7eab22c6300">stride</a>;
 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *data;
 <a class="code" href="classCairo_1_1RefPtr.html" title="RefPtr&amp;lt;&amp;gt; is a reference-counting shared smartpointer.">Cairo::RefPtr&lt;Cairo::ImageSurface&gt;</a> surface;

 stride = <a class="code" href="classCairo_1_1ImageSurface.html#ac74f130a3bb36bd9fd70003cd8562ce5" title="This function provides a stride value that will respect all alignment requirements of the accelerated...">Cairo::ImageSurface::format_stride_for_width</a> (format, width);
 data = malloc (stride * height);
 surface = <a class="code" href="classCairo_1_1ImageSurface.html#a82887e1a0480ab16aa891e135f2b28d6" title="Creates an image surface of the specified format and dimensions.">Cairo::ImageSurface::create</a> (data, format, width, height);
</pre></div><dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">format</td><td>A <a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Cairo::Format</a> value </td></tr>
    <tr><td class="paramname">width</td><td>The desired width of an image surface to be created. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the appropriate stride to use given the desired format and width, or -1 if either the format is invalid or the width too large.</dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>1.6 </dd></dl>

</div>
</div>
<a class="anchor" id="a8858eb704ebe2118baf83f2a104b9140"></a><!-- doxytag: member="Cairo::ImageSurface::get_data" ref="a8858eb704ebe2118baf83f2a104b9140" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const unsigned char* Cairo::ImageSurface::get_data </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a94ba52fe4a201579c8a5541717822bdb"></a><!-- doxytag: member="Cairo::ImageSurface::get_data" ref="a94ba52fe4a201579c8a5541717822bdb" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char* Cairo::ImageSurface::get_data </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get a pointer to the data of the image surface, for direct inspection or modification. </p>
<p>Return value: a pointer to the image data of this surface or NULL if is not an image surface. </p>

</div>
</div>
<a class="anchor" id="aedccf9d08b3e5852c0bbb195cf1379a8"></a><!-- doxytag: member="Cairo::ImageSurface::get_format" ref="aedccf9d08b3e5852c0bbb195cf1379a8" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceCairo.html#ad3f86970e1bd354b263303c9b8759166">Format</a> Cairo::ImageSurface::get_format </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>gets the format of the surface </p>

</div>
</div>
<a class="anchor" id="aa0e17bed71b125fd4725386ee1f14d07"></a><!-- doxytag: member="Cairo::ImageSurface::get_height" ref="aa0e17bed71b125fd4725386ee1f14d07" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Cairo::ImageSurface::get_height </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Gets the height of the <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the ca...">ImageSurface</a> in pixels. </p>

</div>
</div>
<a class="anchor" id="a4b33c7f1c03197eb66dac3e909c5a39a"></a><!-- doxytag: member="Cairo::ImageSurface::get_stride" ref="a4b33c7f1c03197eb66dac3e909c5a39a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Cairo::ImageSurface::get_stride </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return value: the stride of the image surface in bytes (or 0 if is not an image surface). </p>
<p>The stride is the distance in bytes from the beginning of one row of the image data to the beginning of the next row. </p>

</div>
</div>
<a class="anchor" id="af75b30cde988ad6959bb75862f5b6e2a"></a><!-- doxytag: member="Cairo::ImageSurface::get_width" ref="af75b30cde988ad6959bb75862f5b6e2a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Cairo::ImageSurface::get_width </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Gets the width of the <a class="el" href="classCairo_1_1ImageSurface.html" title="Image surfaces provide the ability to render to memory buffers either allocated by cairo or by the ca...">ImageSurface</a> in pixels. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>cairomm/surface.h</li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon May 9 2011 09:51:07 for cairomm by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>