コード例 #1
0
    def test_nan_eotf_BT2100_HLG(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
eotf_BT2100_HLG` definition nan support.
        """

        eotf_BT2100_HLG(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
コード例 #2
0
    def test_nan_eotf_BT2100_HLG(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
eotf_BT2100_HLG` definition nan support.
        """

        eotf_BT2100_HLG(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
コード例 #3
0
    def test_domain_range_scale_eotf_BT2100_HLG(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
eotf_BT2100_HLG` definition domain and range scale support.
        """

        E_p = 0.212132034355964
        F_D = eotf_BT2100_HLG(E_p)

        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_BT2100_HLG(E_p * factor), F_D * factor, decimal=7)
コード例 #4
0
    def test_domain_range_scale_eotf_BT2100_HLG(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
eotf_BT2100_HLG` definition domain and range scale support.
        """

        E_p = 0.212132034355964
        F_D = eotf_BT2100_HLG(E_p)

        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_BT2100_HLG(E_p * factor),
                                               F_D * factor,
                                               decimal=7)
コード例 #5
0
    def test_eotf_BT2100_HLG(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
eotf_BT2100_HLG` definition.
        """

        self.assertAlmostEqual(eotf_BT2100_HLG(0.0), 0.0, places=7)

        self.assertAlmostEqual(
            eotf_BT2100_HLG(0.212132034355964), 6.476039825649814, places=7)

        self.assertAlmostEqual(
            eotf_BT2100_HLG(1.0), 1000.000029239784300, places=7)

        self.assertAlmostEqual(
            eotf_BT2100_HLG(0.212132034355964, 0.001, 10000, 1.4),
            27.96039175299561,
            places=7)
コード例 #6
0
    def test_eotf_BT2100_HLG(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
eotf_BT2100_HLG` definition.
        """

        self.assertAlmostEqual(eotf_BT2100_HLG(0.0), 0.0, places=7)

        self.assertAlmostEqual(eotf_BT2100_HLG(0.212132034355964),
                               6.476039825649814,
                               places=7)

        self.assertAlmostEqual(eotf_BT2100_HLG(1.0),
                               1000.000029239784300,
                               places=7)

        self.assertAlmostEqual(eotf_BT2100_HLG(0.212132034355964, 0.001, 10000,
                                               1.4),
                               27.96039175299561,
                               places=7)
コード例 #7
0
    def test_n_dimensional_eotf_BT2100_HLG(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
eotf_BT2100_HLG` definition n-dimensional arrays support.
        """

        E_p = 0.212132034355964
        F_D = 6.476039825649814
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.tile(E_p, 6)
        F_D = np.tile(F_D, 6)
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.reshape(E_p, (2, 3))
        F_D = np.reshape(F_D, (2, 3))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.reshape(E_p, (2, 3, 1))
        F_D = np.reshape(F_D, (2, 3, 1))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.reshape(E_p, (6, 1))
        F_D = np.reshape(F_D, (6, 1))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.array([0.25, 0.50, 0.75])
        F_D = np.array([12.49759412, 49.99037650, 158.94693746])
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.tile(E_p, (6, 1))
        F_D = np.tile(F_D, (6, 1))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.reshape(E_p, (2, 3, 3))
        F_D = np.reshape(F_D, (2, 3, 3))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)
コード例 #8
0
    def test_n_dimensional_eotf_BT2100_HLG(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
eotf_BT2100_HLG` definition n-dimensional arrays support.
        """

        E_p = 0.212132034355964
        F_D = eotf_BT2100_HLG(E_p)

        E_p = np.tile(E_p, 6)
        F_D = np.tile(F_D, 6)
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.reshape(E_p, (2, 3))
        F_D = np.reshape(F_D, (2, 3))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.reshape(E_p, (2, 3, 1))
        F_D = np.reshape(F_D, (2, 3, 1))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.reshape(E_p, (6, 1))
        F_D = np.reshape(F_D, (6, 1))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.array([0.25, 0.50, 0.75])
        F_D = np.array([12.49759412, 49.99037650, 158.94693746])
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.tile(E_p, (6, 1))
        F_D = np.tile(F_D, (6, 1))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)

        E_p = np.reshape(E_p, (2, 3, 3))
        F_D = np.reshape(F_D, (2, 3, 3))
        np.testing.assert_almost_equal(eotf_BT2100_HLG(E_p), F_D, decimal=7)