Пример #1
0
    def test_nan_oetf_BT2100_PQ(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
oetf_BT2100_PQ` definition nan support.
        """

        oetf_BT2100_PQ(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Пример #2
0
    def test_nan_oetf_BT2100_PQ(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
oetf_BT2100_PQ` definition nan support.
        """

        oetf_BT2100_PQ(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Пример #3
0
    def test_domain_range_scale_oetf_BT2100_PQ(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
oetf_BT2100_PQ` definition domain and range scale support.
        """

        E = 0.1
        E_p = oetf_BT2100_PQ(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_BT2100_PQ(E * factor), E_p * factor, decimal=7)
Пример #4
0
    def test_oetf_BT2100_PQ(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
oetf_BT2100_PQ` definition.
        """

        self.assertAlmostEqual(
            oetf_BT2100_PQ(0.0), 0.000000730955903, places=7)

        self.assertAlmostEqual(
            oetf_BT2100_PQ(0.1), 0.724769816665726, places=7)

        self.assertAlmostEqual(
            oetf_BT2100_PQ(1.0), 0.999999934308041, places=7)
Пример #5
0
    def test_domain_range_scale_oetf_BT2100_PQ(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
oetf_BT2100_PQ` definition domain and range scale support.
        """

        E = 0.1
        E_p = oetf_BT2100_PQ(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_BT2100_PQ(E * factor),
                                               E_p * factor,
                                               decimal=7)
Пример #6
0
    def test_oetf_BT2100_PQ(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
oetf_BT2100_PQ` definition.
        """

        self.assertAlmostEqual(oetf_BT2100_PQ(0.0),
                               0.000000730955903,
                               places=7)

        self.assertAlmostEqual(oetf_BT2100_PQ(0.1),
                               0.724769816665726,
                               places=7)

        self.assertAlmostEqual(oetf_BT2100_PQ(1.0),
                               0.999999934308041,
                               places=7)
Пример #7
0
    def test_n_dimensional_oetf_BT2100_PQ(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
oetf_BT2100_PQ` definition n-dimensional arrays support.
        """

        E = 0.1
        E_p = oetf_BT2100_PQ(E)

        E = np.tile(E, 6)
        E_p = np.tile(E_p, 6)
        np.testing.assert_almost_equal(oetf_BT2100_PQ(E), E_p, decimal=7)

        E = np.reshape(E, (2, 3))
        E_p = np.reshape(E_p, (2, 3))
        np.testing.assert_almost_equal(oetf_BT2100_PQ(E), E_p, decimal=7)

        E = np.reshape(E, (2, 3, 1))
        E_p = np.reshape(E_p, (2, 3, 1))
        np.testing.assert_almost_equal(oetf_BT2100_PQ(E), E_p, decimal=7)
Пример #8
0
    def test_n_dimensional_oetf_BT2100_PQ(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.itur_bt_2100.\
oetf_BT2100_PQ` definition n-dimensional arrays support.
        """

        E = 0.1
        E_p = oetf_BT2100_PQ(E)

        E = np.tile(E, 6)
        E_p = np.tile(E_p, 6)
        np.testing.assert_almost_equal(oetf_BT2100_PQ(E), E_p, decimal=7)

        E = np.reshape(E, (2, 3))
        E_p = np.reshape(E_p, (2, 3))
        np.testing.assert_almost_equal(oetf_BT2100_PQ(E), E_p, decimal=7)

        E = np.reshape(E, (2, 3, 1))
        E_p = np.reshape(E_p, (2, 3, 1))
        np.testing.assert_almost_equal(oetf_BT2100_PQ(E), E_p, decimal=7)