Issue #6994: Color Noise produces artifacts with highly saturated…

… source colors

Reviewer's (Jehan) note: a git blame shows this is a clear bug
introduced in commit 9d19bf2a3e, which was a cleanup patch, and the
BOUNDS() macro was not doing exactly the same thing as the code before
the change.
This commit is contained in:
Michael McLaughlin 2021-07-17 18:58:16 +02:00 committed by Jehan
parent 681d8e7454
commit 3b3f34cd22
1 changed files with 1 additions and 1 deletions

View File

@ -1035,7 +1035,7 @@ repaint (ppm_t *p, ppm_t *a)
if (runningvals.color_noise > 0.0)
{
double v = runningvals.color_noise;
#define BOUNDS(a) (((a) < 0) ? (a) : ((a) > 255) ? 255 : (a))
#define BOUNDS(a) (((a) < 0) ? (0) : ((a) > 255) ? 255 : (a))
#define MYASSIGN(a) \
{ \
a = a + g_rand_double_range (random_generator, -v/2.0, v/2.0); \