add a compat stub for vips_region_shrink()

to keep ABI compat with 8.6
This commit is contained in:
John Cupitt 2018-08-29 09:50:35 +01:00
parent bb23a1fe6c
commit 1702529be0
4 changed files with 34 additions and 11 deletions

View File

@ -1407,7 +1407,8 @@ strip_shrink( Layer *layer )
if( vips_rect_isempty( &target ) )
break;
(void) vips_region_shrink( from, to, &target, region_shrink );
(void) vips_region_shrink_method( from, to,
&target, region_shrink );
below->write_y += target.height;

View File

@ -1399,8 +1399,7 @@ layer_strip_shrink( Layer *layer )
if( vips_rect_isempty( &target ) )
break;
(void) vips_region_shrink( from, to, &target,
VIPS_REGION_SHRINK_MEAN );
(void) vips_region_shrink( from, to, &target );
below->write_y += target.height;

View File

@ -132,9 +132,10 @@ void vips_region_paint_pel( VipsRegion *reg,
void vips_region_black( VipsRegion *reg );
void vips_region_copy( VipsRegion *reg, VipsRegion *dest,
const VipsRect *r, int x, int y );
int vips_region_shrink( VipsRegion *from,
VipsRegion *to, const VipsRect *target,
VipsRegionShrink method );
int vips_region_shrink_method( VipsRegion *from, VipsRegion *to,
const VipsRect *target, VipsRegionShrink method );
int vips_region_shrink( VipsRegion *from, VipsRegion *to,
const VipsRect *target );
int vips_region_prepare( VipsRegion *reg, const VipsRect *r );
int vips_region_prepare_to( VipsRegion *reg,

View File

@ -1510,7 +1510,7 @@ vips_region_shrink_alpha( VipsRegion *from,
}
/**
* vips_region_shrink:
* vips_region_shrink_method:
* @from: source region
* @to: (inout): destination region
* @target: #VipsRect of pixels you need to copy
@ -1525,16 +1525,17 @@ vips_region_shrink_alpha( VipsRegion *from,
* See also: vips_region_copy().
*/
int
vips_region_shrink( VipsRegion *from, VipsRegion *to, const VipsRect *target,
VipsRegionShrink method )
vips_region_shrink_method( VipsRegion *from, VipsRegion *to,
const VipsRect *target, VipsRegionShrink method )
{
VipsImage *image = from->im;
if( vips_check_coding_noneorlabq( "vips_region_shrink", image ) )
if( vips_check_coding_noneorlabq( "vips_region_shrink_method", image ) )
return( -1 );
if( from->im->Coding == VIPS_CODING_NONE ) {
if( vips_check_noncomplex( "vips_region_shrink", image ) )
if( vips_check_noncomplex( "vips_region_shrink_method",
image ) )
return( -1 );
if( vips_image_hasalpha( image ) )
@ -1548,6 +1549,27 @@ vips_region_shrink( VipsRegion *from, VipsRegion *to, const VipsRect *target,
return( 0 );
}
/**
* vips_region_shrink: (skip)
* @from: source region
* @to: (inout): destination region
* @target: #VipsRect of pixels you need to copy
*
* Write the pixels @target in @to from the x2 larger area in @from.
* Non-complex uncoded images and LABQ only. Images with alpha (see
* vips_image_hasalpha()) shrink with pixels scaled by alpha to avoid fringing.
*
* This is a compatibility stub that just calls vips_region_shrink_method().
*
* See also: vips_region_shrink_method().
*/
int
vips_region_shrink( VipsRegion *from, VipsRegion *to, const VipsRect *target )
{
return( vips_region_shrink_method( from, to, target,
VIPS_REGION_SHRINK_MEAN ) );
}
/* Generate into a region.
*/
static int