Sophie

Sophie

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

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>REGION-OPERATIONS(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_region_buffer, im_region_image, im_region_region, im_region_position,
im_region_equalsregion -  attach data to region 
<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
<b>#include &lt;vips/vips.h&gt;</b>

<p> int im_region_buffer( reg, r ) <br>
REGION *reg; <br>
Rect *r; 
<p> int im_region_image( reg, r ) <br>
REGION *reg; <br>
Rect *r; 
<p> int im_region_region( reg, treg, r, x, y ) <br>
REGION *reg, treg; <br>
Rect *r; <br>
int x, y; 
<p> int im_region_position( reg, x, y ) <br>
REGION *reg; <br>
int x, y; 
<p> int im_region_equalsregion( REGION *reg1, REGION *reg2 ) 
<p> 
<h2><a name='sect2' href='#toc2'>Description</a></h2>
These
functions are used to say where exactly input from or output to a region
goes. Briefly,  <a href='im_region_buffer.3.html'><b>im_region_buffer(3)</a>
 </b> gives a region its own piece of local
storage,  <a href='im_region_image.3.html'><b>im_region_image(3)</a>
 </b> links the region to an image, and <a href='im_region_region.3.html'><b>im_region_region(3)</b></a>

links the region to another region. 
<p> <a href='im_region_region.3.html'><b>im_region_region(3)</b></a>
 is the most powerful
of the three --- you can use it to avoid copy operations. See the source for
 <a href='im_extract.3.html'><b>im_extract(3)</a>
, </b> <a href='im_insert.3.html'><b>im_insert(3)</a>
,</b> <a href='im_copy.3.html'><b>im_copy(3)</a>
, </b> <a href='im_embed.3.html'><b>im_embed(3)</a>
, </b> and  <a href='im_lrmerge.3.html'><b>im_lrmerge(3)</a>

</b> for examples of its use, and see also <a href='im_prepare_copy.3.html'><b>im_prepare_copy(3)</a>
.</b> 
<p> <a href='im_region_buffer.3.html'><b>im_region_buffer(3)</b></a>

clips Rect r against the size of the image upon which reg is defined, then
searches for any calculated pixels which enclose that area. If there are
any suitable pixels already, the region is set to point to them. Otherwise,
a fresh buffer is allocated. 
<p> If region-&gt;buffer-&gt;done is set, then the region
is already calculated. Otherwise, the pixels need to be calculated.  
<p> <a href='im_region_buffer.3.html'><b>im_region_buffer(3)</b></a>

is called by  <a href='im_prepare.3.html'><b>im_prepare(3)</b></a>
 just before it calls the user generate function.

<p> <a href='im_region_image.3.html'><b>im_region_image(3)</b></a>
 attaches reg to the image on which it was defined. The
image has to be SETBUF, MMAPIN, MMAPINRW, or OPENIN --- ie., the types passed
by  <a href='im_incheck.3.html'><b>im_incheck(3)</a>
.</b> 
<p> <a href='im_region_region.3.html'><b>im_region_region(3)</b></a>
 redirects reg to treg. treg can be
defined on another image. r is clipped against the size of reg&rsquo;s image, and
against treg-&gt;valid. treg has to have pel data associated with it (ie. memory
local to treg, memory that is part of the image on which treg is defined,
or even memory from a third region), and the pel data has to be in a form
which is compatible with reg, ie. BandFmt and Bands must be the same.  
<p> r
becomes the valid field in reg, (x,y) is the top left-hand corner of the
area in treg to which valid is mapped. 
<p> 
<p> <a href='im_region_position.3.html'><b>im_region_position(3)</b></a>
 changes reg-&gt;valid,
so that reg-&gt;valid.left == x and reg-&gt;valid.top == y. width and height are clipped
against the size of the image. If x &lt; 0 or y &lt; 0 or the clipped rect has zero
width or height, the call fails. 
<p> This function affects the way that pels
are addressed by the  <a href='IM_REGION_ADDR.3.html'><b>IM_REGION_ADDR(3)</b></a>
 macro. It does not affect the pels
themselves! It has the effect of moving the area of pels a region represents.
This call is used by  <a href='im_extract.3.html'><b>im_extract(3)</a>
.</b> 
<p> <a href='im_region_equalsregion.3.html'><b>im_region_equalsregion(3)</b></a>
 tests for
reg1 and reg2 are identical, ie.: 
<p>    IM_REGION_ADDR( reg1, x, y ) == <br>
      IM_REGION_ADDR( reg2, x, y ) &amp;&amp;<br>
    *IM_REGION_ADDR( reg1, x, y ) == <br>
      *IM_REGION_ADDR( reg2, x, y )<br>
 
<p> It is used internally by VIPS, but may be useful to applications. 
<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, 1993 
<h2><a name='sect5' href='#toc5'>Author</a></h2>
J. Cupitt - 23/7/93 <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>