Sophie

Sophie

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

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>IM_READMASK(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_create_dmask, im_create_imask, im_create_dmaskv, im_create_imaskv,
 im_dup_dmask, im_dup_imask, im_free_dmask, im_free_imask, im_print_imask,
im_print_dmask, im_read_dmask, im_read_imask, im_scale_dmask, im_write_dmask,
im_write_imask - operations on double or int masks 
<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
#include &lt;vips/vips.h&gt;

<p> DOUBLEMASK *im_create_dmask( name, xs, ys ) <br>
char *name; <br>
int xs, ys; 
<p> INTMASK *im_create_imask( name, xs, ys ) <br>
char *name; <br>
int xs, ys; 
<p> DOUBLEMASK *im_create_dmaskv( name, xs, ys, ... ) <br>
char *name; <br>
int xs, ys; 
<p> INTMASK *im_create_imaskv( name, xs, ys, ... ) <br>
char *name; <br>
int xs, ys; 
<p> DOUBLEMASK *im_dup_dmask( m, name ) <br>
DOUBLEMASK *m; <br>
char *name; 
<p> INTMASK *im_dup_imask( m, name ) <br>
INTMASK *m; <br>
char *name; 
<p> void im_free_dmask( mask ) <br>
DOUBLEMASK *mask; 
<p> void im_free_imask( mask ) <br>
INTMASK *mask; 
<p> DOUBLEMASK *im_read_dmask( name ) <br>
char *name; 
<p> INTMASK *im_read_imask( name ) <br>
char *name; 
<p> void im_print_dmask( mask ) <br>
DOUBLEMASK *mask; 
<p> void im_print_imask( mask ) <br>
INTMASK *mask; 
<p> INTMASK im_scale_dmask( mask, name ) <br>
DOUBLEMASK *mask; <br>

<p>char *name 
<p> void im_norm_dmask( DOUBLEMASK *mask ); 
<p> int im_write_imask(
m ) <br>
INTMASK *m; 
<p> int im_write_imask_name( m, name ) <br>
INTMASK *m; <br>
char *name; 
<p> int im_write_dmask_name( m, name ) <br>
DOUBLEMASK *m; <br>
char *name; 
<p> 
<h2><a name='sect2' href='#toc2'>Description</a></h2>
Masks are (see &lt;vips/vips.h&gt;): 
<p>  typedef struct {
                typedef struct {<br>
         int xsize;                    int xsize;<br>
         int ysize;                    int ysize;<br>
         int scale;                    double scale;<br>
         int offset;                   double offset;<br>
         int *coeff;                   double *coeff;<br>
         char *filename;               char *filename;<br>
  } INTMASK ;                      } DOUBLEMASK ;<br>
 
<p> By mask files have the following structure: 
<p>  x y [scale] [offset]<br>
  a11 a12 ... a1y<br>
  a21 a22 ... a2y]<br>
  ... ... ... ...<br>
  ax1 ax2 ... axy<br>
 
<p> The mask sizes x and y are always integer whereas all the remaining coefficients
are either int for INTMASK and double for the DOUBLEMASK. All numbers are
written in ASCII, for convenience. scale and offset are always optional.
If missing, they default to 1 and 0 respectively. This laxity makes mask
files useful for matrix operations, see <a href='im_matinv.3.html'>im_matinv(3)</a>
, etc. 
<p> im_create_dmask()
returns an DOUBLEMASK with the filename xsize and ysize set to name xs
and ys respectively.  The function allocates memory for the coefficients
which are all initialised to zero.  In case of error the function returns
NULL. 
<p> im_create_dmaskv() operates exactly as im_create_dmask(), except
that the mask is initialised by the parameters following the width and
height. These parameters must all be doubles. For example: 
<p>   DOUBLEMASK
*m = im_create_dmaskv( "untitled", 3, 3,<br>
     1.0, 0.0, 0.0,<br>
     0.0, 1.0, 0.0,<br>
     0.0, 0.0, 1.0 );<br>
 
