def test_nan_oetf_reverse_BT601(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_601.\ oetf_reverse_BT601` definition nan support. """ oetf_reverse_BT601(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_nan_oetf_reverse_BT601(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_601.\ oetf_reverse_BT601` definition nan support. """ oetf_reverse_BT601(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_domain_range_scale_oetf_reverse_BT601(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_601.\ oetf_reverse_BT601` definition domain and range scale support. """ E = 0.409007728864150 L = oetf_reverse_BT601(E) 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_reverse_BT601(E * factor), L * factor, decimal=7)
def test_domain_range_scale_oetf_reverse_BT601(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_601.\ oetf_reverse_BT601` definition domain and range scale support. """ E = 0.409007728864150 L = oetf_reverse_BT601(E) 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_reverse_BT601(E * factor), L * factor, decimal=7)
def test_oetf_reverse_BT601(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_601.\ oetf_reverse_BT601` definition. """ self.assertAlmostEqual(oetf_reverse_BT601(0.0), 0.0, places=7) self.assertAlmostEqual( oetf_reverse_BT601(0.067500000000000), 0.015, places=7) self.assertAlmostEqual( oetf_reverse_BT601(0.409007728864150), 0.18, places=7) self.assertAlmostEqual(oetf_reverse_BT601(1.0), 1.0, places=7)
def test_oetf_reverse_BT601(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_601.\ oetf_reverse_BT601` definition. """ self.assertAlmostEqual(oetf_reverse_BT601(0.0), 0.0, places=7) self.assertAlmostEqual( oetf_reverse_BT601(0.067500000000000), 0.015, places=7) self.assertAlmostEqual( oetf_reverse_BT601(0.409007728864150), 0.18, places=7) self.assertAlmostEqual(oetf_reverse_BT601(1.0), 1.0, places=7)
def oetf_reverse_BT709(V): """ Defines *Recommendation ITU-R BT.709-6* reverse opto-electronic transfer function (OETF / OECF). Parameters ---------- V : numeric or array_like Electrical signal :math:`V`. Returns ------- numeric or ndarray Corresponding *luminance* :math:`L` of the image. References ---------- - :cite:`InternationalTelecommunicationUnion2015i` Examples -------- >>> oetf_reverse_BT709(0.409007728864150) # doctest: +ELLIPSIS 0.1... """ return oetf_reverse_BT601(V)
def test_n_dimensional_oetf_reverse_BT601(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_601.\ oetf_reverse_BT601` definition n-dimensional arrays support. """ E = 0.409007728864150 L = oetf_reverse_BT601(E) E = np.tile(E, 6) L = np.tile(L, 6) np.testing.assert_almost_equal(oetf_reverse_BT601(E), L, decimal=7) E = np.reshape(E, (2, 3)) L = np.reshape(L, (2, 3)) np.testing.assert_almost_equal(oetf_reverse_BT601(E), L, decimal=7) E = np.reshape(E, (2, 3, 1)) L = np.reshape(L, (2, 3, 1)) np.testing.assert_almost_equal(oetf_reverse_BT601(E), L, decimal=7)
def oetf_reverse_BT709(V): """ Defines *Recommendation ITU-R BT.709-6* reverse opto-electronic transfer function (OETF / OECF). Parameters ---------- V : numeric or array_like Electrical signal :math:`V`. Returns ------- numeric or ndarray Corresponding *luminance* :math:`L` of the image. Notes ----- +------------+-----------------------+---------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +============+=======================+===============+ | ``V`` | [0, 1] | [0, 1] | +------------+-----------------------+---------------+ +------------+-----------------------+---------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +============+=======================+===============+ | ``L`` | [0, 1] | [0, 1] | +------------+-----------------------+---------------+ References ---------- :cite:`InternationalTelecommunicationUnion2015i` Examples -------- >>> oetf_reverse_BT709(0.409007728864150) # doctest: +ELLIPSIS 0.1... """ return oetf_reverse_BT601(V)