nope, revert
it's not possible to get inisert to trigger minimise reliably, since threads can be out of order in the middle of the pipeline we need to add minimise on Y (as before) to get reliable behaviour for this case
This commit is contained in:
parent
7f08e8fd28
commit
55ae22608f
@ -28,8 +28,6 @@
|
|||||||
* 29/9/11
|
* 29/9/11
|
||||||
* - rewrite as a class
|
* - rewrite as a class
|
||||||
* - add expand, bg options
|
* - add expand, bg options
|
||||||
* 27/7/19
|
|
||||||
* - minimise sub when we're done with it
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -170,8 +168,6 @@ vips__insert_paste_region( VipsRegion *or, VipsRegion *ir, VipsRect *pos )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert generate function.
|
|
||||||
*/
|
|
||||||
static int
|
static int
|
||||||
vips_insert_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
|
vips_insert_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
|
||||||
{
|
{
|
||||||
@ -181,37 +177,28 @@ vips_insert_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
|
|||||||
|
|
||||||
VipsRect ovl;
|
VipsRect ovl;
|
||||||
|
|
||||||
/* Does the rect we have been asked for fall entirely inside the
|
/* The part of the subimage we will use.
|
||||||
* sub-image?
|
|
||||||
*/
|
|
||||||
if( vips_rect_includesrect( &insert->rsub, &or->valid ) )
|
|
||||||
return( vips__insert_just_one( or, ir[1],
|
|
||||||
insert->rsub.left, insert->rsub.top ) );
|
|
||||||
|
|
||||||
/* Does it fall entirely inside the main, and not at all inside the
|
|
||||||
* sub?
|
|
||||||
*/
|
*/
|
||||||
vips_rect_intersectrect( &or->valid, &insert->rsub, &ovl );
|
vips_rect_intersectrect( &or->valid, &insert->rsub, &ovl );
|
||||||
if( vips_rect_includesrect( &insert->rmain, &or->valid ) &&
|
|
||||||
vips_rect_isempty( &ovl ) ) {
|
/* Three cases: we are generating entirely within the sub-image,
|
||||||
/* If we're now below the sub-image, and we're in sequential
|
* entirely within the main image, or a mixture.
|
||||||
* mode, and we've not minimised it before, we can shut down
|
|
||||||
* that input.
|
|
||||||
*/
|
*/
|
||||||
if( vips_image_is_sequential( insert->sub ) &&
|
if( vips_rect_includesrect( &insert->rsub, &or->valid ) ) {
|
||||||
r->top > VIPS_RECT_BOTTOM( &insert->rsub ) &&
|
if( vips__insert_just_one( or, ir[1],
|
||||||
!insert->sub_minimised ) {
|
insert->rsub.left, insert->rsub.top ) )
|
||||||
insert->sub_minimised = TRUE;
|
return( -1 );
|
||||||
vips_image_minimise_all( insert->sub );
|
|
||||||
}
|
}
|
||||||
|
else if( vips_rect_includesrect( &insert->rmain, &or->valid ) &&
|
||||||
return( vips__insert_just_one( or, ir[0],
|
vips_rect_isempty( &ovl ) ) {
|
||||||
insert->rmain.left, insert->rmain.top ) );
|
if( vips__insert_just_one( or, ir[0],
|
||||||
|
insert->rmain.left, insert->rmain.top ) )
|
||||||
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
/* Output requires both (or neither) input. If it is not entirely
|
/* Output requires both (or neither) input. If it is not
|
||||||
* inside both the main and the sub, then there is going to be some
|
* entirely inside both the main and the sub, then there is
|
||||||
* background.
|
* going to be some background.
|
||||||
*/
|
*/
|
||||||
if( !(vips_rect_includesrect( &insert->rsub, &or->valid ) &&
|
if( !(vips_rect_includesrect( &insert->rsub, &or->valid ) &&
|
||||||
vips_rect_includesrect( &insert->rmain, &or->valid )) )
|
vips_rect_includesrect( &insert->rmain, &or->valid )) )
|
||||||
@ -226,6 +213,7 @@ vips_insert_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
|
|||||||
*/
|
*/
|
||||||
if( vips__insert_paste_region( or, ir[1], &insert->rsub ) )
|
if( vips__insert_paste_region( or, ir[1], &insert->rsub ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user