def test_n_dimensional_log_decoding_TLog(self):
        """
        Test :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\
log_decoding_FilmLightTLog` definition n-dimensional arrays support.
        """

        t = 0.396567801298332
        x = log_decoding_FilmLightTLog(t)

        t = np.tile(t, 6)
        x = np.tile(x, 6)
        np.testing.assert_almost_equal(log_decoding_FilmLightTLog(t),
                                       x,
                                       decimal=7)

        t = np.reshape(t, (2, 3))
        x = np.reshape(x, (2, 3))
        np.testing.assert_almost_equal(log_decoding_FilmLightTLog(t),
                                       x,
                                       decimal=7)

        t = np.reshape(t, (2, 3, 1))
        x = np.reshape(x, (2, 3, 1))
        np.testing.assert_almost_equal(log_decoding_FilmLightTLog(t),
                                       x,
                                       decimal=7)
    def test_nan_log_decoding_TLog(self):
        """
        Test :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\
log_decoding_FilmLightTLog` definition nan support.
        """

        log_decoding_FilmLightTLog(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
    def test_nan_log_decoding_TLog(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\
log_decoding_FilmLightTLog` definition nan support.
        """

        log_decoding_FilmLightTLog(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
    def test_log_decoding_FilmLightTLog(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\
log_decoding_FilmLightTLog` definition.
        """

        self.assertAlmostEqual(
            log_decoding_FilmLightTLog(0.075), 0.0, places=7)

        self.assertAlmostEqual(
            log_decoding_FilmLightTLog(0.396567801298332), 0.18, places=7)

        self.assertAlmostEqual(
            log_decoding_FilmLightTLog(0.552537881005859), 1.0, places=7)
Example #5
0
    def test_domain_range_scale_log_decoding_TLog(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\
log_decoding_FilmLightTLog` definition domain and range scale support.
        """

        t = 0.396567801298332
        x = log_decoding_FilmLightTLog(t)

        d_r = (('reference', 1), (1, 1), (100, 100))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(log_decoding_FilmLightTLog(
                    t * factor),
                                               x * factor,
                                               decimal=7)
    def test_domain_range_scale_log_decoding_TLog(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\
log_decoding_FilmLightTLog` definition domain and range scale support.
        """

        t = 0.396567801298332
        x = log_decoding_FilmLightTLog(t)

        d_r = (('reference', 1), (1, 1), (100, 100))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(
                    log_decoding_FilmLightTLog(t * factor),
                    x * factor,
                    decimal=7)
    def test_log_decoding_FilmLightTLog(self):
        """
        Test :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\
log_decoding_FilmLightTLog` definition.
        """

        self.assertAlmostEqual(log_decoding_FilmLightTLog(0.075),
                               0.0,
                               places=7)

        self.assertAlmostEqual(log_decoding_FilmLightTLog(0.396567801298332),
                               0.18,
                               places=7)

        self.assertAlmostEqual(log_decoding_FilmLightTLog(0.552537881005859),
                               1.0,
                               places=7)
    def test_n_dimensional_log_decoding_TLog(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\
log_decoding_FilmLightTLog` definition n-dimensional arrays support.
        """

        t = 0.396567801298332
        x = log_decoding_FilmLightTLog(t)

        t = np.tile(t, 6)
        x = np.tile(x, 6)
        np.testing.assert_almost_equal(
            log_decoding_FilmLightTLog(t), x, decimal=7)

        t = np.reshape(t, (2, 3))
        x = np.reshape(x, (2, 3))
        np.testing.assert_almost_equal(
            log_decoding_FilmLightTLog(t), x, decimal=7)

        t = np.reshape(t, (2, 3, 1))
        x = np.reshape(x, (2, 3, 1))
        np.testing.assert_almost_equal(
            log_decoding_FilmLightTLog(t), x, decimal=7)