We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd43ca5 commit 776b4e4Copy full SHA for 776b4e4
src/algorithms/common.jl
@@ -19,6 +19,7 @@ end
19
20
function build_lookup(cdf, minval::T, maxval::T) where T
21
first_cdf = first(cdf)
22
+ # Scale the new intensity value to so that it lies in the range [minval, maxval].
23
scale = (maxval - minval) / (cdf[end] - first_cdf)
24
if T <: Integer
25
return T[ceil(minval + (x - first_cdf) * scale) for x in cdf]
0 commit comments