remove im_iterate() uses

This commit is contained in:
John Cupitt 2010-04-19 11:00:28 +00:00
parent 68fae1ab1f
commit 3a9f0d50fa
11 changed files with 15 additions and 17 deletions

View File

@ -15,6 +15,7 @@
- im_vips2tiff() uses vips_sink() instead of threadgroup
- strip out threadgroup
- add --enable-debug=xxx flag
- im_iterate() -> vips_sink()
16/1/10 started 7.21.2
- "invalidate" is careful to keep images alive, so invalidate callbacks can do

3
TODO
View File

@ -1,7 +1,4 @@
- im_iterate() is deprecated: change to vips_sink() throughout
- expose more of the tone funcs in nip2

View File

@ -86,7 +86,7 @@ typedef struct _Wrapscan {
} Wrapscan;
static void *
wrapscan_start( IMAGE *in, void *a, void *b )
wrapscan_start( VipsImage *in, void *a, void *b )
{
Wrapscan *wrapscan = (Wrapscan *) a;
@ -122,12 +122,12 @@ wrapscan_scan( REGION *reg, void *seq, void *a, void *b )
return( 0 );
}
/* Like im_iterate(), but the scan function works a line at a time, like
/* Like vips_sink(), but the scan function works a line at a time, like
* im_wrap*(). Shared with im_min(), im_deviate() etc.
*/
int
im__wrapscan( IMAGE *in,
im_start_fn start, im__wrapscan_fn scan, im_stop_fn stop,
im__wrapscan( VipsImage *in,
VipsStart start, im__wrapscan_fn scan, VipsStop stop,
void *a, void *b )
{
Wrapscan wrapscan;
@ -139,7 +139,7 @@ im__wrapscan( IMAGE *in,
wrapscan.a = a;
wrapscan.b = b;
return( im_iterate( in,
return( vips_sink( in,
wrapscan_start, wrapscan_scan, wrapscan_stop,
&wrapscan, NULL ) );
}

View File

@ -222,7 +222,7 @@ im_maxpos( IMAGE *in, int *xpos, int *ypos, double *out )
if( vips_bandfmt_iscomplex( in->BandFmt ) )
global_maxpos->max *= global_maxpos->max;
if( im_iterate( in, maxpos_start, maxpos_scan, maxpos_stop,
if( vips_sink( in, maxpos_start, maxpos_scan, maxpos_stop,
in, global_maxpos ) )
return( -1 );

View File

@ -238,7 +238,7 @@ im_maxpos_avg( IMAGE *in, double *xpos, double *ypos, double *out )
if( vips_bandfmt_iscomplex( in->BandFmt ) )
global_maxposavg->max *= global_maxposavg->max;
if( im_iterate( in, maxposavg_start, maxposavg_scan, maxposavg_stop,
if( vips_sink( in, maxposavg_start, maxposavg_scan, maxposavg_stop,
in, global_maxposavg ) )
return( -1 );

View File

@ -143,7 +143,7 @@ int im_maxpos_vec( IMAGE *im, int *xpos, int *ypos, double *maxima, int n ){
maxpos_list_init( &master_list, n );
result= im_iterate( im, maxpos_vec_start, maxpos_vec_scan, maxpos_vec_stop, &n, &master_list );
result= vips_sink( im, maxpos_vec_start, maxpos_vec_scan, maxpos_vec_stop, &n, &master_list );
im_free( pointers );
@ -208,7 +208,7 @@ int im_minpos_vec( IMAGE *im, int *xpos, int *ypos, double *minima, int n ){
minpos_list_init( &master_list, n );
result= im_iterate( im, minpos_vec_start, minpos_vec_scan, minpos_vec_stop, &n, &master_list );
result= vips_sink( im, minpos_vec_start, minpos_vec_scan, minpos_vec_stop, &n, &master_list );
im_free( pointers );

View File

@ -222,7 +222,7 @@ im_minpos( IMAGE *in, int *xpos, int *ypos, double *out )
if( vips_bandfmt_iscomplex( in->BandFmt ) )
global_minpos->min *= global_minpos->min;
if( im_iterate( in, minpos_start, minpos_scan, minpos_stop,
if( vips_sink( in, minpos_start, minpos_scan, minpos_stop,
in, global_minpos ) )
return( -1 );

View File

@ -347,7 +347,7 @@ im_histgr( IMAGE *in, IMAGE *out, int bandno )
/* Accumulate data.
*/
if( im_iterate( in,
if( vips_sink( in,
build_subhist, scanfn, merge_subhist, mhist, NULL ) )
return( -1 );

View File

@ -360,7 +360,7 @@ im_hist_indexed( IMAGE *index, IMAGE *value, IMAGE *out )
/* Accumulate data.
*/
if( im_iterate( index,
if( vips_sink( index,
hist_start, scanfn, hist_stop, mhist, NULL ) ||
hist_write( out, mhist ) ) {
hist_free( mhist );

View File

@ -239,7 +239,7 @@ im_histnD( IMAGE *in, IMAGE *out, int bins )
/* Accumulate data.
*/
if( im_iterate( in,
if( vips_sink( in,
build_subhist, find_hist, merge_subhist, mhist, NULL ) )
return( -1 );

View File

@ -288,7 +288,7 @@ im_project( IMAGE *in, IMAGE *hout, IMAGE *vout )
/* Accumulate data.
*/
if( im_iterate( in,
if( vips_sink( in,
project_new_sub, project_scan, project_merge, mproject, NULL ) )
return( -1 );