gtkdoc im_extract
This commit is contained in:
parent
cbe4c044d4
commit
d5a4ecb767
@ -276,7 +276,7 @@ im__arith_binary( const char *domain,
|
||||
if( im_piocheck( in1, out ) ||
|
||||
im_pincheck( in2 ) ||
|
||||
im_check_bands_1orn( domain, in1, in2 ) ||
|
||||
im_check_same_size( domain, in1, in2 ) ||
|
||||
im_check_size_same( domain, in1, in2 ) ||
|
||||
im_check_uncoded( domain, in1 ) ||
|
||||
im_check_uncoded( domain, in2 ) )
|
||||
return( -1 );
|
||||
|
@ -141,9 +141,9 @@ int im_cross_phase( IMAGE *a, IMAGE *b, IMAGE *out ){
|
||||
if( im_pincheck( a ) || im_pincheck( b ) || im_poutcheck( out ))
|
||||
return -1;
|
||||
|
||||
if( im_check_same_size( FUNCTION_NAME, a, b ) ||
|
||||
im_check_same_bands( FUNCTION_NAME, a, b ) ||
|
||||
im_check_same_format( FUNCTION_NAME, a, b ) ||
|
||||
if( im_check_size_same( FUNCTION_NAME, a, b ) ||
|
||||
im_check_bands_same( FUNCTION_NAME, a, b ) ||
|
||||
im_check_format_same( FUNCTION_NAME, a, b ) ||
|
||||
im_check_uncoded( FUNCTION_NAME, a ) ||
|
||||
im_check_uncoded( FUNCTION_NAME, b ) ||
|
||||
im_check_complex( FUNCTION_NAME, a ) ||
|
||||
|
@ -58,7 +58,7 @@ im__colour_difference( const char *domain,
|
||||
im_check_uncoded( domain, in2 ) ||
|
||||
im_check_bands( domain, in1, 3 ) ||
|
||||
im_check_bands( domain, in2, 3 ) ||
|
||||
im_check_same_size( domain, in1, in2 ) ||
|
||||
im_check_size_same( domain, in1, in2 ) ||
|
||||
im_open_local_array( out, t, 2, domain, "p" ) ||
|
||||
im_clip2fmt( in1, t[0], IM_BANDFMT_FLOAT ) ||
|
||||
im_clip2fmt( in2, t[1], IM_BANDFMT_FLOAT ) )
|
||||
|
@ -248,15 +248,14 @@ static im_arg_desc extract_args[] = {
|
||||
static int
|
||||
extract_vec( im_object *argv )
|
||||
{
|
||||
IMAGE_BOX box;
|
||||
int left = *((int *) argv[2]);
|
||||
int top = *((int *) argv[3]);
|
||||
int width = *((int *) argv[4]);
|
||||
int height = *((int *) argv[5]);
|
||||
int band = *((int *) argv[6]);
|
||||
|
||||
box.xstart = *((int *) argv[2]);
|
||||
box.ystart = *((int *) argv[3]);
|
||||
box.xsize = *((int *) argv[4]);
|
||||
box.ysize = *((int *) argv[5]);
|
||||
box.chsel = *((int *) argv[6]);
|
||||
|
||||
return( im_extract( argv[0], argv[1], &box ) );
|
||||
return( im_extract_areabands( argv[0], argv[1],
|
||||
left, top, width, height, band, 1 ) );
|
||||
}
|
||||
|
||||
/* Description of im_extract.
|
||||
|
@ -115,7 +115,7 @@ im_copy_set_all( IMAGE *in, IMAGE *out,
|
||||
{
|
||||
/* Check args.
|
||||
*/
|
||||
if( im_check_known_coded( "im_copy", in ) ||
|
||||
if( im_check_coding_known( "im_copy", in ) ||
|
||||
im_piocheck( in, out ) )
|
||||
return( -1 );
|
||||
if( coding != IM_CODING_NONE &&
|
||||
|
@ -51,8 +51,22 @@
|
||||
#include <dmalloc.h>
|
||||
#endif /*WITH_DMALLOC*/
|
||||
|
||||
/* Copy an image to a disc file, then copy again to output. If the image is
|
||||
/**
|
||||
* im_copy_file:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
*
|
||||
* Copy an image to a disc file, then copy again to output. If the image is
|
||||
* already a disc file, just copy straight through.
|
||||
*
|
||||
* The disc file is allocated in the same way as im_system_image(). A disc
|
||||
* file is created in /tmp (change this with the TMPDIR environment
|
||||
* variable) named something like "vips-12-34985.v" and the image is written
|
||||
* to that file. The file is automatically deleted when @out is closed.
|
||||
*
|
||||
* See also: im_copy(), im_system_image().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
im_copy_file( IMAGE *in, IMAGE *out )
|
||||
|
@ -444,7 +444,7 @@ int
|
||||
im_embed( IMAGE *in, IMAGE *out, int flag, int x, int y, int w, int h )
|
||||
{
|
||||
if( im_piocheck( in, out ) ||
|
||||
im_check_known_coded( "im_embed", in ) )
|
||||
im_check_coding_known( "im_embed", in ) )
|
||||
return( -1 );
|
||||
if( flag < 0 || flag > 4 ) {
|
||||
im_error( "im_embed", "%s", _( "unknown flag" ) );
|
||||
|
@ -1,13 +1,4 @@
|
||||
/* @(#) Function to extract a portion of a Vasari format picture.
|
||||
* @(#) Function im_extract() assumes that the imin image
|
||||
* @(#) is either memory mapped or in the buffer pimin->data.
|
||||
* @(#)
|
||||
* @(#) int im_extract(pimin, pimout, pbox)
|
||||
* @(#) IMAGE *pimin, *pimout;
|
||||
* @(#) IMAGE_BOX *pbox;
|
||||
* @(#)
|
||||
* @(#) All functions return 0 on success and -1 on error
|
||||
* @(#)
|
||||
/* im_extract
|
||||
*
|
||||
* Copyright: 1990, J. Cupitt
|
||||
*
|
||||
@ -41,6 +32,9 @@
|
||||
* - added im_extract_bands(), remove many bands from image
|
||||
* 24/3/09
|
||||
* - added IM_CODING_RAD support
|
||||
* 29/1/10
|
||||
* - cleanups
|
||||
* - gtkdoc
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -82,19 +76,25 @@
|
||||
#include <dmalloc.h>
|
||||
#endif /*WITH_DMALLOC*/
|
||||
|
||||
/* Extract one or more bands ... get number of output bands from
|
||||
* or->im->Bands.
|
||||
typedef struct _Extract {
|
||||
IMAGE *in;
|
||||
IMAGE *out;
|
||||
int left;
|
||||
int top;
|
||||
int width;
|
||||
int height;
|
||||
int band;
|
||||
int nbands;
|
||||
} Extract;
|
||||
|
||||
/* Extract one or more bands. This needs pixel copying.
|
||||
*/
|
||||
static int
|
||||
extract_band( REGION *or, void *seq, void *a, void *b )
|
||||
{
|
||||
REGION *ir = (REGION *) seq;
|
||||
IMAGE_BOX *box = (IMAGE_BOX *) b;
|
||||
Extract *extract = (Extract *) b;
|
||||
Rect *r = &or->valid;
|
||||
int le = r->left;
|
||||
int ri = IM_RECT_RIGHT(r);
|
||||
int to = r->top;
|
||||
int bo = IM_RECT_BOTTOM(r);
|
||||
int es = IM_IMAGE_SIZEOF_ELEMENT( ir->im );
|
||||
int ipel = IM_IMAGE_SIZEOF_PEL( ir->im );
|
||||
int opel = IM_IMAGE_SIZEOF_PEL( or->im );
|
||||
@ -105,17 +105,19 @@ extract_band( REGION *or, void *seq, void *a, void *b )
|
||||
/* Ask for input we need.
|
||||
*/
|
||||
iarea = or->valid;
|
||||
iarea.left += box->xstart;
|
||||
iarea.top += box->ystart;
|
||||
iarea.left += extract->left;
|
||||
iarea.top += extract->top;
|
||||
if( im_prepare( ir, &iarea ) )
|
||||
return( -1 );
|
||||
|
||||
for( y = to; y < bo; y++ ) {
|
||||
p = IM_REGION_ADDR( ir, le + box->xstart, y + box->ystart ) +
|
||||
box->chsel * es;
|
||||
q = IM_REGION_ADDR( or, le, y );
|
||||
for( y = 0; y < r->height; y++ ) {
|
||||
p = IM_REGION_ADDR( ir,
|
||||
extract->left + r->left,
|
||||
extract->top + r->top + y ) +
|
||||
extract->band * es;
|
||||
q = IM_REGION_ADDR( or, r->left, r->top + y );
|
||||
|
||||
for( x = le; x < ri; x++ ) {
|
||||
for( x = 0; x < r->width; x++ ) {
|
||||
for( z = 0; z < opel; z++ )
|
||||
q[z] = p[z];
|
||||
|
||||
@ -133,15 +135,15 @@ static int
|
||||
extract_area( REGION *or, void *seq, void *a, void *b )
|
||||
{
|
||||
REGION *ir = (REGION *) seq;
|
||||
IMAGE_BOX *box = (IMAGE_BOX *) b;
|
||||
Extract *extract = (Extract *) b;
|
||||
Rect iarea;
|
||||
|
||||
/* Ask for input we need. Translate from demand in or's space to
|
||||
* demand in ir's space.
|
||||
*/
|
||||
iarea = or->valid;
|
||||
iarea.left += box->xstart;
|
||||
iarea.top += box->ystart;
|
||||
iarea.left += extract->left;
|
||||
iarea.top += extract->top;
|
||||
if( im_prepare( ir, &iarea ) )
|
||||
return( -1 );
|
||||
|
||||
@ -153,15 +155,32 @@ extract_area( REGION *or, void *seq, void *a, void *b )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* Extract an area and bands from an image.
|
||||
/**
|
||||
* im_extract_areabands:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @left: left edge of rectangle
|
||||
* @top: top edge rectangle
|
||||
* @width: width of rectangle
|
||||
* @height: height of rectangle
|
||||
* @band: first band to extract
|
||||
* @nbands: number of bands to extract
|
||||
*
|
||||
* Extract an area and a number of bands from an image. Bands number from
|
||||
* zero. Extracting outside @in will trigger an error.
|
||||
*
|
||||
* See also: im_embed(), im_insert(), im_extract_area(), im_extract_bands().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
im_extract_areabands( IMAGE *in, IMAGE *out,
|
||||
int left, int top, int width, int height, int band, int nbands )
|
||||
{
|
||||
IMAGE_BOX *box;
|
||||
Extract *extract;
|
||||
|
||||
if( im_piocheck( in, out ) )
|
||||
if( im_piocheck( in, out ) ||
|
||||
im_check_coding_known( "im_extract_areabands", in ) )
|
||||
return( -1 );
|
||||
if( band < 0 || nbands < 1 || band + nbands > in->Bands ) {
|
||||
im_error( "im_extract_areabands",
|
||||
@ -176,22 +195,6 @@ im_extract_areabands( IMAGE *in, IMAGE *out,
|
||||
"%s", _( "bad extract area" ) );
|
||||
return( -1 );
|
||||
}
|
||||
if( in->Coding != IM_CODING_NONE ) {
|
||||
if( in->Coding != IM_CODING_LABQ &&
|
||||
in->Coding != IM_CODING_RAD ) {
|
||||
im_error( "im_extract_areabands",
|
||||
"%s", _( "unknown coding" ) );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/* We only do area extract for coding == labq.
|
||||
*/
|
||||
if( band != 0 || nbands != in->Bands ) {
|
||||
im_error( "im_extract_areabands", "%s",
|
||||
_( "only extract areas from LABQ and RAD" ) );
|
||||
return( -1 );
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up the output header.
|
||||
*/
|
||||
@ -202,25 +205,28 @@ im_extract_areabands( IMAGE *in, IMAGE *out,
|
||||
out->Ysize = height;
|
||||
if( im_demand_hint( out, IM_THINSTRIP, in, NULL ) )
|
||||
return( -1 );
|
||||
if( !(box = IM_NEW( out, IMAGE_BOX )) )
|
||||
if( !(extract = IM_NEW( out, Extract )) )
|
||||
return( -1 );
|
||||
box->xstart = left;
|
||||
box->ystart = top;
|
||||
box->xsize = width;
|
||||
box->ysize = height;
|
||||
box->chsel = band;
|
||||
extract->in = in;
|
||||
extract->out = out;
|
||||
extract->left = left;
|
||||
extract->top = top;
|
||||
extract->width = width;
|
||||
extract->height = height;
|
||||
extract->band = band;
|
||||
extract->nbands = nbands;
|
||||
|
||||
/* Extracting all bands is a special case ... we can do it with
|
||||
* pointers.
|
||||
*/
|
||||
if( band == 0 && nbands == in->Bands ) {
|
||||
if( im_generate( out,
|
||||
im_start_one, extract_area, im_stop_one, in, box ) )
|
||||
im_start_one, extract_area, im_stop_one, in, extract ) )
|
||||
return( -1 );
|
||||
}
|
||||
else {
|
||||
if( im_generate( out,
|
||||
im_start_one, extract_band, im_stop_one, in, box ) )
|
||||
im_start_one, extract_band, im_stop_one, in, extract ) )
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -230,7 +236,21 @@ im_extract_areabands( IMAGE *in, IMAGE *out,
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* Convenience functions.
|
||||
/**
|
||||
* im_extract_area:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @left: left edge of rectangle
|
||||
* @top: top edge rectangle
|
||||
* @width: width of rectangle
|
||||
* @height: height of rectangle
|
||||
*
|
||||
* Extract an area from an image.
|
||||
* Extracting outside @in will trigger an error.
|
||||
*
|
||||
* See also: im_embed(), im_insert(), im_extract_bands().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
im_extract_area( IMAGE *in, IMAGE *out,
|
||||
@ -240,15 +260,44 @@ im_extract_area( IMAGE *in, IMAGE *out,
|
||||
left, top, width, height, 0, in->Bands ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* im_extract_bands:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @band: first band to extract
|
||||
* @nbands: number of bands to extract
|
||||
*
|
||||
* Extract a number of bands from an image.
|
||||
* Extracting outside @in will trigger an error.
|
||||
*
|
||||
* See also: im_bandjoin().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
im_extract_bands( IMAGE *in, IMAGE *out, int chsel, int nbands )
|
||||
im_extract_bands( IMAGE *in, IMAGE *out, int band, int nbands )
|
||||
{
|
||||
return( im_extract_areabands( in, out,
|
||||
0, 0, in->Xsize, in->Ysize, chsel, nbands ) );
|
||||
0, 0, in->Xsize, in->Ysize, band, nbands ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* im_extract_band:
|
||||
* @in: input image
|
||||
* @out: output image
|
||||
* @band: first band to extract
|
||||
* @nbands: number of bands to extract
|
||||
*
|
||||
* Extract a single band from an image.
|
||||
* Extracting outside @in will trigger an error.
|
||||
*
|
||||
* See also: im_bandjoin().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
im_extract_band( IMAGE *in, IMAGE *out, int chsel )
|
||||
im_extract_band( IMAGE *in, IMAGE *out, int band )
|
||||
{
|
||||
return( im_extract_bands( in, out, chsel, 1 ) );
|
||||
return( im_extract_bands( in, out, band, 1 ) );
|
||||
}
|
||||
|
@ -193,12 +193,12 @@ im_gbandjoin( IMAGE **in, IMAGE *out, int nim )
|
||||
/* Check our args.
|
||||
*/
|
||||
if( im_poutcheck( out ) ||
|
||||
im_check_known_coded( "im_gbandjoin", in[0] ) )
|
||||
im_check_coding_known( "im_gbandjoin", in[0] ) )
|
||||
return( -1 );
|
||||
for( i = 0; i < nim; i++ )
|
||||
if( im_pincheck( in[i] ) ||
|
||||
im_check_same_size( "im_gbandjoin", in[i], in[0] ) ||
|
||||
im_check_same_coding( "im_gbandjoin", in[i], in[0] ) )
|
||||
im_check_size_same( "im_gbandjoin", in[i], in[0] ) ||
|
||||
im_check_coding_same( "im_gbandjoin", in[i], in[0] ) )
|
||||
return( -1 );
|
||||
|
||||
/* Build a data area.
|
||||
|
@ -315,7 +315,7 @@ im_hist_indexed( IMAGE *index, IMAGE *value, IMAGE *out )
|
||||
im_check_uncoded( "im_hist_indexed", index ) ||
|
||||
im_check_uncoded( "im_hist_indexed", value ) ||
|
||||
im_check_noncomplex( "im_hist_indexed", value ) ||
|
||||
im_check_same_size( "im_hist_indexed", index, value ) ||
|
||||
im_check_size_same( "im_hist_indexed", index, value ) ||
|
||||
im_check_u8or16( "im_hist_indexed", index ) ||
|
||||
im_check_mono( "im_hist_indexed", index ) )
|
||||
return( -1 );
|
||||
|
@ -45,19 +45,19 @@ int im_pincheck( IMAGE *im );
|
||||
int im_poutcheck( IMAGE *im );
|
||||
|
||||
int im_check_uncoded( const char *domain, IMAGE *im );
|
||||
int im_check_known_coded( const char *domain, IMAGE *im );
|
||||
int im_check_coding_known( const char *domain, IMAGE *im );
|
||||
int im_check_coding_same( const char *domain, IMAGE *im1, IMAGE *im2 );
|
||||
int im_check_mono( const char *domain, IMAGE *im );
|
||||
int im_check_bands( const char *domain, IMAGE *im, int bands );
|
||||
int im_check_bands_1orn( const char *domain, IMAGE *im1, IMAGE *im2 );
|
||||
int im_check_bands_same( const char *domain, IMAGE *im1, IMAGE *im2 );
|
||||
int im_check_int( const char *domain, IMAGE *im );
|
||||
int im_check_noncomplex( const char *domain, IMAGE *im );
|
||||
int im_check_complex( const char *domain, IMAGE *im );
|
||||
int im_check_format( const char *domain, IMAGE *im, VipsBandFmt fmt );
|
||||
int im_check_u8or16( const char *domain, IMAGE *im );
|
||||
int im_check_same_size( const char *domain, IMAGE *im1, IMAGE *im2 );
|
||||
int im_check_same_bands( const char *domain, IMAGE *im1, IMAGE *im2 );
|
||||
int im_check_same_format( const char *domain, IMAGE *im1, IMAGE *im2 );
|
||||
int im_check_same_coding( const char *domain, IMAGE *im1, IMAGE *im2 );
|
||||
int im_check_format_same( const char *domain, IMAGE *im1, IMAGE *im2 );
|
||||
int im_check_size_same( const char *domain, IMAGE *im1, IMAGE *im2 );
|
||||
int im_check_vector( const char *domain, int n, IMAGE *im );
|
||||
|
||||
gboolean vips_bandfmt_isint( VipsBandFmt fmt );
|
||||
|
@ -458,7 +458,7 @@ im_flood( IMAGE *im, int x, int y, PEL *ink, Rect *dout )
|
||||
Flood *flood;
|
||||
|
||||
if( im_rwcheck( im ) ||
|
||||
im_check_known_coded( "im_flood", im ) )
|
||||
im_check_coding_known( "im_flood", im ) )
|
||||
return( -1 );
|
||||
if( !(flood = flood_build( im, im, x, y, ink, dout )) )
|
||||
return( -1 );
|
||||
@ -506,7 +506,7 @@ im_flood_blob( IMAGE *im, int x, int y, PEL *ink, Rect *dout )
|
||||
int j;
|
||||
|
||||
if( im_rwcheck( im ) ||
|
||||
im_check_known_coded( "im_flood", im ) )
|
||||
im_check_coding_known( "im_flood", im ) )
|
||||
return( -1 );
|
||||
if( !(flood = flood_build( im, im, x, y, ink, dout )) )
|
||||
return( -1 );
|
||||
@ -566,11 +566,11 @@ im_flood_other( IMAGE *test, IMAGE *mark, int x, int y, int serial, Rect *dout )
|
||||
|
||||
if( im_incheck( test ) ||
|
||||
im_rwcheck( mark ) ||
|
||||
im_check_known_coded( "im_flood_other", test ) ||
|
||||
im_check_coding_known( "im_flood_other", test ) ||
|
||||
im_check_uncoded( "im_flood_other", mark ) ||
|
||||
im_check_mono( "im_flood_other", mark ) ||
|
||||
im_check_format( "im_flood_other", mark, IM_BANDFMT_INT ) ||
|
||||
im_check_same_size( "im_flood_other", test, mark ) )
|
||||
im_check_size_same( "im_flood_other", test, mark ) )
|
||||
return( -1 );
|
||||
|
||||
/* Have we done this point already?
|
||||
|
@ -272,11 +272,11 @@ im_flood_other_old( IMAGE *mask, IMAGE *test, int x, int y, int serial )
|
||||
im_incheck( test ) )
|
||||
return( -1 );
|
||||
|
||||
if( im_check_known_coded( "im_flood_other", test ) ||
|
||||
if( im_check_coding_known( "im_flood_other", test ) ||
|
||||
im_check_uncoded( "im_flood_other", mask ) ||
|
||||
im_check_mono( "im_flood_other", mask ) ||
|
||||
im_check_format( "im_flood_other", mask, IM_BANDFMT_INT ) ||
|
||||
im_check_same_size( "im_flood_other", test, mask ) )
|
||||
im_check_size_same( "im_flood_other", test, mask ) )
|
||||
return( -1 );
|
||||
|
||||
/* Make sure the mask has zero at the start position. If it does, we
|
||||
|
@ -87,10 +87,10 @@ im_insertplace( IMAGE *main, IMAGE *sub, int x, int y )
|
||||
*/
|
||||
if( im_rwcheck( main ) ||
|
||||
im_incheck( sub ) ||
|
||||
im_check_known_coded( "im_insertplace", main ) ||
|
||||
im_check_known_coded( "im_insertplace", sub ) ||
|
||||
im_check_same_format( "im_insertplace", main, sub ) ||
|
||||
im_check_same_bands( "im_insertplace", main, sub ) )
|
||||
im_check_coding_known( "im_insertplace", main ) ||
|
||||
im_check_coding_known( "im_insertplace", sub ) ||
|
||||
im_check_format_same( "im_insertplace", main, sub ) ||
|
||||
im_check_bands_same( "im_insertplace", main, sub ) )
|
||||
return( -1 );
|
||||
|
||||
/* Make rects for main and sub and clip.
|
||||
|
@ -562,7 +562,7 @@ im_check_uncoded( const char *domain, IMAGE *im )
|
||||
}
|
||||
|
||||
/**
|
||||
* im_check_known_coded:
|
||||
* im_check_coding_known:
|
||||
* @domain: the originating domain for the error message
|
||||
* @im: image to check
|
||||
*
|
||||
@ -575,7 +575,7 @@ im_check_uncoded( const char *domain, IMAGE *im )
|
||||
* Returns: 0 on OK, or -1 on error.
|
||||
*/
|
||||
int
|
||||
im_check_known_coded( const char *domain, IMAGE *im )
|
||||
im_check_coding_known( const char *domain, IMAGE *im )
|
||||
{
|
||||
/* These all have codings that extract/ifthenelse/etc can ignore.
|
||||
*/
|
||||
@ -792,7 +792,7 @@ im_check_u8or16( const char *domain, IMAGE *im )
|
||||
}
|
||||
|
||||
/**
|
||||
* im_check_same_size:
|
||||
* im_check_size_same:
|
||||
* @domain: the originating domain for the error message
|
||||
* @im1: first image to check
|
||||
* @im2: second image to check
|
||||
@ -806,7 +806,7 @@ im_check_u8or16( const char *domain, IMAGE *im )
|
||||
* Returns: 0 if OK, -1 otherwise.
|
||||
*/
|
||||
int
|
||||
im_check_same_size( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
im_check_size_same( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
{
|
||||
if( im1->Xsize != im2->Xsize || im1->Ysize != im2->Ysize ) {
|
||||
im_error( domain, "%s", _( "images must match in size" ) );
|
||||
@ -817,7 +817,7 @@ im_check_same_size( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
}
|
||||
|
||||
/**
|
||||
* im_check_same_bands:
|
||||
* im_check_bands_same:
|
||||
* @domain: the originating domain for the error message
|
||||
* @im1: first image to check
|
||||
* @im2: second image to check
|
||||
@ -831,7 +831,7 @@ im_check_same_size( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
* Returns: 0 if OK, -1 otherwise.
|
||||
*/
|
||||
int
|
||||
im_check_same_bands( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
im_check_bands_same( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
{
|
||||
if( im1->Bands != im2->Bands ) {
|
||||
im_error( domain, "%s",
|
||||
@ -843,7 +843,7 @@ im_check_same_bands( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
}
|
||||
|
||||
/**
|
||||
* im_check_same_format:
|
||||
* im_check_format_same:
|
||||
* @domain: the originating domain for the error message
|
||||
* @im1: first image to check
|
||||
* @im2: second image to check
|
||||
@ -857,7 +857,7 @@ im_check_same_bands( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
* Returns: 0 if OK, -1 otherwise.
|
||||
*/
|
||||
int
|
||||
im_check_same_format( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
im_check_format_same( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
{
|
||||
if( im1->BandFmt != im2->BandFmt ) {
|
||||
im_error( domain, "%s",
|
||||
@ -869,7 +869,7 @@ im_check_same_format( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
}
|
||||
|
||||
/**
|
||||
* im_check_same_coding:
|
||||
* im_check_coding_same:
|
||||
* @domain: the originating domain for the error message
|
||||
* @im1: first image to check
|
||||
* @im2: second image to check
|
||||
@ -883,7 +883,7 @@ im_check_same_format( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
* Returns: 0 if OK, -1 otherwise.
|
||||
*/
|
||||
int
|
||||
im_check_same_coding( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
im_check_coding_same( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
{
|
||||
if( im1->Coding != im2->Coding ) {
|
||||
im_error( domain, "%s",
|
||||
@ -895,14 +895,13 @@ im_check_same_coding( const char *domain, IMAGE *im1, IMAGE *im2 )
|
||||
}
|
||||
|
||||
/**
|
||||
* im_check_same_vector:
|
||||
* im_check_vector:
|
||||
* @domain: the originating domain for the error message
|
||||
* @im1: first image to check
|
||||
* @im2: second image to check
|
||||
* @n: number of elements in vector
|
||||
* @im: image to check against
|
||||
*
|
||||
* Check that the images have the same format.
|
||||
* If not, set an error message
|
||||
* and return non-zero.
|
||||
* Operations with a vector constant need a 1-element vector, or a vector with
|
||||
* the same number of elements as there are bands in the image.
|
||||
*
|
||||
* See also: im_error().
|
||||
*
|
||||
|
@ -292,8 +292,8 @@ blend( IMAGE *c, IMAGE *a, IMAGE *b, IMAGE *out )
|
||||
im_check_uncoded( "im_blend", a ) ||
|
||||
im_check_uncoded( "im_blend", b ) ||
|
||||
im_check_format( "im_blend", c, IM_BANDFMT_UCHAR ) ||
|
||||
im_check_same_format( "im_blend", a, b ) ||
|
||||
im_check_same_bands( "im_blend", a, b ) ||
|
||||
im_check_format_same( "im_blend", a, b ) ||
|
||||
im_check_bands_same( "im_blend", a, b ) ||
|
||||
im_check_bands_1orn( "im_blend", c, a ) ||
|
||||
im_piocheck( c, out ) ||
|
||||
im_pincheck( a ) ||
|
||||
|
@ -154,11 +154,11 @@ ifthenelse( IMAGE *c, IMAGE *a, IMAGE *b, IMAGE *out )
|
||||
/* Check args.
|
||||
*/
|
||||
if( im_check_uncoded( "im_ifthenelse", c ) ||
|
||||
im_check_known_coded( "im_ifthenelse", a ) ||
|
||||
im_check_known_coded( "im_ifthenelse", b ) ||
|
||||
im_check_coding_known( "im_ifthenelse", a ) ||
|
||||
im_check_coding_known( "im_ifthenelse", b ) ||
|
||||
im_check_format( "ifthenelse", c, IM_BANDFMT_UCHAR ) ||
|
||||
im_check_same_format( "ifthenelse", a, b ) ||
|
||||
im_check_same_bands( "ifthenelse", a, b ) ||
|
||||
im_check_format_same( "ifthenelse", a, b ) ||
|
||||
im_check_bands_same( "ifthenelse", a, b ) ||
|
||||
im_check_bands_1orn( "im_ifthenelse", c, a ) ||
|
||||
im_piocheck( c, out ) ||
|
||||
im_pincheck( a ) ||
|
||||
|
Loading…
Reference in New Issue
Block a user