libjxl

FORK: libjxl patches used on blog
git clone https://git.neptards.moe/blog/libjxl.git
Log | Files | Refs | Submodules | README | LICENSE

luminance.cc (711B)


      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 void SetIntensityTarget(ImageMetadata* m) {
     13   if (m->color_encoding.Tf().IsPQ()) {
     14     // Peak luminance of PQ as defined by SMPTE ST 2084:2014.
     15     m->SetIntensityTarget(10000);
     16   } 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     m->SetIntensityTarget(1000);
     20   } else {
     21     // SDR
     22     m->SetIntensityTarget(kDefaultIntensityTarget);
     23   }
     24 }
     25 
     26 }  // namespace jxl