"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libvips/conversion/insert.c" between
vips-8.12.0.tar.gz and vips-8.12.1.tar.gz

About: VIPS is a free image processing system (see also the GUI nip2).

insert.c  (vips-8.12.0):insert.c  (vips-8.12.1)
skipping to change at line 98 skipping to change at line 98
VipsImage *sub; VipsImage *sub;
int x; int x;
int y; int y;
gboolean expand; gboolean expand;
VipsArrayDouble *background; VipsArrayDouble *background;
/* Pixel we paint calculated from background. /* Pixel we paint calculated from background.
*/ */
VipsPel *ink; VipsPel *ink;
/* Inputs cast and banded up, plus a NULL at the end. /* Inputs cast and banded up, plus a NULL at the end. main is 0, sub
* is 1.
*/ */
VipsImage *processed[3]; VipsImage *processed[3];
/* Geometry. /* Geometry.
*/ */
VipsRect rout; /* Output space */ VipsRect rout; /* Output space */
VipsRect rimage[2]; /* Position of main in output */ VipsRect rimage[2]; /* Position of input in output */
/* TRUE if we've minimised an input. /* TRUE if we've minimised an input.
*/ */
gboolean minimised[2]; gboolean minimised[2];
} VipsInsert; } VipsInsert;
typedef VipsConversionClass VipsInsertClass; typedef VipsConversionClass VipsInsertClass;
G_DEFINE_TYPE( VipsInsert, vips_insert, VIPS_TYPE_CONVERSION ); G_DEFINE_TYPE( VipsInsert, vips_insert, VIPS_TYPE_CONVERSION );
skipping to change at line 182 skipping to change at line 183
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 )
{ {
VipsRegion **ir = (VipsRegion **) seq; VipsRegion **ir = (VipsRegion **) seq;
VipsRect *r = &or->valid; VipsRect *r = &or->valid;
VipsInsert *insert = (VipsInsert *) b; VipsInsert *insert = (VipsInsert *) b;
VipsConversion *conversion = VIPS_CONVERSION( insert ); VipsConversion *conversion = VIPS_CONVERSION( insert );
int i; int i;
/* First, does this request fall entirely inside one of our inputs? If /* Three cases:
* it does, we can just redirect the request there. Test sub first. *
* 1. If r is entirely within sub, we can just paint from sub.
* 2. If r is entirely within main and does not touch sub, we can
* paint from main.
* 3. We must paint from both, and the background.
*/ */
for( i = 1; i >= 0; i-- ) { if( vips_rect_includesrect( &insert->rimage[1], r ) ) {
VipsRect *rimage = &insert->rimage[i]; /* Just the subimage.
*/
if( vips_rect_includesrect( rimage, r ) ) { if( vips__insert_just_one( or, ir[1],
if( vips__insert_just_one( or, ir[i], insert->rimage[1].left, insert->rimage[1].top ) )
rimage->left, rimage->top ) ) return( -1 );
return( -1 );
break;
}
} }
else if( vips_rect_includesrect( &insert->rimage[0], r ) &&
/* Otherwise, it requires both (or neither) input. !vips_rect_overlapsrect( &insert->rimage[1], r ) ) {
*/ /* Just the main image.
if( i < 0 ) { */
if( vips__insert_just_one( or, ir[0],
insert->rimage[0].left, insert->rimage[0].top ) )
return( -1 );
}
else {
/* Output requires both (or neither) input. If it is not /* Output requires both (or neither) input. If it is not
* entirely inside both the main and the sub, then there is * entirely inside both the main and the sub, then there is
* going to be some background. * going to be some background.
*/ */
vips_region_paint_pel( or, r, insert->ink ); vips_region_paint_pel( or, r, insert->ink );
/* Paste the background first. /* Paste the background first.
*/ */
for( i = 0; i < 2; i++ ) for( i = 0; i < 2; i++ )
if( vips__insert_paste_region( or, ir[i], if( vips__insert_paste_region( or, ir[i],
 End of changes. 5 change blocks. 
18 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)