im_*bandjoin() work with images of varying formats

This commit is contained in:
John Cupitt 2010-01-27 10:57:45 +00:00
parent f0baf6e108
commit 2db0c87549
3 changed files with 18 additions and 7 deletions

View File

@ -24,7 +24,9 @@
- flood_blob could loop if start point == ink - flood_blob could loop if start point == ink
- added im_meta_remove() - added im_meta_remove()
- added remove profile option to vipsthumbnail - added remove profile option to vipsthumbnail
- added vips_bandfmt_iscomplex() and friends, im_iscomplex() deprecated - added vips_bandfmt_iscomplex() and friends, im_iscomplex() and friends
deprecated
- im_bandjoin()/im_gbandjoin() work with images of varying formats
26/11/09 started 7.20.3 26/11/09 started 7.20.3
- updated en_GB.po translation - updated en_GB.po translation

View File

@ -18,6 +18,8 @@
* - gtk-doc * - gtk-doc
* - im_bandjoin() just calls this * - im_bandjoin() just calls this
* - works for RAD coding too * - works for RAD coding too
* 27/1/10
* - formatalike inputs
*/ */
/* /*
@ -83,12 +85,18 @@ join_new( IMAGE *out, IMAGE **in, int nim )
!(join->is = IM_ARRAY( out, nim, int )) ) !(join->is = IM_ARRAY( out, nim, int )) )
return( NULL ); return( NULL );
/* Remember to NULL-terminate. /* Cast inputs up to a common format.
*/
if( im_open_local_array( out, join->in, nim, "im_gbandjoin", "p" ) ||
im__formatalike_vec( in, join->in, nim ) )
return( -1 );
for( i = 0; i < nim; i++ )
join->is[i] = IM_IMAGE_SIZEOF_PEL( join->in[i] );
/* Remember to NULL-terminate. We pass ->in[] to
* im_demand_hint_array() and friends later.
*/ */
for( i = 0; i < nim; i++ ) {
join->in[i] = in[i];
join->is[i] = IM_IMAGE_SIZEOF_PEL( in[i] );
}
join->in[nim] = NULL; join->in[nim] = NULL;
return( join ); return( join );

View File

@ -147,6 +147,7 @@ void im__buffer_init( void );
int im__bandup( IMAGE *in, IMAGE *out, int n ); int im__bandup( IMAGE *in, IMAGE *out, int n );
int im__bandalike( IMAGE *in1, IMAGE *in2, IMAGE *out1, IMAGE *out2 ); int im__bandalike( IMAGE *in1, IMAGE *in2, IMAGE *out1, IMAGE *out2 );
int im__formatalike_vec( IMAGE **in, IMAGE **out, int n );
int im__formatalike( IMAGE *in1, IMAGE *in2, IMAGE *out1, IMAGE *out2 ); int im__formatalike( IMAGE *in1, IMAGE *in2, IMAGE *out1, IMAGE *out2 );
int im__arith_binary( const char *name, int im__arith_binary( const char *name,
IMAGE *in1, IMAGE *in2, IMAGE *out, IMAGE *in1, IMAGE *in2, IMAGE *out,