Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > c109337651527e96d7bb9adc83c5b18a > files > 572

libvips-devel-7.18.2-1mdv2010.0.i586.rpm

<!-- manual page source format generated by PolyglotMan v3.2, -->
<!-- available at http://polyglotman.sourceforge.net/ -->

<html>
<head>
<title>WRAPPERS(3) manual page</title>
</head>
<body bgcolor='white'>
<a href='#toc'>Table of Contents</a><p>

<h2><a name='sect0' href='#toc0'>Name</a></h2>
im_wrapone, im_wrapmany - easy interface to partial image IO system

<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
<b>#include &lt;vips/vips.h&gt;</b> 
<p> int im_wrapone( IMAGE *in, IMAGE *out,   
  im_wrapone_fn fn, void *a, void *b )<br>
 <br>
int im_wrapmany( IMAGE **in, IMAGE *out,      im_wrapmany_fn fn, void *a,
void *b )<br>
 
<p> where 
<p> typedef void (*im_wrapone_fn)( void *in, void *out, int n,   
 void *a, void *b )<br>
 <br>
typedef void (*im_wrapmany_fn)( void **in, void *out, int n,     void *a,
void *b )<br>
 
<p> 
<h2><a name='sect2' href='#toc2'>Description</a></h2>
These functions provide a simple way to use the VIPS partial
image IO system, provided that your image processing function involves
no coordinate transformations, that is, that each output PEL depends only
upon the corresponding PEL(s) in the input image(s). 
<p> You should write your
operation as a buffer processing function --- for example: 
<p>     static void<br>
     invert_buffer( unsigned char *in, unsigned char *out, <br>
         int width )<br>
     {<br>
         int x;<br>
 
<p>         for( x = 0; x &lt; width; x++ )<br>
             *out++ = 255 - *in++;<br>
     }<br>
 
<p> This can now be turned into a full PIO image processing function by:

<p>     int<br>
     invert( IMAGE *in, IMAGE *out )<br>
     {<br>
         if( in-&gt;BandFmt != FMTUCHAR || <br>
             in-&gt;Coding != NOCODING ||<br>
             in-&gt;Bands != 1 ) {<br>
             im_errormsg( "invert: bad input" );<br>
             return( -1 );<br>
         }<br>
         if( im_cp_desc( out, in ) )<br>
             return( -1 );<br>
         if( im_wrapone( in, out,<br>
             (im_wrapone_fn) invert_buffer, NULL, NULL ) )<br>
         return( 0 );<br>
     }<br>
 
<p> <a href='im_wrapmany.3.html'>im_wrapmany(3)</a>
 works as <a href='im_wrapone.3.html'>im_wrapone(3)</a>
, but allows many input images. All
the inputs should be same Xsize and Ysize, but may vary in type. The array
of input images should be NULL-terminated, as for <a href='im_start_many.3.html'>im_start_many(3)</a>
. 
<p> 
<h2><a name='sect3' href='#toc3'>Return
Value</a></h2>
All int-valued functions return zero on success and non-zero on error.

<h2><a name='sect4' href='#toc4'>Copyright</a></h2>
National Gallery, 1995 
<h2><a name='sect5' href='#toc5'>Author</a></h2>
J. Cupitt - 9/2/95 <p>

<hr><p>
<a name='toc'><b>Table of Contents</b></a><p>
<ul>
<li><a name='toc0' href='#sect0'>Name</a></li>
<li><a name='toc1' href='#sect1'>Synopsis</a></li>
<li><a name='toc2' href='#sect2'>Description</a></li>
<li><a name='toc3' href='#sect3'>Return Value</a></li>
<li><a name='toc4' href='#sect4'>Copyright</a></li>
<li><a name='toc5' href='#sect5'>Author</a></li>
</ul>
</body>
</html>