Merge "Update gainmap documentation." into udc-dev am: 19573fe42d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21701716

Change-Id: I56365c0469bb4e547ac21814a2a8f5148595189e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2023-03-02 18:04:23 +00:00
committed by Automerger Merge Worker

View File

@@ -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 {