Sophie

Sophie

distrib > * > 2010.0 > * > by-pkgid > 6d7587e5535e7142017769f96c14d623 > files > 53

libcaca-devel-0.99-0.beta16.5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
    <title>libcaca documentation</title>
    <link href="doxygen.css" rel="stylesheet" type="text/css">
  </head>
  <body>
<!-- $Id$ -->
<!-- Generated by Doxygen 1.5.9 -->
<div class="contents">
<h1>libcaca canvas transformation</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">__extern int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__transform.html#g8a0363a5ee158a7eb71d5aa57dcca568">caca_invert</a> (<a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Invert a canvas' colours.  <a href="#g8a0363a5ee158a7eb71d5aa57dcca568"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">__extern int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__transform.html#g5e59b6806d57b694b9e3fb9646ffdd39">caca_flip</a> (<a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flip a canvas horizontally.  <a href="#g5e59b6806d57b694b9e3fb9646ffdd39"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">__extern int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__transform.html#g82727b3f6ac3c6dcdefbe15ca825618d">caca_flop</a> (<a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flip a canvas vertically.  <a href="#g82727b3f6ac3c6dcdefbe15ca825618d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">__extern int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__transform.html#gba6aa4d50a8351794715ac5085a4daf0">caca_rotate_180</a> (<a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rotate a canvas.  <a href="#gba6aa4d50a8351794715ac5085a4daf0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">__extern int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__transform.html#g9123bbd7cf198dbe18cc432ec5db3fab">caca_rotate_left</a> (<a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rotate a canvas, 90 degrees counterclockwise.  <a href="#g9123bbd7cf198dbe18cc432ec5db3fab"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">__extern int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__transform.html#g539399f5e4cb6bbb34c94cc9ae71fbe2">caca_rotate_right</a> (<a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rotate a canvas, 90 degrees counterclockwise.  <a href="#g539399f5e4cb6bbb34c94cc9ae71fbe2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">__extern int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__transform.html#gee3055c7c2e624f9729e7dafe458535d">caca_stretch_left</a> (<a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rotate and stretch a canvas, 90 degrees counterclockwise.  <a href="#gee3055c7c2e624f9729e7dafe458535d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">__extern int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__caca__transform.html#g00922bbead3429b4a2562f90fa61dd78">caca_stretch_right</a> (<a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rotate and stretch a canvas, 90 degrees clockwise.  <a href="#g00922bbead3429b4a2562f90fa61dd78"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
These functions perform horizontal and vertical canvas flipping. <hr><h2>Function Documentation</h2>
<a class="anchor" name="g8a0363a5ee158a7eb71d5aa57dcca568"></a><!-- doxytag: member="caca.h::caca_invert" ref="g8a0363a5ee158a7eb71d5aa57dcca568" args="(caca_canvas_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern int caca_invert           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&nbsp;</td>
          <td class="paramname"> <em>cv</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Invert a canvas' colours (black becomes white, red becomes cyan, etc.) without changing the characters in it.<p>
This function never fails.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cv</em>&nbsp;</td><td>The canvas to invert. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>This function always returns 0. </dd></dl>

</div>
</div><p>
<a class="anchor" name="g5e59b6806d57b694b9e3fb9646ffdd39"></a><!-- doxytag: member="caca.h::caca_flip" ref="g5e59b6806d57b694b9e3fb9646ffdd39" args="(caca_canvas_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern int caca_flip           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&nbsp;</td>
          <td class="paramname"> <em>cv</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Flip a canvas horizontally, choosing characters that look like the mirrored version wherever possible. Some characters will stay unchanged by the process, but the operation is guaranteed to be involutive: performing it again gives back the original canvas.<p>
This function never fails.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cv</em>&nbsp;</td><td>The canvas to flip. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>This function always returns 0. </dd></dl>

<p>References <a class="el" href="caca_8h_source.html#l00222">CACA_MAGIC_FULLWIDTH</a>.</p>

</div>
</div><p>
<a class="anchor" name="g82727b3f6ac3c6dcdefbe15ca825618d"></a><!-- doxytag: member="caca.h::caca_flop" ref="g82727b3f6ac3c6dcdefbe15ca825618d" args="(caca_canvas_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern int caca_flop           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&nbsp;</td>
          <td class="paramname"> <em>cv</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Flip a canvas vertically, choosing characters that look like the mirrored version wherever possible. Some characters will stay unchanged by the process, but the operation is guaranteed to be involutive: performing it again gives back the original canvas.<p>
This function never fails.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cv</em>&nbsp;</td><td>The canvas to flop. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>This function always returns 0. </dd></dl>

</div>
</div><p>
<a class="anchor" name="gba6aa4d50a8351794715ac5085a4daf0"></a><!-- doxytag: member="caca.h::caca_rotate_180" ref="gba6aa4d50a8351794715ac5085a4daf0" args="(caca_canvas_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern int caca_rotate_180           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&nbsp;</td>
          <td class="paramname"> <em>cv</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Apply a 180-degree transformation to a canvas, choosing characters that look like the upside-down version wherever possible. Some characters will stay unchanged by the process, but the operation is guaranteed to be involutive: performing it again gives back the original canvas.<p>
This function never fails.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cv</em>&nbsp;</td><td>The canvas to rotate. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>This function always returns 0. </dd></dl>

<p>References <a class="el" href="caca_8h_source.html#l00222">CACA_MAGIC_FULLWIDTH</a>.</p>

</div>
</div><p>
<a class="anchor" name="g9123bbd7cf198dbe18cc432ec5db3fab"></a><!-- doxytag: member="caca.h::caca_rotate_left" ref="g9123bbd7cf198dbe18cc432ec5db3fab" args="(caca_canvas_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern int caca_rotate_left           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&nbsp;</td>
          <td class="paramname"> <em>cv</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Apply a 90-degree transformation to a canvas, choosing characters that look like the rotated version wherever possible. Characters cells are rotated two-by-two. Some characters will stay unchanged by the process, some others will be replaced by close equivalents. Fullwidth characters at odd horizontal coordinates will be lost. The operation is not guaranteed to be reversible at all.<p>
Note that the width of the canvas is divided by two and becomes the new height. Height is multiplied by two and becomes the new width. If the original width is an odd number, the division is rounded up.<p>
If an error occurs, -1 is returned and <b>errno</b> is set accordingly:<ul>
<li><code>EBUSY</code> The canvas is in use by a display driver and cannot be rotated.</li><li><code>ENOMEM</code> Not enough memory to allocate the new canvas size. If this happens, the previous canvas handle is still valid.</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cv</em>&nbsp;</td><td>The canvas to rotate left. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 in case of success, -1 if an error occurred. </dd></dl>

</div>
</div><p>
<a class="anchor" name="g539399f5e4cb6bbb34c94cc9ae71fbe2"></a><!-- doxytag: member="caca.h::caca_rotate_right" ref="g539399f5e4cb6bbb34c94cc9ae71fbe2" args="(caca_canvas_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern int caca_rotate_right           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&nbsp;</td>
          <td class="paramname"> <em>cv</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Apply a 90-degree transformation to a canvas, choosing characters that look like the rotated version wherever possible. Characters cells are rotated two-by-two. Some characters will stay unchanged by the process, some others will be replaced by close equivalents. Fullwidth characters at odd horizontal coordinates will be lost. The operation is not guaranteed to be reversible at all.<p>
Note that the width of the canvas is divided by two and becomes the new height. Height is multiplied by two and becomes the new width. If the original width is an odd number, the division is rounded up.<p>
If an error occurs, -1 is returned and <b>errno</b> is set accordingly:<ul>
<li><code>EBUSY</code> The canvas is in use by a display driver and cannot be rotated.</li><li><code>ENOMEM</code> Not enough memory to allocate the new canvas size. If this happens, the previous canvas handle is still valid.</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cv</em>&nbsp;</td><td>The canvas to rotate right. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 in case of success, -1 if an error occurred. </dd></dl>

</div>
</div><p>
<a class="anchor" name="gee3055c7c2e624f9729e7dafe458535d"></a><!-- doxytag: member="caca.h::caca_stretch_left" ref="gee3055c7c2e624f9729e7dafe458535d" args="(caca_canvas_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern int caca_stretch_left           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&nbsp;</td>
          <td class="paramname"> <em>cv</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Apply a 90-degree transformation to a canvas, choosing characters that look like the rotated version wherever possible. Some characters will stay unchanged by the process, some others will be replaced by close equivalents. Fullwidth characters will be lost. The operation is not guaranteed to be reversible at all.<p>
Note that the width and height of the canvas are swapped, causing its aspect ratio to look stretched.<p>
If an error occurs, -1 is returned and <b>errno</b> is set accordingly:<ul>
<li><code>EBUSY</code> The canvas is in use by a display driver and cannot be rotated.</li><li><code>ENOMEM</code> Not enough memory to allocate the new canvas size. If this happens, the previous canvas handle is still valid.</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cv</em>&nbsp;</td><td>The canvas to rotate left. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 in case of success, -1 if an error occurred. </dd></dl>

</div>
</div><p>
<a class="anchor" name="g00922bbead3429b4a2562f90fa61dd78"></a><!-- doxytag: member="caca.h::caca_stretch_right" ref="g00922bbead3429b4a2562f90fa61dd78" args="(caca_canvas_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__extern int caca_stretch_right           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="caca_8h.html#ae0f6938d08e6e0abbcd5a8c06504ab8">caca_canvas_t</a> *&nbsp;</td>
          <td class="paramname"> <em>cv</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Apply a 270-degree transformation to a canvas, choosing characters that look like the rotated version wherever possible. Some characters will stay unchanged by the process, some others will be replaced by close equivalents. Fullwidth characters will be lost. The operation is not guaranteed to be reversible at all.<p>
Note that the width and height of the canvas are swapped, causing its aspect ratio to look stretched.<p>
If an error occurs, -1 is returned and <b>errno</b> is set accordingly:<ul>
<li><code>EBUSY</code> The canvas is in use by a display driver and cannot be rotated.</li><li><code>ENOMEM</code> Not enough memory to allocate the new canvas size. If this happens, the previous canvas handle is still valid.</li></ul>
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cv</em>&nbsp;</td><td>The canvas to rotate right. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 in case of success, -1 if an error occurred. </dd></dl>

</div>
</div><p>
</div>
<!-- $Id$ -->
  </body>
</html>