diff options
| author | 2023-03-02 11:12:26 +0000 | |
|---|---|---|
| committer | 2023-03-02 15:43:19 +0000 | |
| commit | 7b7ea42ae6c642fddd484d44868a2fbdd04e222b (patch) | |
| tree | d54cc4c13a39065794ce4164c1265ee2a7922f03 | |
| parent | 6c31e64588916ff19bec0d0bac247302f4543e7d (diff) | |
Update gainmap documentation.
Fix formula for W.
Update names in the comments to match Android names.
Remove references to HDR base images (didn't make the cut).
Bug: 266628247
Change-Id: Ice5250dd18ed8255503f1b4c9b6d933d2472990e
| -rw-r--r-- | graphics/java/android/graphics/Gainmap.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/graphics/java/android/graphics/Gainmap.java b/graphics/java/android/graphics/Gainmap.java index a7c508c75ac9..feedb7d3e2bf 100644 --- a/graphics/java/android/graphics/Gainmap.java +++ b/graphics/java/android/graphics/Gainmap.java @@ -63,20 +63,20 @@ import libcore.util.NativeAllocationRegistry; * as follows: * * First, let W be a weight parameter determining how much the gainmap will be applied. - * W = clamp((log(H) - log(displayRatioHdr)) / - * (log(displayRatioHdr) - log(displayRatioSdr), 0, 1) + * W = clamp((log(H) - log(minDisplayRatioForHdrTransition)) / + * (log(displayRatioForFullHdr) - log(minDisplayRatioForHdrTransition), 0, 1) * * Next, let L be the gainmap value in log space. We compute this from the value G that was * sampled from the texture as follows: - * L = mix(log(gainmapRatioMin), log(gainmapRatioMax), pow(G, gainmapGamma)) + * L = mix(log(ratioMin), log(ratioMax), pow(G, gamma)) * * Finally, apply the gainmap to compute D, the displayed pixel. If the base image is SDR then * compute: * D = (B + epsilonSdr) * exp(L * W) - epsilonHdr - * If the base image is HDR then compute: - * D = (B + epsilonHdr) * exp(L * (W - 1)) - epsilonSdr * - * In the above math, log() is a natural logarithm and exp() is natural exponentiation. + * In the above math, log() is a natural logarithm and exp() is natural exponentiation. The base + * for these functions cancels out and does not affect the result, so other bases may be used + * if preferred. */ public final class Gainmap implements Parcelable { |