From 2ee3bb39b367161ecfc1dd24996306c410f8d0af Mon Sep 17 00:00:00 2001 From: zueuk Date: Mon, 25 Aug 2008 14:58:34 +0000 Subject: [PATCH] fixed apo/flam3 brightness difference --- 2.10/Source/ImageMaker.pas | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/2.10/Source/ImageMaker.pas b/2.10/Source/ImageMaker.pas index f8f96c1..b17022e 100644 --- a/2.10/Source/ImageMaker.pas +++ b/2.10/Source/ImageMaker.pas @@ -320,7 +320,10 @@ begin filterValue := FFilter[ii, jj]; bucket := GetBucket(bx + jj, by + ii); - ls := lsa[Min(1023, bucket.Count)]; + if bucket.count < 1024 then + ls := lsa[bucket.Count] + else + ls := (k1 * log10(1 + fcp.White_level * bucket.count * k2)) / (fcp.White_level * bucket.count); fp[0] := fp[0] + filterValue * ls * bucket.Red; fp[1] := fp[1] + filterValue * ls * bucket.Green; @@ -335,7 +338,10 @@ begin fp[3] := fcp.white_level * fp[3] / PREFILTER_WHITE; end else begin bucket := GetBucket(bx, by); - ls := lsa[Min(1023, bucket.count)] / PREFILTER_WHITE; + if bucket.count < 1024 then + ls := lsa[bucket.count] / PREFILTER_WHITE + else + ls := (k1 * log10(1 + fcp.White_level * bucket.count * k2)) / (fcp.White_level * bucket.count) / PREFILTER_WHITE; fp[0] := ls * bucket.Red; fp[1] := ls * bucket.Green;