Coverage Report

Created: 2025-06-22 08:04

/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/image_metadata.h"
9
10
namespace jxl {
11
12
0
void SetIntensityTarget(ImageMetadata* m) {
13
0
  if (m->color_encoding.Tf().IsPQ()) {
14
    // Peak luminance of PQ as defined by SMPTE ST 2084:2014.
15
0
    m->SetIntensityTarget(10000);
16
0
  } else if (m->color_encoding.Tf().IsHLG()) {
17
    // Nominal display peak luminance used as a reference by
18
    // Rec. ITU-R BT.2100-2.
19
0
    m->SetIntensityTarget(1000);
20
0
  } else {
21
    // SDR
22
0
    m->SetIntensityTarget(kDefaultIntensityTarget);
23
0
  }
24
0
}
25
26
}  // namespace jxl