def test_nan_eotf_reverse_BT1886(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_1886.\ eotf_reverse_BT1886` definition nan support. """ eotf_reverse_BT1886( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_nan_eotf_reverse_BT1886(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_1886.\ eotf_reverse_BT1886` definition nan support. """ eotf_reverse_BT1886(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_eotf_reverse_BT1886(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_1886.\ eotf_reverse_BT1886` definition. """ self.assertAlmostEqual(eotf_reverse_BT1886(0.0), 0.0, places=7) self.assertAlmostEqual( eotf_reverse_BT1886(0.016317514686316), 0.18, places=7) self.assertAlmostEqual(eotf_reverse_BT1886(1.0), 1.0, places=7)
def test_eotf_reverse_BT1886(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_1886.\ eotf_reverse_BT1886` definition. """ self.assertAlmostEqual(eotf_reverse_BT1886(0.0), 0.0, places=7) self.assertAlmostEqual( eotf_reverse_BT1886(0.016317514686316), 0.18, places=7) self.assertAlmostEqual(eotf_reverse_BT1886(1.0), 1.0, places=7)
def test_domain_range_scale_eotf_reverse_BT1886(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_1886.\ eotf_reverse_BT1886` definition domain and range scale support. """ L = 0.18 V = eotf_reverse_BT1886(L) d_r = (('reference', 1), (1, 1), (100, 100)) for scale, factor in d_r: with domain_range_scale(scale): np.testing.assert_almost_equal( eotf_reverse_BT1886(L * factor), V * factor, decimal=7)
def test_domain_range_scale_eotf_reverse_BT1886(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_1886.\ eotf_reverse_BT1886` definition domain and range scale support. """ L = 0.18 V = eotf_reverse_BT1886(L) d_r = (('reference', 1), (1, 1), (100, 100)) for scale, factor in d_r: with domain_range_scale(scale): np.testing.assert_almost_equal(eotf_reverse_BT1886(L * factor), V * factor, decimal=7)
def ootf_reverse_BT2100_PQ(F_D): """ Defines *Recommendation ITU-R BT.2100* *Reference PQ* reverse opto-optical transfer function (OOTF / OOCF). Parameters ---------- F_D : numeric or array_like :math:`F_D` is the luminance of a displayed linear component (:math:`R_D`, :math:`G_D`, :math:`B_D`; :math:`Y_D`; or :math:`I_D`). Returns ------- numeric or ndarray :math:`E = {R_S, G_S, B_S; Y_S; or I_S}` is the signal determined by scene light and scaled by camera exposure. The values :math:`E`, :math:`R_S`, :math:`G_S`, :math:`B_S`, :math:`Y_S`, :math:`I_S` are in the range [0, 1]. References ---------- - :cite:`Borer2017a` - :cite:`InternationalTelecommunicationUnion2016a` Examples -------- >>> ootf_reverse_BT2100_PQ(779.988360834115840) # doctest: +ELLIPSIS 0.1000000... """ F_D = np.asarray(F_D) return oetf_reverse_BT709(eotf_reverse_BT1886(F_D / 100)) / 59.5208
def test_n_dimensional_eotf_reverse_BT1886(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_1886.\ eotf_reverse_BT1886` definition n-dimensional arrays support. """ L = 0.016317514686316 V = eotf_reverse_BT1886(L) L = np.tile(L, 6) V = np.tile(V, 6) np.testing.assert_almost_equal(eotf_reverse_BT1886(L), V, decimal=7) L = np.reshape(L, (2, 3)) V = np.reshape(V, (2, 3)) np.testing.assert_almost_equal(eotf_reverse_BT1886(L), V, decimal=7) L = np.reshape(L, (2, 3, 1)) V = np.reshape(V, (2, 3, 1)) np.testing.assert_almost_equal(eotf_reverse_BT1886(L), V, decimal=7)
def test_n_dimensional_eotf_reverse_BT1886(self): """ Tests :func:`colour.models.rgb.transfer_functions.itur_bt_1886.\ eotf_reverse_BT1886` definition n-dimensional arrays support. """ L = 0.016317514686316 V = eotf_reverse_BT1886(L) L = np.tile(L, 6) V = np.tile(V, 6) np.testing.assert_almost_equal(eotf_reverse_BT1886(L), V, decimal=7) L = np.reshape(L, (2, 3)) V = np.reshape(V, (2, 3)) np.testing.assert_almost_equal(eotf_reverse_BT1886(L), V, decimal=7) L = np.reshape(L, (2, 3, 1)) V = np.reshape(V, (2, 3, 1)) np.testing.assert_almost_equal(eotf_reverse_BT1886(L), V, decimal=7)
def ootf_reverse_BT2100_PQ(F_D): """ Defines *Recommendation ITU-R BT.2100* *Reference PQ* reverse opto-optical transfer function (OOTF / OOCF). Parameters ---------- F_D : numeric or array_like :math:`F_D` is the luminance of a displayed linear component (:math:`R_D`, :math:`G_D`, :math:`B_D`; :math:`Y_D`; or :math:`I_D`). Returns ------- numeric or ndarray :math:`E = {R_S, G_S, B_S; Y_S; or I_S}` is the signal determined by scene light and scaled by camera exposure. Notes ----- +------------+-----------------------+---------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +============+=======================+===============+ | ``F_D`` | [0, 1] | [0, 1] | +------------+-----------------------+---------------+ +------------+-----------------------+---------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +============+=======================+===============+ | ``E`` | [0, 1] | [0, 1] | +------------+-----------------------+---------------+ References ---------- :cite:`Borer2017a`, :cite:`InternationalTelecommunicationUnion2016a` Examples -------- >>> ootf_reverse_BT2100_PQ(779.988360834115840) # doctest: +ELLIPSIS 0.1000000... """ F_D = as_float_array(F_D) return oetf_reverse_BT709(eotf_reverse_BT1886(F_D / 100)) / 59.5208