From 87ab8c4e409d51c651fb567092529d1f190baabe Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 30 Mar 2009 14:02:06 +0000 Subject: [PATCH] stuff --- ChangeLog | 1 + TODO | 13 ++----------- include/vips/VMask.h | 1 + libsrc/convolution/im_gaussmasks.c | 9 ++++++++- libsrcCC/VMask.cc | 12 ++++++++++++ man/Makefile.am | 2 ++ man/im_affinei.3 | 2 +- 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ba008fe..f89d5248 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ - revised manpages - removed name and "changed" from vipsobject since we don't use them yet - explicitly link with stdc++ for nohalo etc stuff +- wrap im_gauss_imask_sep in C++/Python 6/3/09 started 7.17.3 - revised nohalo diff --git a/TODO b/TODO index ffe66fcb..33ecf8c1 100644 --- a/TODO +++ b/TODO @@ -1,17 +1,8 @@ - -- writing man page for VipsInterpolate - -- wrap im_gauss_mask_line or whatever it's called in C++/Python? - -- need man pages for im_affinei, im_affinei_all - -- Mention vips --list-classes or whatever in VipsFormat man page - - also in VipsInterpolate - WONTFIX for 7.18 ================ +- try adding "restrict" to im_conv? other interpolators? + - move im_shrink & friends to resample? match_linear, match_linear_search? diff --git a/include/vips/VMask.h b/include/vips/VMask.h index b1b9a44f..471a0cd2 100644 --- a/include/vips/VMask.h +++ b/include/vips/VMask.h @@ -299,6 +299,7 @@ public: // VIMask build functions static VIMask gauss( double, double ) throw( VError ); + static VIMask gauss_sep( double, double ) throw( VError ); static VIMask log( double, double ) throw( VError ); // VIMask manipulation diff --git a/libsrc/convolution/im_gaussmasks.c b/libsrc/convolution/im_gaussmasks.c index c752daea..c73320ea 100644 --- a/libsrc/convolution/im_gaussmasks.c +++ b/libsrc/convolution/im_gaussmasks.c @@ -30,6 +30,8 @@ * 18/3/09 * - bumped max mask size *40 * - added _sep variant + * 30/3/09 + * - set scale in _sep variant, why not */ /* @@ -193,6 +195,7 @@ im_gauss_imask_sep( const char *filename, double sigma, double min_amplitude ) INTMASK *im; INTMASK *im2; int i; + int sum; if( !(im = im_gauss_imask( filename, sigma, min_amplitude )) ) return( NULL ); @@ -201,8 +204,12 @@ im_gauss_imask_sep( const char *filename, double sigma, double min_amplitude ) return( NULL ); } - for( i = 0; i < im->xsize; i++ ) + sum = 0; + for( i = 0; i < im->xsize; i++ ) { im2->coeff[i] = im->coeff[i + im->xsize * (im->ysize / 2)]; + sum += im2->coeff[i]; + } + im2->scale = sum; im_free_imask( im ); diff --git a/libsrcCC/VMask.cc b/libsrcCC/VMask.cc index 984e96db..9e8693fc 100644 --- a/libsrcCC/VMask.cc +++ b/libsrcCC/VMask.cc @@ -464,6 +464,18 @@ VIMask VIMask::gauss( double sig, double minamp ) throw( VError ) return( out ); } +VIMask VIMask::gauss_sep( double sig, double minamp ) throw( VError ) +{ + VIMask out; + INTMASK *msk; + + if( !(msk = im_gauss_imask_sep( "VIMask::gauss", sig, minamp )) ) + verror(); + out.embed( msk ); + + return( out ); +} + VDMask VDMask::gauss( double sig, double minamp ) throw( VError ) { VDMask out; diff --git a/man/Makefile.am b/man/Makefile.am index e043413c..cc1fb99d 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -30,6 +30,8 @@ man_MANS = \ im_add_invalidate_callback.3 \ im_addgnoise.3 \ im_affine.3 \ + im_affinei.3 \ + im_affinei_all.3 \ im_allocate_input_array.3 \ im_amiMSBfirst.3 \ im_analyze2vips.3 \ diff --git a/man/im_affinei.3 b/man/im_affinei.3 index 49376c1d..ee63a8bc 100644 --- a/man/im_affinei.3 +++ b/man/im_affinei.3 @@ -25,7 +25,7 @@ int im_affinei_all(in, out, interpolate, a, b, c, d, dx, dy) .B double a, b, c, d, dx, dy; .SH DESCRIPTION -.B im_affinei() +.B im_affinei(3) applies an affine transformation on the image held by the IMAGE descriptor in and puts the result at the location pointed by the IMAGE descriptor out. in many have any number of bands, be any size, and have any non-complex type.