/src/libjxl/lib/jxl/luminance.cc
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) the JPEG XL Project Authors. All rights reserved. |
2 | | // |
3 | | // Use of this source code is governed by a BSD-style |
4 | | // license that can be found in the LICENSE file. |
5 | | |
6 | | #include "lib/jxl/luminance.h" |
7 | | |
8 | | #include "lib/jxl/base/common.h" |
9 | | #include "lib/jxl/image_metadata.h" |
10 | | |
11 | | namespace jxl { |
12 | | |
13 | 217 | void SetIntensityTarget(ImageMetadata* m) { |
14 | 217 | if (m->color_encoding.Tf().IsPQ()) { |
15 | | // Peak luminance of PQ as defined by SMPTE ST 2084:2014. |
16 | 0 | m->SetIntensityTarget(10000); |
17 | 217 | } else if (m->color_encoding.Tf().IsHLG()) { |
18 | | // Nominal display peak luminance used as a reference by |
19 | | // Rec. ITU-R BT.2100-2. |
20 | 0 | m->SetIntensityTarget(1000); |
21 | 217 | } else { |
22 | | // SDR |
23 | 217 | m->SetIntensityTarget(kDefaultIntensityTarget); |
24 | 217 | } |
25 | 217 | } |
26 | | |
27 | | } // namespace jxl |