This commit is contained in:
John Cupitt 2008-01-24 18:06:41 +00:00
parent 830c303ada
commit 46fc1a8d75
3 changed files with 12 additions and 9 deletions

View File

@ -2,6 +2,7 @@
- added "include <cstring>" to VImage.cc to help gcc 4.3 - added "include <cstring>" to VImage.cc to help gcc 4.3
- started moving the python binding to dynamic wrapping - started moving the python binding to dynamic wrapping
- added im_wrap(), im_wraptwo(), im_phasecor_fft(), im_cross_phase() (Tom) - added im_wrap(), im_wraptwo(), im_phasecor_fft(), im_cross_phase() (Tom)
- memleak plugged in im_save_string_setf()
31/10/07 started 7.13.2 31/10/07 started 7.13.2
- build cimg on windows fixes - build cimg on windows fixes

View File

@ -77,14 +77,14 @@ static int
lhist_gen( REGION *or, void *seq, void *a, void *b ) lhist_gen( REGION *or, void *seq, void *a, void *b )
{ {
REGION *ir = (REGION *) seq; REGION *ir = (REGION *) seq;
LhistInfo *inf = (LhistInfo *) inf; LhistInfo *inf = (LhistInfo *) b;
Rect irect; Rect irect;
Rect *r = &or->valid; Rect *r = &or->valid;
int le = r->left; int le = r->left;
int to = r->top; int to = r->top;
int bo = IM_RECT_BOTTOM(r); int bo = IM_RECT_BOTTOM( r );
int ri = IM_RECT_RIGHT(r); int ri = IM_RECT_RIGHT( r );
int x, y, i, j; int x, y, i, j;
int lsk; int lsk;
@ -101,7 +101,7 @@ lhist_gen( REGION *or, void *seq, void *a, void *b )
if( im_prepare( ir, &irect ) ) if( im_prepare( ir, &irect ) )
return( -1 ); return( -1 );
lsk = IM_REGION_LSKIP( ir ); lsk = IM_REGION_LSKIP( ir );
coff = lsk * (inf->ywin/2) + inf->xwin/2; coff = lsk * (inf->ywin / 2) + inf->xwin / 2;
for( y = to; y < bo; y++ ) { for( y = to; y < bo; y++ ) {
/* Get input and output pointers for this line. /* Get input and output pointers for this line.
@ -109,11 +109,11 @@ lhist_gen( REGION *or, void *seq, void *a, void *b )
PEL *p = (PEL *) IM_REGION_ADDR( ir, le, y ); PEL *p = (PEL *) IM_REGION_ADDR( ir, le, y );
PEL *q = (PEL *) IM_REGION_ADDR( or, le, y ); PEL *q = (PEL *) IM_REGION_ADDR( or, le, y );
PEL *p1, *p2; PEL *p1, *p2;
int hist[ 256 ]; int hist[256];
/* Find histogram for start of this line. /* Find histogram for start of this line.
*/ */
memset( hist, 0, 256 * sizeof(int) ); memset( hist, 0, 256 * sizeof( int ) );
for( p1 = p, j = 0; j < inf->ywin; j++, p1 += lsk ) for( p1 = p, j = 0; j < inf->ywin; j++, p1 += lsk )
for( p2 = p1, i = 0; i < inf->xwin; i++, p2++ ) for( p2 = p1, i = 0; i < inf->xwin; i++, p2++ )
hist[*p2]++; hist[*p2]++;
@ -155,11 +155,11 @@ im_lhisteq_raw( IMAGE *in, IMAGE *out, int xwin, int ywin )
return( -1 ); return( -1 );
if( in->Bbits != IM_BBITS_BYTE || in->BandFmt != IM_BANDFMT_UCHAR || if( in->Bbits != IM_BBITS_BYTE || in->BandFmt != IM_BANDFMT_UCHAR ||
in->Bands != 1 || in->Coding != IM_CODING_NONE ) { in->Bands != 1 || in->Coding != IM_CODING_NONE ) {
im_errormsg( "im_lhisteq: one band uchar uncoded only" ); im_error( "im_lhisteq", _( "one band uchar uncoded only" ) );
return( -1 ); return( -1 );
} }
if( xwin > in->Xsize || ywin > in->Ysize ) { if( xwin > in->Xsize || ywin > in->Ysize ) {
im_errormsg( "im_lhisteq: window too large" ); im_error( "im_lhisteq", _( "window too large" ) );
return( -1 ); return( -1 );
} }
if( im_cp_desc( out, in ) ) if( im_cp_desc( out, in ) )

View File

@ -13,6 +13,8 @@
* - added im__meta_destroy() * - added im__meta_destroy()
* 1/9/05 * 1/9/05
* - oop, hash table insert/replace confusion fixed * - oop, hash table insert/replace confusion fixed
* 24/1/07
* - oop, im_save_string_setf() was leaking
*/ */
/* /*
@ -386,8 +388,8 @@ im_save_string_setf( GValue *value, const char *fmt, ... )
va_start( ap, fmt ); va_start( ap, fmt );
str = g_strdup_vprintf( fmt, ap ); str = g_strdup_vprintf( fmt, ap );
va_end( ap ); va_end( ap );
im_save_string_set( value, str ); im_save_string_set( value, str );
g_free( str );
} }
/* Read/write int, double metadata. /* Read/write int, double metadata.