From: Robert L K. <rl...@al...> - 2005-06-30 11:29:44
|
From: "Stephen C. Tweedie" <sc...@ww...> Cc: "gim...@li..." <gim...@li...>, Stephen Tweedie <sc...@ww...> Date: Thu, 30 Jun 2005 11:55:52 +0100 Hi, On Thu, 2005-06-30 at 02:44, Robert L Krawitz wrote: > This works a treat and lets me get a decent GCR curve by setting the > transition to 0.5. Without the above change, a GCR transition < 1.0 > would make the K onset *more* abrupt, not less. > > OK, I'll check this in: > double where = (i - k_lower) / (k_upper - k_lower); > double g1 = pow(where, i_k_trans); > double g2 = 1.0 - pow(1.0 - where, k_trans); > ! double value = (i_k_trans <= 1.0 ? g1 : g2); > tmp_data[i] = 65535.0 * k_upper * value / (double) (lut->steps - 1); > tmp_data[i] = floor(tmp_data[i] + .5); > } btw, I just noticed that the GCR transition is clamped at 1.0 in the gimp plugin UI. Do we ever want it to go above that? If so, the upper bound needs relaxed; if not, then "g2" is actually redundant in the code as it is now. The clamp isn't in the UI, it's in the color code. I'm not quite sure what a value greater than 1 would mean. -- Robert Krawitz <rl...@al...> Tall Clubs International -- http://www.tall.org/ or 1-888-IM-TALL-2 Member of the League for Programming Freedom -- mail lp...@uu... Project lead for Gimp Print -- http://gimp-print.sourceforge.net "Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton |