add vips_check_dmask_1d()
add a check-mask-is-1d function
This commit is contained in:
parent
c0cbbbf415
commit
770398753c
@ -83,6 +83,7 @@ int vips_check_vector( const char *domain, int n, VipsImage *im );
|
||||
int vips_check_hist( const char *domain, VipsImage *im );
|
||||
int vips_check_imask( const char *domain, INTMASK *mask );
|
||||
int vips_check_dmask( const char *domain, DOUBLEMASK *mask );
|
||||
int vips_check_dmask_1d( const char *domain, DOUBLEMASK *mask );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1153,3 +1153,28 @@ vips_check_dmask( const char *domain, DOUBLEMASK *mask )
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* vips_check_dmask_1d:
|
||||
* @domain: the originating domain for the error message
|
||||
* @mask: mask to check
|
||||
*
|
||||
* A mask must be one-dimensional (width or height 1).
|
||||
*
|
||||
* See also: vips_error().
|
||||
*
|
||||
* Returns: 0 if OK, -1 otherwise.
|
||||
*/
|
||||
int
|
||||
vips_check_dmask_1d( const char *domain, DOUBLEMASK *mask )
|
||||
{
|
||||
if( vips_check_dmask( domain, mask ) )
|
||||
return( -1 );
|
||||
if( mask->xsize != 1 &&
|
||||
mask->ysize != 1 ) {
|
||||
vips_error( domain, "%s", _( "mask must be 1D" ) );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user