Commit bd8032bb authored by Thomas White's avatar Thomas White
Browse files

Clamp negative values to zero when displaying

parent d84fd5ff
......@@ -34,6 +34,7 @@
\
r = 0; g = 0; b = 0; \
\
if ( p < 0.0 ) p = 0.0; \
switch ( s ) { \
case 0 : { /* Black to blue */ \
r = 0; g = 0; b = p*255; \
......@@ -72,6 +73,7 @@
#define RENDER_MONO \
float p; \
p = (float)val / (float)max; \
if ( p < 0.0 ) p = 0.0; \
r = 255.0*p; g = 255.0*p; b = 255.0*p;
/* NB This function is shared between render_get_image() and
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment