found some old code we can remove
This commit is contained in:
parent
d20f0bf617
commit
8d09db7cd4
12
TODO
12
TODO
@ -1,15 +1,3 @@
|
||||
- where do we futz with interpretation? can we remove any of that now we
|
||||
auto-futz in bandalike?
|
||||
|
||||
what about other uses of bandalike, eg. matching a one-band image to a
|
||||
three-band vector, should we change anything there?
|
||||
|
||||
- jpegsave saves a three-band RGB image tagged as BW with three different
|
||||
channels as a three-band jpg with all bands equal
|
||||
|
||||
cant be right!
|
||||
|
||||
|
||||
- does cplusplus need flipver() etc.?
|
||||
|
||||
- are the mosaic functions calling vips_fastcor()? it must be very slow
|
||||
|
@ -884,101 +884,6 @@ im__bandalike( const char *domain,
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
int
|
||||
im__sizealike_vec( VipsImage **in, VipsImage **out, int n )
|
||||
{
|
||||
int i;
|
||||
int width_max;
|
||||
int height_max;
|
||||
|
||||
g_assert( n >= 1 );
|
||||
|
||||
width_max = in[0]->Xsize;
|
||||
height_max = in[0]->Ysize;
|
||||
for( i = 1; i < n; i++ ) {
|
||||
width_max = VIPS_MAX( width_max, in[i]->Xsize );
|
||||
height_max = VIPS_MAX( height_max, in[i]->Ysize );
|
||||
}
|
||||
|
||||
for( i = 0; i < n; i++ )
|
||||
if( im_embed( in[i], out[i], 0, 0, 0, width_max, height_max ) )
|
||||
return( -1 );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
int
|
||||
im__sizealike( VipsImage *in1, VipsImage *in2,
|
||||
VipsImage *out1, VipsImage *out2 )
|
||||
{
|
||||
IMAGE *in[2];
|
||||
IMAGE *out[2];
|
||||
|
||||
in[0] = in1;
|
||||
in[1] = in2;
|
||||
out[0] = out1;
|
||||
out[1] = out2;
|
||||
|
||||
return( im__sizealike_vec( in, out, 2 ) );
|
||||
}
|
||||
|
||||
/* The common part of most binary arithmetic, relational and boolean
|
||||
* operators. We:
|
||||
*
|
||||
* - check in and out
|
||||
* - cast in1 and in2 up to a common format
|
||||
* - cast the common format to the output format with the supplied table
|
||||
* - equalise bands
|
||||
* - equalise size
|
||||
* - run the supplied buffer operation passing one of the up-banded,
|
||||
* up-casted and up-sized inputs as the first param
|
||||
*/
|
||||
int
|
||||
im__arith_binary( const char *domain,
|
||||
IMAGE *in1, IMAGE *in2, IMAGE *out,
|
||||
int format_table[10],
|
||||
im_wrapmany_fn fn, void *b )
|
||||
{
|
||||
IMAGE *t[7];
|
||||
|
||||
if( im_piocheck( in1, out ) ||
|
||||
im_pincheck( in2 ) ||
|
||||
im_check_bands_1orn( domain, in1, in2 ) ||
|
||||
im_check_uncoded( domain, in1 ) ||
|
||||
im_check_uncoded( domain, in2 ) )
|
||||
return( -1 );
|
||||
|
||||
/* Cast our input images up to a common format and bands.
|
||||
*/
|
||||
if( im_open_local_array( out, t, 6, domain, "p" ) ||
|
||||
im__formatalike( in1, in2, t[0], t[1] ) ||
|
||||
im__bandalike( domain, t[0], t[1], t[2], t[3] ) ||
|
||||
im__sizealike( t[2], t[3], t[4], t[5] ) )
|
||||
return( -1 );
|
||||
|
||||
/* Generate the output.
|
||||
*/
|
||||
if( im_cp_descv( out, t[4], t[5], NULL ) )
|
||||
return( -1 );
|
||||
|
||||
/* What number of bands will we write? Same as up-banded input.
|
||||
*/
|
||||
out->Bands = t[4]->Bands;
|
||||
|
||||
/* What output type will we write?
|
||||
*/
|
||||
out->BandFmt = format_table[t[4]->BandFmt];
|
||||
|
||||
/* And process! The buffer function gets one of the input images as a
|
||||
* sample.
|
||||
*/
|
||||
t[6] = NULL;
|
||||
if( im_wrapmany( t + 4, out, fn, t[4], b ) )
|
||||
return( -1 );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
VipsVector *
|
||||
im__init_program( VipsVector *vectors[IM_BANDFMT_LAST],
|
||||
VipsBandFmt format_table[IM_BANDFMT_LAST], VipsBandFmt fmt )
|
||||
|
Loading…
Reference in New Issue
Block a user