From eae80d2bb4c3c2ed914174ab8d87df3c6dcf61fc Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 22 Sep 2009 16:51:04 +0000 Subject: [PATCH] arith_binary_const whoops --- libvips/arithmetic/im_add.c | 10 ++++++---- libvips/include/vips/internal.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libvips/arithmetic/im_add.c b/libvips/arithmetic/im_add.c index da1c7879..7f3233e6 100644 --- a/libvips/arithmetic/im_add.c +++ b/libvips/arithmetic/im_add.c @@ -216,13 +216,14 @@ im__bandup( IMAGE *in, IMAGE *out, int n ) * - cast in1 and in2 up to a common format * - cast the common format to the output format with the supplied table * - equalise bands - * - run the supplied buffer operation + * - run the supplied buffer operation passing one of the up-banded and + * up-casted inputs as the first param */ int im__arith_binary( const char *name, IMAGE *in1, IMAGE *in2, IMAGE *out, int format_table[10], - im_wrapmany_fn fn, void *a ) + im_wrapmany_fn fn, void *b ) { VipsBandFmt fmt; IMAGE *t[5]; @@ -262,10 +263,11 @@ im__arith_binary( const char *name, im__bandup( t[1], t[3], out->Bands ) ) return( -1 ); - /* And process! + /* And process! The buffer function gets one of the input images as a + * sample. */ t[4] = NULL; - if( im_wrapmany( t + 2, out, fn, out, a ) ) + if( im_wrapmany( t + 2, out, fn, t[0], b ) ) return( -1 ); return( 0 ); diff --git a/libvips/include/vips/internal.h b/libvips/include/vips/internal.h index 5e3ef111..13e4797c 100644 --- a/libvips/include/vips/internal.h +++ b/libvips/include/vips/internal.h @@ -135,7 +135,7 @@ int im__bandup( IMAGE *in, IMAGE *out, int n ); int im__arith_binary( const char *name, IMAGE *in1, IMAGE *in2, IMAGE *out, int format_table[10], - im_wrapmany_fn fn, void *a ); + im_wrapmany_fn fn, void *b ); int im__arith_binary_const( const char *name, IMAGE *in, IMAGE *out, int n, double *c, int format_table[10],