Example #1
0
    def test_n_dimensional_oetf_inverse_ARIBSTDB67(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
oetf_inverse_ARIBSTDB67` definition n-dimensional arrays support.
        """

        E_p = 0.212132034355964
        E = oetf_inverse_ARIBSTDB67(E_p)

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

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

        E_p = np.reshape(E_p, (2, 3, 1))
        E = np.reshape(E, (2, 3, 1))
        np.testing.assert_almost_equal(oetf_inverse_ARIBSTDB67(E_p),
                                       E,
                                       decimal=7)
Example #2
0
    def test_nan_oetf_inverse_ARIBSTDB67(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
oetf_inverse_ARIBSTDB67` definition nan support.
        """

        oetf_inverse_ARIBSTDB67(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Example #3
0
    def test_domain_range_scale_oetf_inverse_ARIBSTDB67(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
oetf_inverse_ARIBSTDB67` definition domain and range scale support.
        """

        E_p = 0.212132034355964
        E = oetf_inverse_ARIBSTDB67(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(oetf_inverse_ARIBSTDB67(E_p *
                                                                       factor),
                                               E * factor,
                                               decimal=7)
Example #4
0
    def test_oetf_inverse_ARIBSTDB67(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.arib_std_b67.\
oetf_inverse_ARIBSTDB67` definition.
        """

        self.assertAlmostEqual(oetf_inverse_ARIBSTDB67(-0.25), -0.25, places=7)

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

        self.assertAlmostEqual(oetf_inverse_ARIBSTDB67(0.212132034355964),
                               0.18,
                               places=7)

        self.assertAlmostEqual(oetf_inverse_ARIBSTDB67(0.5), 1.0, places=7)

        self.assertAlmostEqual(oetf_inverse_ARIBSTDB67(1.302858098046995),
                               64.0,
                               places=7)