Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 7faa4cd12598db7d59564e3dc9a0913c > files > 131

vips-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>CONVERSIONS(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_c2amph, im_c2imag, im_c2ps, im_c2real, im_clip2fmt, im_ri2c - conversion
between image types 
<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
#include &lt;vips/vips.h&gt; 
<p> int im_c2amph(in, out)
<br>
IMAGE *in, *out; 
<p> int im_c2rect(in, out) <br>
IMAGE *in, *out; 
<p> int im_c2imag(in, out) <br>
IMAGE *in, *out; 
<p> int im_c2ps(in, out) <br>
IMAGE *in, *out; 
<p> int im_c2real(in, out) <br>
IMAGE *in, *out; 
<p> int im_clip2fmt(in, out, ofmt) <br>
IMAGE *in, *out; <br>
int ofmt; 
<p> int im_ri2c(in1, in2, out) <br>
IMAGE *in1, *in2, *out; 
<h2><a name='sect2' href='#toc2'>Description</a></h2>
Each of the above functions converts
the image held by the image descriptor in to another type image and writes
the result on the image descriptor out. Sizes and the number of channels
are identical to those of input.  Whenever required by the conversion, the
element values are rounded by calling floor(). 
<p> <b>im_c2amph()</b> converts a complex
(float or double) input to (amplitude, phase), with phase in degrees.  Output
has the same format as input. 
<p> <b>im_c2rect()</b> converts a complex (float or
double) input in (amplitude, phase) form back to rectangular coordinates.
Again, phase should be expressed in degrees. 
<p> <b>im_c2ps()</b> convert a (float
or double) complex image to amplitude (float or double) image.  Complex
input (a,b) is mapped to sqrt( a*a+b*b ). 
<p> <b>im_clip2fmt()</b> converts the input
image to &rsquo;ofmt&rsquo;, where ofmt is the new value for BandFmt. For example, im_clip2fmt(in,
out, FMTUSHORT) converts any image to unsigned short. 
<p> The number of clipped
values (if any), are printed in the standard error output. Before clipping
rounding is carried out if necessary. When converting between real and complex
types with these functions, the imaginary part of the output is set to
zero. When converting from complex to real types, the imaginary part is
ignored. Use im_c2ps(), im_c2real() etc. to get other behaviour. 
<p> Legacy functions
are available, called im_clip(), im_clip2c(), im_clip2d(), im_clip2f(),
im_clip2i(), im_clip2s(), im_clip2ui(), im_clip2us(), im_clip2cm() and
im_clip2dcm() which convert the input image to unsigned char, signed char,
double, float, int, short, unsigned int, unsigned short, complex and double
complex respectively. 
<p> <b>im_ri2c() </b> takes as inputs two non-complex images
of equal sizes and number of channels.  The output is a complex image with
the real part coming from in1 and the imaginary part coming from in2.  Output
is float complex (FMTCOMPLEX) only if none of the inputs is double.  If
one or both inputs are double the result is double complex (FMTDPCOMPLEX).

<p> <b>im_c2real() </b> and  <b>im_c2imag() </b> extract the real or the imaginary part
of a complex image respectively.  If input is be float complex or double
complex, then output is float or double respectively. 
<p> 
<h2><a name='sect3' href='#toc3'>Return Value</a></h2>
The functions
returns 0 on success and -1 on error. 
<h2><a name='sect4' href='#toc4'>See Also</a></h2>
<a href='im_scale.3.html'>im_scale(3)</a>
.  <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'>See Also</a></li>
</ul>
</body>
</html>