From 65b9ced6e9477222c52a1a3113f58c2e796935ca Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 11 Apr 2016 13:23:25 +0100 Subject: [PATCH] improve arg order more consistent --- libvips/resample/bicubic.cpp | 9 ++++----- libvips/resample/reduceh.cpp | 2 +- libvips/resample/templates.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libvips/resample/bicubic.cpp b/libvips/resample/bicubic.cpp index 1b688be7..dec18fac 100644 --- a/libvips/resample/bicubic.cpp +++ b/libvips/resample/bicubic.cpp @@ -457,8 +457,8 @@ bicubic_notab( void *pout, const VipsPel *pin, double cx[4]; double cy[4]; - calculate_coefficients_catmull( x, cx ); - calculate_coefficients_catmull( y, cy ); + calculate_coefficients_catmull( cx, x ); + calculate_coefficients_catmull( cy, y ); for( int z = 0; z < bands; z++ ) { const T uno_one = in[0]; @@ -644,9 +644,8 @@ vips_interpolate_bicubic_class_init( VipsInterpolateBicubicClass *iclass ) /* Build the tables of pre-computed coefficients. */ for( int x = 0; x < VIPS_TRANSFORM_SCALE + 1; x++ ) { - calculate_coefficients_catmull( - (float) x / VIPS_TRANSFORM_SCALE, - vips_bicubic_matrixf[x] ); + calculate_coefficients_catmull( vips_bicubic_matrixf[x], + (float) x / VIPS_TRANSFORM_SCALE ); for( int i = 0; i < 4; i++ ) vips_bicubic_matrixi[x][i] = diff --git a/libvips/resample/reduceh.cpp b/libvips/resample/reduceh.cpp index 9048bef3..8d1c3763 100644 --- a/libvips/resample/reduceh.cpp +++ b/libvips/resample/reduceh.cpp @@ -139,7 +139,7 @@ vips_reduce_make_mask( double *c, VipsKernel kernel, double shrink, double x ) break; case VIPS_KERNEL_CUBIC: - calculate_coefficients_catmull( x, c ); + calculate_coefficients_catmull( c, x ); break; case VIPS_KERNEL_LANCZOS2: diff --git a/libvips/resample/templates.h b/libvips/resample/templates.h index 70489bcf..8c026ac0 100644 --- a/libvips/resample/templates.h +++ b/libvips/resample/templates.h @@ -287,7 +287,7 @@ bicubic_float( * from the interpolator as well as from the table builder. */ static void inline -calculate_coefficients_catmull( const double x, double c[4] ) +calculate_coefficients_catmull( double c[4], const double x ) { /* Nicolas believes that the following is an hitherto unknown * hyper-efficient method of computing Catmull-Rom coefficients. It