diff options
author | Leo Izen <leo.izen@gmail.com> | 2023-08-16 00:54:36 -0400 |
---|---|---|
committer | Leo Izen <leo.izen@gmail.com> | 2023-08-17 07:42:58 -0400 |
commit | 7098bec73bd3de63f514ba6ec091fd2f5096ddce (patch) | |
tree | 6b2e84077097d4f82d901d80e072b8c40f45e1eb /libavcodec/exr.c | |
parent | 9ae4863cc57c38fa2f41f3b8c732fede4a2b78c6 (diff) |
avcodec/exr: tag gamma=1.0 output as linear light
By default the OpenEXR decoder outputs linear light pixel data by
applying a gamma=1.0 transfer (i.e. a no-op). When it does so, it
should tag the data as linear so color-managed filters or other tools
can work with it correctly.
Signed-off-by: Leo Izen <leo.izen@gmail.com>
Diffstat (limited to 'libavcodec/exr.c')
-rw-r--r-- | libavcodec/exr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c index fae1d08ab0..518066facf 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -2088,6 +2088,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, if (s->apply_trc_type != AVCOL_TRC_UNSPECIFIED) avctx->color_trc = s->apply_trc_type; + else if (s->gamma > 0.9999f && s->gamma < 1.0001f) + avctx->color_trc = AVCOL_TRC_LINEAR; switch (s->compression) { case EXR_RAW: |