Beispiel #1
0
    def test_nan_oetf_SMPTE240M(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.smpte_240m.\
oetf_SMPTE240M` definition nan support.
        """

        oetf_SMPTE240M(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Beispiel #2
0
    def test_domain_range_scale_oetf_SMPTE240M(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.smpte_240m.\
oetf_SMPTE240M` definition domain and range scale support.
        """

        L_c = 0.18
        V_c = oetf_SMPTE240M(L_c)

        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_SMPTE240M(L_c * factor),
                                               V_c * factor,
                                               decimal=7)
Beispiel #3
0
    def test_oetf_SMPTE240M(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.smpte_240m.\
oetf_SMPTE240M` definition.
        """

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

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

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

        self.assertAlmostEqual(oetf_SMPTE240M(1.0), 1.0, places=7)
Beispiel #4
0
    def test_n_dimensional_oetf_SMPTE240M(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.smpte_240m.\
oetf_SMPTE240M` definition n-dimensional arrays support.
        """

        L_c = 0.18
        V_c = oetf_SMPTE240M(L_c)

        L_c = np.tile(L_c, 6)
        V_c = np.tile(V_c, 6)
        np.testing.assert_almost_equal(oetf_SMPTE240M(L_c), V_c, decimal=7)

        L_c = np.reshape(L_c, (2, 3))
        V_c = np.reshape(V_c, (2, 3))
        np.testing.assert_almost_equal(oetf_SMPTE240M(L_c), V_c, decimal=7)

        L_c = np.reshape(L_c, (2, 3, 1))
        V_c = np.reshape(V_c, (2, 3, 1))
        np.testing.assert_almost_equal(oetf_SMPTE240M(L_c), V_c, decimal=7)