<p> creates an identity matrix. 
<p> im_create_imask() returns an INTMASK with
the filename xsize and ysize set to name xs and ys respectively.  The function
allocates memory for the coefficients which are all initialised to zero.
 In case of error the function returns NULL. 
<p> im_create_imaskv() operates
exactly as im_create_imask(), except that the mask is initialised by the
parameters following the width and height. These  parameters must all be
ints. For example: 
<p>   INTMASK *m = im_create_imaskv( "untitled", 3, 3,<br>
     1, 0, 0,<br>
     0, 1, 0,<br>
     0, 0, 1 );<br>
 
<p> creates an identity matrix. 
<p> im_dup_dmask() duplicates the DOUBLEMASK
mask pointed by m and returns a pointer to the  new mask.  The filename
member of the returned mask is set to the entered name.  The function returns
either a DOUBLEMASK pointer or NULL on error. 
<p> im_dup_imask() duplicates
the INTMASK mask pointed by m and returns a pointer to the  new mask.  The
filename member of the returned mask is set to the entered name.  The function
returns either an INTMASK pointer or NULL on error. 
<p> im_free_dmask() frees
the memory allocated for the DOUBLEMASK mask. 
<p> im_free_imask() frees the
memory allocated for the INTMASK mask. 
<p> im_print_dmask() prints at the sterr
the DOUBLEMASK pointed by mask. 
<p> im_print_imask() prints at the sterr the
INTMASK pointed by mask. 
<p> im_read_dmask() opens the argument name and reads
the mask into a DOUBLEMASK structure. The function returns a pointer to
an DOUBLEMASK or NULL on error. 
<p> im_read_imask() opens the argument name
and reads the mask into a INTMASK structure. If the input file has non-integer
coefficients then the function im_read_dmask() should be used instead. 
There is a built-in checking for all mask members. If the mask has coefficients
which are integers or they are floats with the decimal part equal to zero,
the function reads the mask properly and puts the resultant coefficients
in a valid INTMASK. The function returns a pointer to an INTMASK or NULL
on error. 
<p> im_scale_dmask() returns an INTMASK of the DOUBLE MASK m.  The
maximum value of the DOUBLEMASK is scaled to 100 in the returned mask. 
The scale member of the INTMASK is scaled accordingly to the scale member
of m. The function returns a pointer to an INTMASK or NULL on error. 
<p> <a href='im_norm_dmask.3.html'><b>im_norm_dmask(3)</b></a>

applies the scale and offset members of  <i>mask</i> to each of its coefficients,
and then sets them to 1.0 and zero respectively. 
<p> im_write_imask() writes
the INTMASK pointed by m to the filename member of m.  The function checks
whether the filename is valid and it expects only an INTMASK. The function
returns 0 on success and -1 on error. For writing a DOUBLEMASK use im_write_dmask()
instead. 
<p> im_write_imask_name() operates as im_write_imask(), but the mask
is written to the named file. 
<p> im_write_dmask() writes the DOUBLEMASK pointed
by m to the filename member of m.  The function checks whether the filename
is valid and it expects only an DOUBLEMASK. The mask is written in a file
with the format given above.  The function uses fprintf with the conversion
character %g, to write the non integer mask coefficients.  It returns 0
on success and -1 on error. 
<p> im_write_dmask_name() operates as im_write_dmask(),
but the mask is written to the named file. 
<p> 
<h2><a name='sect3' href='#toc3'>See Also</a></h2>
<a href='im_lindetect.3.html'>im_lindetect(3)</a>
, <a href='im_compass.3.html'>im_compass(3)</a>
,
<a href='im_conv.3.html'>im_conv(3)</a>
, <a href='im_matinv.3.html'>im_matinv(3)</a>
. 
<h2><a name='sect4' href='#toc4'>Copyright</a></h2>
N. Dessipris 
<h2><a name='sect5' href='#toc5'>Author</a></h2>
N. Dessipris - 02/05/1991
 <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'>See Also</a></li>
<li><a name='toc4' href='#sect4'>Copyright</a></li>
<li><a name='toc5' href='#sect5'>Author</a></li>
</ul>
</body>
</html>