From 9226303b1c794a1a175e3c8723fc64d9206848fb Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Mon, 13 Jul 2020 15:37:35 +0200 Subject: [PATCH] Add missing vips7 compat wrappers For im_{lr,tb}mosaic and im_correl. --- libvips/deprecated/vips7compat.c | 62 ++++++++++++++++++++++++++++++ libvips/include/vips/vips7compat.h | 12 ++++++ libvips/mosaicing/pmosaicing.h | 5 --- 3 files changed, 74 insertions(+), 5 deletions(-) diff --git a/libvips/deprecated/vips7compat.c b/libvips/deprecated/vips7compat.c index f0a8f2fc..6c9a9c34 100644 --- a/libvips/deprecated/vips7compat.c +++ b/libvips/deprecated/vips7compat.c @@ -5309,6 +5309,32 @@ im_remosaic( IMAGE *in, IMAGE *out, const char *old_str, const char *new_str ) return( 0 ); } +int +im_lrmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out, + int bandno, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, + int balancetype, + int mwidth ) +{ + VipsImage *x; + + if( vips_mosaic( ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, + xref, yref, xsec, ysec, + "hwindow", hwindowsize, + "harea", hsearchsize, + "mblend", mwidth, + NULL ) ) + return( -1 ); + if( vips_image_write( x, out ) ) { + g_object_unref( x ); + return( -1 ); + } + g_object_unref( x ); + + return( 0 ); +} + int im_lrmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out, int bandno, @@ -5338,6 +5364,32 @@ im_lrmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out, return( 0 ); } +int +im_tbmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out, + int bandno, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, + int balancetype, + int mwidth ) +{ + VipsImage *x; + + if( vips_mosaic( ref, sec, &x, VIPS_DIRECTION_VERTICAL, + xref, yref, xsec, ysec, + "hwindow", hwindowsize, + "harea", hsearchsize, + "mblend", mwidth, + NULL ) ) + return( -1 ); + if( vips_image_write( x, out ) ) { + g_object_unref( x ); + return( -1 ); + } + g_object_unref( x ); + + return( 0 ); +} + int im_tbmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out, int bandno, @@ -5367,6 +5419,16 @@ im_tbmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out, return( 0 ); } +int +im_correl( VipsImage *ref, VipsImage *sec, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, + double *correlation, int *x, int *y ) +{ + return( vips__correl( ref, sec, xref, yref, xsec, ysec, + hwindowsize, hsearchsize, correlation, x, y ) ); +} + int im_lrmerge( IMAGE *ref, IMAGE *sec, IMAGE *out, int dx, int dy, int mwidth ) diff --git a/libvips/include/vips/vips7compat.h b/libvips/include/vips/vips7compat.h index 460eab0c..a8f10ba2 100644 --- a/libvips/include/vips/vips7compat.h +++ b/libvips/include/vips/vips7compat.h @@ -1078,6 +1078,12 @@ int im_tbmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, int xr2, int yr2, int xs2, int ys2, int mwidth ); +int im_lrmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, + int balancetype, + int mwidth ); int im_lrmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, int bandno, int xr1, int yr1, int xs1, int ys1, @@ -1085,6 +1091,12 @@ int im_lrmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, int hwindowsize, int hsearchsize, int balancetype, int mwidth ); +int im_tbmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, + int balancetype, + int mwidth ); int im_tbmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, int bandno, int xr1, int yr1, int xs1, int ys1, diff --git a/libvips/mosaicing/pmosaicing.h b/libvips/mosaicing/pmosaicing.h index 2acbdeb5..965fbdbf 100644 --- a/libvips/mosaicing/pmosaicing.h +++ b/libvips/mosaicing/pmosaicing.h @@ -135,11 +135,6 @@ int vips__tbmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, double a, double b, double dx, double dy, int mwidth ); -int vips_correl( VipsImage *ref, VipsImage *sec, - int xref, int yref, int xsec, int ysec, - int hwindowsize, int hsearchsize, - double *correlation, int *x, int *y ); - #define VIPS_MAXPOINTS (60) /* VIPS_MAXPOINTS % AREAS must be zero */ #define AREAS (3)