From 0534e5563d9ca5d73debd9256cd7cec7a2973590 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 1 Sep 2009 14:21:28 +0000 Subject: [PATCH] im_stats fix --- TODO | 1 - libvips/convolution/rotmask.c | 44 --------------------------------- libvips/convolution/rw_mask.c | 46 +++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 45 deletions(-) diff --git a/TODO b/TODO index c96830bb..dc49fd92 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,5 @@ - make im__math and common up code between the trig/log funcs - - 1-bit PNG read is broken? > The bug is that 1bit depth PNG addresses are incorrectly interpreted. At diff --git a/libvips/convolution/rotmask.c b/libvips/convolution/rotmask.c index 85c1057e..8dd98e6a 100644 --- a/libvips/convolution/rotmask.c +++ b/libvips/convolution/rotmask.c @@ -47,16 +47,6 @@ * @(#) by 90 degrees clockwise. * @(#) The filename member of the returned mask is set to name * @(#) - * @(#) Prints a mask. Used mainly for debugging purposes - * @(#) - * @(#) Usage - * @(#) void im_print_dmask( m ) - * @(#) DOUBLEMASK *m; - * @(#) - * @(#) Usage - * @(#) void im_print_imask( m ) - * @(#) INTMASK *m; - * @(#) * * * Author: N. Dessipris (Copyright, N. Dessipris 1991) @@ -320,37 +310,3 @@ im_rotate_imask45( INTMASK *m, const char *name ) { return( rotimask( im_offsets45, m, name ) ); } - -void -im_print_imask( INTMASK *m ) -{ - int i, j, k; - int *pm = m->coeff; - - fprintf( stderr, " %s: %d %d %d %d\n", - m->filename, m->xsize, m->ysize, m->scale, m->offset ); - - for( k = 0, j = 0; j < m->ysize; j++ ) { - for( i = 0; i < m->xsize; i++, k++ ) - fprintf( stderr, "%d\t", pm[k] ); - - fprintf( stderr, "\n" ); - } -} - -void -im_print_dmask( DOUBLEMASK *m ) -{ - int i, j, k; - double *pm = m->coeff; - - fprintf( stderr, " %s: %d %d %f %f\n", - m->filename, m->xsize, m->ysize, m->scale, m->offset ); - - for( k = 0, j = 0; j < m->ysize; j++ ) { - for( i = 0; i < m->xsize; i++, k++ ) - fprintf( stderr, "%f\t", pm[k] ); - - fprintf( stderr, "\n" ); - } -} diff --git a/libvips/convolution/rw_mask.c b/libvips/convolution/rw_mask.c index 1839e999..05745df5 100644 --- a/libvips/convolution/rw_mask.c +++ b/libvips/convolution/rw_mask.c @@ -5,6 +5,16 @@ * @(#) The mask coefficients can be either int (INTMASK) * @(#) or double (DOUBLEMASK). * @(#) + * @(#) Prints a mask. Used mainly for debugging purposes + * @(#) + * @(#) Usage + * @(#) void im_print_dmask( m ) + * @(#) DOUBLEMASK *m; + * @(#) + * @(#) Usage + * @(#) void im_print_imask( m ) + * @(#) INTMASK *m; + * @(#) * * Copyright: 1990, N. Dessipris. * @@ -45,6 +55,8 @@ * - use g_ascii_strtod() and friends * 2006-09-08 tcv * - add im_norm_dmask() + * 1/9/09 + * - move im_print_*mask() here */ /* @@ -725,3 +737,37 @@ im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask ) for( x = 0; x < mask->xsize; x++ ) *p++ = matrix[x][y]; } + +void +im_print_imask( INTMASK *m ) +{ + int i, j, k; + int *pm = m->coeff; + + printf( "%s: %d %d %d %d\n", + m->filename, m->xsize, m->ysize, m->scale, m->offset ); + + for( k = 0, j = 0; j < m->ysize; j++ ) { + for( i = 0; i < m->xsize; i++, k++ ) + printf( "%d\t", pm[k] ); + + printf( "\n" ); + } +} + +void +im_print_dmask( DOUBLEMASK *m ) +{ + int i, j, k; + double *pm = m->coeff; + + printf( "%s: %d %d %f %f\n", + m->filename, m->xsize, m->ysize, m->scale, m->offset ); + + for( k = 0, j = 0; j < m->ysize; j++ ) { + for( i = 0; i < m->xsize; i++, k++ ) + printf( "%f\t", pm[k] ); + + printf( "\n" ); + } +}