use new hints and prepare everywhere

This commit is contained in:
John Cupitt 2017-01-12 14:36:44 +00:00
parent f302bd6570
commit 6b325145e4
14 changed files with 31 additions and 19 deletions

View File

@ -20,6 +20,9 @@
- better support for bscale / bzero in fits images
- deprecate vips_warn() / vips_info(); use g_warning() / g_info() instead
- fix --vips-cache-max etc.
- add compute reordering, plus some new API to support it:
vips_reorder_margin_hint() and vips_reorder_prepare_many(), thanks
aferrero2707
8/12/16 started 8.4.5
- allow libgsf-1.14.26 to help centos, thanks tdiprima

6
TODO
View File

@ -1,9 +1,3 @@
- use vips_reorder_prepare_many() elsewhere ... bandary,
- add vips_reorder_margin_hint() elsewhere ... morph, local hist,
- not sure about utf8 error messages on win

View File

@ -234,9 +234,8 @@ vips_colour_gen( VipsRegion *or,
int i, y;
VipsPel *p[MAX_INPUT_IMAGES], *q;
for( i = 0; ir[i]; i++ )
if( vips_region_prepare( ir[i], r ) )
return( -1 );
if( vips_reorder_prepare_many( or->im, ir, r ) )
return( -1 );
VIPS_GATE_START( "vips_colour_gen: work" );

View File

@ -92,11 +92,10 @@ vips_bandary_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
VipsPel *p[MAX_INPUT_IMAGES], *q;
int y, i;
for( i = 0; i < bandary->n; i++ ) {
if( vips_region_prepare( ir[i], r ) )
return( -1 );
if( vips_reorder_prepare_many( or->im, ir, r ) )
return( -1 );
for( i = 0; i < bandary->n; i++ )
p[i] = VIPS_REGION_ADDR( ir[i], r->left, r->top );
}
p[i] = NULL;
q = VIPS_REGION_ADDR( or, r->left, r->top );

View File

@ -283,6 +283,9 @@ vips_blend_gen( VipsRegion *or, void *seq, void *client1, void *client2,
else {
/* Mix of set and clear ... ask for both then and else parts
* and interleave.
*
* We can't use vips_reorder_prepare_many() since we always
* want the c image first.
*/
if( vips_region_prepare( ir[0], r ) ||
vips_region_prepare( ir[1], r ) )

View File

@ -125,6 +125,9 @@ vips_correlation_build( VipsObject *object )
correlation->in_ready, correlation ) )
return( -1 );
vips_reorder_margin_hint( correlation->out,
correlation->ref->Xsize * correlation->ref->Ysize );
return( 0 );
}

View File

@ -121,8 +121,7 @@ vips_sharpen_generate( VipsRegion *or,
int x, y;
if( vips_region_prepare( in[0], r ) ||
vips_region_prepare( in[1], r ) )
if( vips_reorder_prepare_many( or->im, in, r ) )
return( -1 );
VIPS_GATE_START( "vips_sharpen_generate: work" );

View File

@ -649,12 +649,11 @@ process_region( VipsRegion *or, void *seq, void *a, void *b )
/* Prepare all input regions and make buffer pointers.
*/
for( i = 0; ir[i]; i++ ) {
if( vips_region_prepare( ir[i], &or->valid ) )
return( -1 );
if( vips_reorder_prepare_many( or->im, ir, &or->valid ) )
return( -1 );
for( i = 0; ir[i]; i++ )
p[i] = (PEL *) VIPS_REGION_ADDR( ir[i],
or->valid.left, or->valid.top );
}
p[i] = NULL;
q = (PEL *) VIPS_REGION_ADDR( or, or->valid.left, or->valid.top );

View File

@ -280,6 +280,8 @@ vips_hist_local_build( VipsObject *object )
local->out->Xoffset = 0;
local->out->Yoffset = 0;
vips_reorder_margin_hint( local->out, local->width * local->height );
return( 0 );
}

View File

@ -272,6 +272,8 @@ vips_stdif_build( VipsObject *object )
stdif->out->Xoffset = 0;
stdif->out->Yoffset = 0;
vips_reorder_margin_hint( stdif->out, stdif->width * stdif->height );
return( 0 );
}

View File

@ -120,6 +120,9 @@ vips_morph_build( VipsObject *object )
g_assert_not_reached();
}
vips_reorder_margin_hint( morph->out,
morph->M->Xsize * morph->M->Ysize );
return( 0 );
}

View File

@ -391,6 +391,8 @@ vips_rank_build( VipsObject *object )
rank->out->Xoffset = 0;
rank->out->Yoffset = 0;
vips_reorder_margin_hint( rank->out, rank->width * rank->height );
return( 0 );
}

View File

@ -540,6 +540,8 @@ vips_reduceh_build( VipsObject *object )
in, reduceh ) )
return( -1 );
vips_reorder_margin_hint( resample->out, reduceh->n_point );
return( 0 );
}

View File

@ -813,6 +813,8 @@ vips_reducev_raw( VipsReducev *reducev, VipsImage *in )
in, reducev ) )
return( -1 );
vips_reorder_margin_hint( resample->out, reducev->n_point );
return( 0 );
}