45 using std::shared_ptr;
46 using std::dynamic_pointer_cast;
53 int const bit_length = int(std::pow(2.0f, bit_depth));
54 double*
lut =
new double[bit_length];
56 for (
int i = 0; i < bit_length; ++i) {
57 auto const p =
static_cast<double>(i) / (bit_length - 1);
58 if (p >= (0.01125 / 1023)) {
59 lut[i] = (420 + log10((p + 0.01) / (0.18 + 0.01)) * 261.5) / 1023;
61 lut[i] = (p * (171.2102946929 - 95) / 0.01125000 + 95) / 1023;
65 for (
int i = 0; i < bit_length; ++i) {
66 auto const p =
static_cast<double>(i) / (bit_length - 1);
67 if (p >= (171.2102946929 / 1023)) {
68 lut[i] = pow(10, ((p * 1023 - 420) / 261.5)) * (0.18 + 0.01) - 0.01;
70 lut[i] = (p * 1023 - 95) * 0.01125000 / (171.2102946929 - 95);
79 SGamut3TransferFunction::about_equal (shared_ptr<const TransferFunction> other,
double)
const
81 auto o = dynamic_pointer_cast<const SGamut3TransferFunction> (other);
82 return static_cast<bool> (o);
double * make_lut(int bit_depth, bool inverse) const override
double const * lut(int bit_depth, bool inverse) const
Namespace for everything in libdcp.
SGamut3TransferFunction class.