Commit 2a803755 authored by William Skaggs's avatar William Skaggs
Browse files

Bill Skaggs <weskaggs@primate.ucdavis.edu>

	* plug-ins/common/decompose.c: clamp results of LAB decomposition
	so that out-of-gamut conversions do not overflow and get
	badly distorted.  Fixes bug #147603.  Note that it would probably
	be a good idea to do similar things for other conversion types.
parent 5658cb1a
2004-07-25 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* plug-ins/common/decompose.c: clamp results of LAB decomposition
so that out-of-gamut conversions do not overflow and get
badly distorted. Fixes bug #147603. Note that it would probably
be a good idea to do similar things for other conversion types.
2004-07-25 Shlomi Fish <shlomif@iglu.org.il>
* plug-ins/gimpressionist/: converted checks for initialization of
......
......@@ -1043,9 +1043,9 @@ extract_lab (guchar *src,
ftx = ((tx = x/Xn) > 0.008856) ? cbrt (tx) : 7.78 * tx + sixteenth;
ftz = ((tz = z/Zn) > 0.008856) ? cbrt (tz) : 7.78 * tz + sixteenth;
*l_dst++ = (guchar) (l * 2.5599);
*a_dst++ = (guchar) (128.0 + (ftx - fty) * 635 );
*b_dst++ = (guchar) (128.0 + (fty - ftz) * 254 );
*l_dst++ = (guchar) CLAMP (l * 2.5599, 0., 256.);
*a_dst++ = (guchar) CLAMP (128.0 + (ftx - fty) * 635, 0., 256.);
*b_dst++ = (guchar) CLAMP (128.0 + (fty - ftz) * 254, 0., 256.);
rgb_src += offset;
}
......
Markdown is supported
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