History

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.

Leo Izen committed 3 years ago

Commit 7098bec1 parent 9ae48631 file · +2 −0Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/exr.c+2−0
@@ -2088,6 +2088,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, · 2087 unmodified lines
20882088
20892089 if (s->apply_trc_type != AVCOL_TRC_UNSPECIFIED)
20902090 avctx->color_trc = s->apply_trc_type;
2091+ else if (s->gamma > 0.9999f && s->gamma < 1.0001f)
2092+ avctx->color_trc = AVCOL_TRC_LINEAR;
20912093
20922094 switch (s->compression) {
20932095 case EXR_RAW:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t