From 6602b0680a5025d9d306a3b34403c33caa53db04 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 6 Dec 2012 21:36:41 +0000 Subject: [PATCH] compat wrapper for cross_phase --- TODO | 2 -- libvips/deprecated/vips7compat.c | 16 ++++++++++++++++ libvips/include/vips/arithmetic.h | 2 -- libvips/include/vips/vips7compat.h | 2 ++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 790879cb..a6ae64a9 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -- im_cross_phase.c needs a vips7 compat wrapper - - add vips_band()/vips_bor() - now we've removed round-to-nearest from NN, we need something extra in the diff --git a/libvips/deprecated/vips7compat.c b/libvips/deprecated/vips7compat.c index 712d14af..3a03403b 100644 --- a/libvips/deprecated/vips7compat.c +++ b/libvips/deprecated/vips7compat.c @@ -2873,3 +2873,19 @@ im_minpos_vec( VipsImage *im, int *xpos, int *ypos, double *minima, int n ) return( 0 ); } +int +im_cross_phase( IMAGE *in1, IMAGE *in2, IMAGE *out ) +{ + VipsImage *x; + + if( vips_call( "cross_phase", in1, in2, &x, NULL ) ) + return( -1 ); + if( im_copy( x, out ) ) { + g_object_unref( x ); + return( -1 ); + } + g_object_unref( x ); + + return( 0 ); +} + diff --git a/libvips/include/vips/arithmetic.h b/libvips/include/vips/arithmetic.h index 5dbad4f3..e08da156 100644 --- a/libvips/include/vips/arithmetic.h +++ b/libvips/include/vips/arithmetic.h @@ -377,8 +377,6 @@ int vips_stats( VipsImage *in, VipsImage **out, ... ) int vips_measure( VipsImage *in, VipsImage **out, int h, int v, ... ) __attribute__((sentinel)); -int im_cross_phase( VipsImage *a, VipsImage *b, VipsImage *out ); - #ifdef __cplusplus } #endif /*__cplusplus*/ diff --git a/libvips/include/vips/vips7compat.h b/libvips/include/vips/vips7compat.h index bd79b561..63f6877b 100644 --- a/libvips/include/vips/vips7compat.h +++ b/libvips/include/vips/vips7compat.h @@ -671,6 +671,8 @@ int im_maxpos_avg( VipsImage *im, double *xpos, double *ypos, double *out ); int im_linreg( VipsImage **ins, VipsImage *out, double *xs ); +int im_cross_phase( VipsImage *a, VipsImage *b, VipsImage *out ); + int im_point( VipsImage *im, VipsInterpolate *interpolate, double x, double y, int band, double *out ); int im_point_bilinear( VipsImage *im,