summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/ultrahdr/include/ultrahdr/ultrahdr.h1
-rw-r--r--libs/ultrahdr/jpegr.cpp5
2 files changed, 5 insertions, 1 deletions
diff --git a/libs/ultrahdr/include/ultrahdr/ultrahdr.h b/libs/ultrahdr/include/ultrahdr/ultrahdr.h
index 66f70889fb..0252391a86 100644
--- a/libs/ultrahdr/include/ultrahdr/ultrahdr.h
+++ b/libs/ultrahdr/include/ultrahdr/ultrahdr.h
@@ -30,6 +30,7 @@ typedef enum {
} ultrahdr_color_gamut;
// Transfer functions for image data
+// TODO: TF LINEAR is deprecated, remove this enum and the code surrounding it.
typedef enum {
ULTRAHDR_TF_UNSPECIFIED = -1,
ULTRAHDR_TF_LINEAR = 0,
diff --git a/libs/ultrahdr/jpegr.cpp b/libs/ultrahdr/jpegr.cpp
index dc439d785a..55333b347a 100644
--- a/libs/ultrahdr/jpegr.cpp
+++ b/libs/ultrahdr/jpegr.cpp
@@ -817,10 +817,13 @@ status_t JpegR::generateGainMap(jr_uncompressed_ptr yuv420_image_ptr,
map_data.reset(reinterpret_cast<uint8_t*>(dest->data));
ColorTransformFn hdrInvOetf = nullptr;
- float hdr_white_nits = kSdrWhiteNits;
+ float hdr_white_nits;
switch (hdr_tf) {
case ULTRAHDR_TF_LINEAR:
hdrInvOetf = identityConversion;
+ // Note: this will produce clipping if the input exceeds kHlgMaxNits.
+ // TODO: TF LINEAR will be deprecated.
+ hdr_white_nits = kHlgMaxNits;
break;
case ULTRAHDR_TF_HLG:
#if USE_HLG_INVOETF_LUT