im_*mask*() gtkdoc

This commit is contained in:
John Cupitt 2010-02-01 12:21:18 +00:00
parent f753f66e9c
commit 097aa34657
2 changed files with 40 additions and 18 deletions

View File

@ -1,14 +1,12 @@
/* @(#) Function to write a DOUBLEMASK to an IMAGE.
* @(#)
* @(#) int
* @(#) im_mask2vips( DOUBLEMASK *in, IMAGE *out )
* @(#)
* @(#) The function returns -1 on error and 0 on success
/* im_mask2vips
*
* Author: J.Cupitt
* Written on: 6/6/94
* Modified on:
* 7/10/94 JC
* - new IM_ARRAY()
* 1/2/10
* - gtkdoc
*/
/*
@ -51,6 +49,17 @@
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/**
* im_mask2vips:
* @in: input mask
* @out output image
*
* Write a one-band, #IM_BANDFMT_DOUBLE image to @out based on mask @in.
*
* See also: im_vips2mask().
*
* Returns: 0 on success, -1 on error
*/
int
im_mask2vips( DOUBLEMASK *in, IMAGE *out )
{

View File

@ -1,10 +1,5 @@
/* @(#) Function to write an IMAGE to a DOUBLEMASK. One band IM_BANDFMT_DOUBLE
* @(#) images, or n-band by 1 pixel double images.
* @(#)
* @(#) DOUBLEMASK *
* @(#) im_vips2mask( IMAGE *in, char *out )
* @(#)
* @(#) The function returns NULL on error and a new DOUBLEMASK on success
/* im_vips2mask
*
* Author: J.Cupitt
* Written on: 6/6/94
* Modified on:
@ -14,6 +9,8 @@
* 23/2/07
* - oop, broken for nx1 m-band images
* - now casts to double for you
* 1/2/10
* - gtkdoc
*/
/*
@ -55,6 +52,24 @@
#include <dmalloc.h>
#endif /*WITH_DMALLOC*/
/**
* im_vips2mask:
* @in: input image
* @outname: name for output mask
*
* Make a mask from an image. All images are cast to #IM_BANDFMT_DOUBLE
* before processing. There are two cases for handling bands:
*
* If the image has a single band, im_vips2mask() will write a mask the same
* size as the image.
*
* If the image has more than one band, it must be one pixel high or wide. In
* this case the output mask uses that axis to represent band values.
*
* See also: im_mask2vips(), im_measure().
*
* Returns: a #DOUBLEMASK with @outname set as the name, or NULL on error
*/
DOUBLEMASK *
im_vips2mask( IMAGE *in, const char *outname )
{
@ -80,12 +95,10 @@ im_vips2mask( IMAGE *in, const char *outname )
/* Check the image.
*/
if( im_incheck( in ) )
if( im_incheck( in ) ||
im_check_uncoded( "im_vips2mask", in ) )
return( NULL );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_vips2mask", "%s", _( "uncoded images only" ) );
return( NULL );
}
if( in->Bands == 1 ) {
width = in->Xsize;
height = in->Ysize;