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

        y = 0.333333644207707
        x = log_decoding_Log3G10_v1(y)

        y = np.tile(y, 6)
        x = np.tile(x, 6)
        np.testing.assert_almost_equal(log_decoding_Log3G10_v1(y),
                                       x,
                                       decimal=7)

        y = np.reshape(y, (2, 3))
        x = np.reshape(x, (2, 3))
        np.testing.assert_almost_equal(log_decoding_Log3G10_v1(y),
                                       x,
                                       decimal=7)

        y = np.reshape(y, (2, 3, 1))
        x = np.reshape(x, (2, 3, 1))
        np.testing.assert_almost_equal(log_decoding_Log3G10_v1(y),
                                       x,
                                       decimal=7)
Example #2
0
    def test_nan_log_decoding_Log3G10_v1(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.red_log.\
log_decoding_Log3G10_v1` definition nan support.
        """

        log_decoding_Log3G10_v1(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Example #3
0
    def test_log_decoding_Log3G10_v1(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.red_log.\
log_decoding_Log3G10_v1` definition.
        """

        self.assertAlmostEqual(log_decoding_Log3G10_v1(-0.496483569056003),
                               -1.0,
                               places=7)

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

        self.assertAlmostEqual(log_decoding_Log3G10_v1(0.333333644207707),
                               0.18,
                               places=7)
Example #4
0
    def test_domain_range_scale_log_decoding_Log3G10_v1(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.red_log.\
log_decoding_Log3G10_v1` definition domain and range scale support.
        """

        y = 0.333333644207707
        x = log_decoding_Log3G10_v1(y)

        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_Log3G10_v1(y *
                                                                       factor),
                                               x * factor,
                                               decimal=7)