From a4d93854080ecf5b24911b8e211cb71bc5d60252 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 16 Nov 2011 18:05:25 +0000 Subject: [PATCH] fix pow/exp with a constant --- TODO | 10 +++------- libvips/arithmetic/arithmetic.c | 23 ----------------------- libvips/arithmetic/arithmetic.h | 5 ----- libvips/arithmetic/math2.c | 2 +- 4 files changed, 4 insertions(+), 36 deletions(-) diff --git a/TODO b/TODO index 327c305a..434cb182 100644 --- a/TODO +++ b/TODO @@ -1,15 +1,11 @@ -- try loading a float image, then 255 * A1 ** 2 - -GLib-GObject-WARNING **: value "((VipsOperationMath2) 79094592)" of type -`VipsOperationMath2' is invalid or out of range for property `math2' of type -`VipsOperationMath2' - - - test docs need a set of convenience funcs for C, eg. vips_sin(), vips_more_const() etc. ... could include vips_relational() etc. as well? + have them all in a separate convenience.h and convenience.c so we can easily + compile without them + rewrite im_bandmean() in terms of recomb()? just use [0.33, 0.33, 0.33] move im_point_bilinear() to deprecated? or convenience? diff --git a/libvips/arithmetic/arithmetic.c b/libvips/arithmetic/arithmetic.c index 0e733ac9..5f482238 100644 --- a/libvips/arithmetic/arithmetic.c +++ b/libvips/arithmetic/arithmetic.c @@ -363,13 +363,6 @@ vips_arithmetic_build( VipsObject *object ) arithmetic->ready, arithmetic ) ) return( -1 ); -#ifdef DEBUG - printf( "vips_arithmetic_build: booltest = %d\n", - arithmetic->booltest ); - printf( "vips_arithmetic_build: imtest = %p\n", - arithmetic->imtest ); -#endif /*DEBUG*/ - return( 0 ); } @@ -391,22 +384,6 @@ vips_arithmetic_class_init( VipsArithmeticClass *class ) _( "Output image" ), VIPS_ARGUMENT_REQUIRED_OUTPUT, G_STRUCT_OFFSET( VipsArithmetic, out ) ); - - /* Just for testing. - */ - - VIPS_ARG_BOOL( class, "booltest", 101, - _( "Bool test" ), - _( "Test optional boolean argument" ), - VIPS_ARGUMENT_OPTIONAL_INPUT, - G_STRUCT_OFFSET( VipsArithmetic, booltest ), - FALSE ); - - VIPS_ARG_IMAGE( class, "imtest", 102, - _( "Image test" ), - _( "Test optional image argument" ), - VIPS_ARGUMENT_OPTIONAL_INPUT, - G_STRUCT_OFFSET( VipsArithmetic, imtest ) ); } static void diff --git a/libvips/arithmetic/arithmetic.h b/libvips/arithmetic/arithmetic.h index e1de9894..c7120e80 100644 --- a/libvips/arithmetic/arithmetic.h +++ b/libvips/arithmetic/arithmetic.h @@ -66,11 +66,6 @@ typedef struct _VipsArithmetic { */ VipsImage *out; - /* Optional bool argument for testing. - */ - gboolean booltest; - VipsImage *imtest; - /* Array of input arguments, set these from a subclass. */ VipsImage **in; diff --git a/libvips/arithmetic/math2.c b/libvips/arithmetic/math2.c index 64784276..60badfab 100644 --- a/libvips/arithmetic/math2.c +++ b/libvips/arithmetic/math2.c @@ -391,7 +391,7 @@ vips_math2_constv( VipsImage *in, VipsImage **out, for( i = 0; i < n; i++ ) array[i] = c[i]; - result = vips_call_split( "math2_const", ap, in, out, area_c ); + result = vips_call_split( "math2_const", ap, in, out, math2, area_c ); vips_area_unref( area_c );