diff options
author | 2023-02-13 10:19:08 -0500 | |
---|---|---|
committer | 2023-02-13 20:32:36 -0500 | |
commit | feec2c60b201ea4ff65244c6d65f08acc9796a9f (patch) | |
tree | 633021784893379e73cf1196e3c1cb2e00a72283 | |
parent | 8a878356682afb9801816785ab7ade6f68384108 (diff) |
Add ASurfaceTransaction_setExtendedRangeBrightness
Bug: 241001465
Test: make / silkfx demo
Change-Id: I043474aeda46a65ac93c124d854d71e1a8c082c9
-rw-r--r-- | include/android/surface_control.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/android/surface_control.h b/include/android/surface_control.h index f76e73d3cf..79c59f28fb 100644 --- a/include/android/surface_control.h +++ b/include/android/surface_control.h @@ -521,6 +521,45 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio __INTRODUCED_IN(29); /** + * Sets the desired extended range brightness for the layer. This only applies for layers whose + * dataspace has RANGE_EXTENDED set on it. + * + * @param surface_control The layer whose extended range brightness is being specified + * @param currentBufferRatio The current hdr/sdr ratio of the current buffer as represented as + * peakHdrBrightnessInNits / targetSdrWhitePointInNits. For example if the + * buffer was rendered with a target SDR whitepoint of 100nits and a max + * display brightness of 200nits, this should be set to 2.0f. + * + * Default value is 1.0f. + * + * Transfer functions that encode their own brightness ranges, such as + * HLG or PQ, should also set this to 1.0f and instead communicate + * extended content brightness information via metadata such as CTA861_3 + * or SMPTE2086. + * + * Must be finite && >= 1.0f + * + * @param desiredRatio The desired hdr/sdr ratio as represented as peakHdrBrightnessInNits / + * targetSdrWhitePointInNits. This can be used to communicate the max desired + * brightness range. This is similar to the "max luminance" value in other + * HDR metadata formats, but represented as a ratio of the target SDR whitepoint + * to the max display brightness. The system may not be able to, or may choose + * not to, deliver the requested range. + * + * If unspecified, the system will attempt to provide the best range it can + * for the given ambient conditions & device state. However, voluntarily + * reducing the requested range can help improve battery life as well as can + * improve quality by ensuring greater bit depth is allocated to the luminance + * range in use. + * + * Must be finite && >= 1.0f + */ +void ASurfaceTransaction_setExtendedRangeBrightness(ASurfaceTransaction* transaction, + ASurfaceControl* surface_control, + float currentBufferRatio, + float desiredRatio) __INTRODUCED_IN(__ANDROID_API_U__); + +/** * Same as ASurfaceTransaction_setFrameRateWithChangeStrategy(transaction, surface_control, * frameRate, compatibility, ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS). * |