diff --git a/AUTHORS b/AUTHORS index aa2822d58b..ae3cebe511 100644 --- a/AUTHORS +++ b/AUTHORS @@ -71,6 +71,7 @@ Henrik Hansen Ville Hautamaki James Henstridge Eric Hernes +David Hodson Christoph Hoegl Wolfgang Hofer Jan Hubicka diff --git a/ChangeLog b/ChangeLog index 5148b4b211..e4606d1bf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-10-21 Austin Donnelly + + * plug-ins/common/nlfilt.c: minor patch from David Hodson + to fix off-by-one error in previous fix. + + * AUTHORS + * app/authors.h + * tools/authorsgen/contributors: Add the prolific David Hodson + to the authors list. + 2000-10-19 Seth Burgess * plug-ins/common/xbm.c : oops, should have compiled it before diff --git a/app/authors.h b/app/authors.h index 2686961f77..0236d76403 100644 --- a/app/authors.h +++ b/app/authors.h @@ -66,6 +66,7 @@ static gchar *authors[] = #endif "James Henstridge", "Eric Hernes", + "David Hodson", "Christoph Hoegl", "Wolfgang Hofer", "Jan Hubicka", diff --git a/plug-ins/common/nlfilt.c b/plug-ins/common/nlfilt.c index 52e324f8e5..d434a35b4c 100644 --- a/plug-ins/common/nlfilt.c +++ b/plug-ins/common/nlfilt.c @@ -264,7 +264,7 @@ pluginCore (struct piArgs *argp) gimp_pixel_rgn_init (&srcPr, drw, 0, 0, width, height, FALSE, FALSE); gimp_pixel_rgn_init (&dstPr, drw, 0, 0, width, height, TRUE, TRUE); - /* source buffer gives one pixel buffer around current row */ + /* source buffer gives one pixel margin all around destination buffer */ srcbuf = g_new0 (guchar, exrowsize * 3); dstbuf = g_new0 (guchar, rowsize); @@ -278,9 +278,11 @@ pluginCore (struct piArgs *argp) /* first row */ gimp_pixel_rgn_get_row (&srcPr, thisrow, 0, 0, width); + /* copy thisrow[0] to thisrow[-1], thisrow[width-1] to thisrow[width] */ memcpy (thisrow - Bpp, thisrow, Bpp); memcpy (thisrow + rowsize, thisrow + rowsize - Bpp, Bpp); - memcpy (lastrow, thisrow, exrowsize); + /* copy whole thisrow to lastrow */ + memcpy (lastrow - Bpp, thisrow - Bpp, exrowsize); for (y = 0; y < height - 1; y++) { @@ -292,6 +294,7 @@ pluginCore (struct piArgs *argp) memcpy (nextrow + rowsize, nextrow + rowsize - Bpp, Bpp); nlfiltRow (lastrow, thisrow, nextrow, dstbuf, width, Bpp, filtno); gimp_pixel_rgn_set_row (&dstPr, dstbuf, 0, y, width); + /* rotate row buffers */ temprow = lastrow; lastrow = thisrow; thisrow = nextrow; nextrow = temprow; } @@ -713,6 +716,10 @@ gint noisevariance; /* global so that pixel processing code can get at it q #define RUNSCALE(x) (((x) + (1 << (SCALEB-1))) >> SCALEB) /* rounded un-scale */ #define UNSCALE(x) ((x) >> SCALEB) +/* Note: modified by David Hodson, nlfiltRow now accesses + * srclast, srcthis, and srcnext from [-Bpp] to [width*Bpp-1]. + * Beware if you use this code anywhere else! + */ static void nlfiltRow(guchar *srclast, guchar *srcthis, guchar *srcnext, guchar *dst, gint width, gint Bpp, gint filtno) { diff --git a/tools/authorsgen/contributors b/tools/authorsgen/contributors index f2c47f3d4f..13ec83783c 100644 --- a/tools/authorsgen/contributors +++ b/tools/authorsgen/contributors @@ -68,6 +68,7 @@ Henrik Hansen Ville Hautamaki [Ville Hautamäki] James Henstridge Eric Hernes +David Hodson Christoph Hoegl Wolfgang Hofer Jan Hubicka