On Thu, 2002-11-21 at 20:34, Denis Oliver Kropp wrote: > Quoting Antonino Daplas ([EMAIL PROTECTED]): > > I tried to apply it, but it seems that your patch doesn't apply > to the current CVS version. >
Oops, here's a follow-up incremental patch. Forgot to clamp resulting values for contrast which produced incorrect colors at certain contrast values. Tony
diff -Naur DirectFB-coloradjust-orig/src/core/fbdev/fbdev.c DirectFB-coloradjust/src/core/fbdev/fbdev.c --- DirectFB-coloradjust-orig/src/core/fbdev/fbdev.c 2002-11-21 22:55:37.000000000 +0000 +++ DirectFB-coloradjust/src/core/fbdev/fbdev.c 2002-11-21 22:54:29.000000000 +0000 @@ -1024,6 +1024,13 @@ g = (int)((float)g * c); b = (int)((float)b * c); } + r = (r < 0) ? 0 : r; + g = (g < 0) ? 0 : g; + b = (b < 0) ? 0 : b; + + r = (r > 255) ? 255 : r; + g = (g > 255) ? 255 : g; + b = (b > 255) ? 255 : b; } /*
