def test_nan_oetf_inverse_BT709(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_709.\ oetf_inverse_BT709` definition nan support. """ oetf_inverse_BT709(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_domain_range_scale_oetf_inverse_BT709(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_709.\ oetf_inverse_BT709` definition domain and range scale support. """ V = 0.409007728864150 L = oetf_inverse_BT709(V) d_r = (('reference', 1), (1, 1), (100, 100)) for scale, factor in d_r: with domain_range_scale(scale): np.testing.assert_almost_equal(oetf_inverse_BT709(V * factor), L * factor, decimal=7)
def test_oetf_inverse_BT709(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_709.\ oetf_inverse_BT709` definition. """ self.assertAlmostEqual(oetf_inverse_BT709(0.0), 0.0, places=7) self.assertAlmostEqual(oetf_inverse_BT709(0.067500000000000), 0.015, places=7) self.assertAlmostEqual(oetf_inverse_BT709(0.409007728864150), 0.18, places=7) self.assertAlmostEqual(oetf_inverse_BT709(1.0), 1.0, places=7)
def test_n_dimensional_oetf_inverse_BT709(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_709.\ oetf_inverse_BT709` definition n-dimensional arrays support. """ V = 0.409007728864150 L = oetf_inverse_BT709(V) V = np.tile(V, 6) L = np.tile(L, 6) np.testing.assert_almost_equal(oetf_inverse_BT709(V), L, decimal=7) V = np.reshape(V, (2, 3)) L = np.reshape(L, (2, 3)) np.testing.assert_almost_equal(oetf_inverse_BT709(V), L, decimal=7) V = np.reshape(V, (2, 3, 1)) L = np.reshape(L, (2, 3, 1)) np.testing.assert_almost_equal(oetf_inverse_BT709(V), L, decimal=7)