11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
20PROMEKI_NAMESPACE_BEGIN
63class MasteringDisplay {
65 PROMEKI_DATATYPE(MasteringDisplay, DataTypeMasteringDisplay, 1)
68 Error writeToStream(DataStream &s) const;
70 template <uint32_t V> static Result<MasteringDisplay> readFromStream(DataStream &s);
72 static const MasteringDisplay HDR10;
74 MasteringDisplay() = default;
76 MasteringDisplay(const CIEPoint &red, const CIEPoint &green, const CIEPoint &blue, const CIEPoint &wp,
77 double minLum,
double maxLum)
78 : _red(red), _green(green), _blue(blue), _whitePoint(wp), _minLum(minLum), _maxLum(maxLum) {}
80 bool isValid()
const {
81 return _red.isValid() && _green.isValid() && _blue.isValid() && _whitePoint.isValid() &&
85 const CIEPoint &red()
const {
return _red; }
86 const CIEPoint &green()
const {
return _green; }
87 const CIEPoint &blue()
const {
return _blue; }
88 const CIEPoint &whitePoint()
const {
return _whitePoint; }
89 double minLuminance()
const {
return _minLum; }
90 double maxLuminance()
const {
return _maxLum; }
92 void setRed(
const CIEPoint &v) { _red = v; }
93 void setGreen(
const CIEPoint &v) { _green = v; }
94 void setBlue(
const CIEPoint &v) { _blue = v; }
95 void setWhitePoint(
const CIEPoint &v) { _whitePoint = v; }
96 void setMinLuminance(
double v) { _minLum = v; }
97 void setMaxLuminance(
double v) { _maxLum = v; }
99 bool operator==(
const MasteringDisplay &o)
const {
100 return _red.data() == o._red.data() && _green.data() == o._green.data() &&
101 _blue.data() == o._blue.data() && _whitePoint.data() == o._whitePoint.data() &&
102 _minLum == o._minLum && _maxLum == o._maxLum;
104 bool operator!=(
const MasteringDisplay &o)
const {
return !(*
this == o); }
106 String toString()
const;
112 CIEPoint _whitePoint;
113 double _minLum = 0.0;
114 double _maxLum = 0.0;