Exemplo n.º 1
0
    def test_nan_eotf_SMPTE240M(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.smpte_240m.\
eotf_SMPTE240M` definition nan support.
        """

        eotf_SMPTE240M(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Exemplo n.º 2
0
    def test_domain_range_scale_eotf_SMPTE240M(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.smpte_240m.\
eotf_SMPTE240M` definition domain and range scale support.
        """

        V_r = 0.402285796753870
        L_r = eotf_SMPTE240M(V_r)

        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_SMPTE240M(V_r * factor),
                                               L_r * factor,
                                               decimal=7)
Exemplo n.º 3
0
    def test_eotf_SMPTE240M(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.smpte_240m.\
eotf_SMPTE240M` definition.
        """

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

        self.assertAlmostEqual(eotf_SMPTE240M(0.080000000000000),
                               0.02,
                               places=7)

        self.assertAlmostEqual(eotf_SMPTE240M(0.402285796753870),
                               0.18,
                               places=7)

        self.assertAlmostEqual(eotf_SMPTE240M(1.0), 1.0, places=7)
Exemplo n.º 4
0
    def test_n_dimensional_eotf_SMPTE240M(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.smpte_240m.\
eotf_SMPTE240M` definition n-dimensional arrays support.
        """

        V_r = 0.402285796753870
        L_r = eotf_SMPTE240M(V_r)

        V_r = np.tile(V_r, 6)
        L_r = np.tile(L_r, 6)
        np.testing.assert_almost_equal(eotf_SMPTE240M(V_r), L_r, decimal=7)

        V_r = np.reshape(V_r, (2, 3))
        L_r = np.reshape(L_r, (2, 3))
        np.testing.assert_almost_equal(eotf_SMPTE240M(V_r), L_r, decimal=7)

        V_r = np.reshape(V_r, (2, 3, 1))
        L_r = np.reshape(L_r, (2, 3, 1))
        np.testing.assert_almost_equal(eotf_SMPTE240M(V_r), L_r, decimal=7)