Esempio n. 1
0
    def test_nan_log_decoding_FLog(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.fujifilm_flog.\
log_decoding_FLog` definition nan support.
        """

        log_decoding_FLog(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Esempio n. 2
0
    def test_n_dimensional_log_decoding_FLog(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.fujifilm_flog.\
log_decoding_FLog` definition n-dimensional arrays support.
        """

        V_out = 0.459318458661621
        L_in = log_decoding_FLog(V_out)

        V_out = np.tile(V_out, 6)
        L_in = np.tile(L_in, 6)
        np.testing.assert_almost_equal(log_decoding_FLog(V_out),
                                       L_in,
                                       decimal=7)

        V_out = np.reshape(V_out, (2, 3))
        L_in = np.reshape(L_in, (2, 3))
        np.testing.assert_almost_equal(log_decoding_FLog(V_out),
                                       L_in,
                                       decimal=7)

        V_out = np.reshape(V_out, (2, 3, 1))
        L_in = np.reshape(L_in, (2, 3, 1))
        np.testing.assert_almost_equal(log_decoding_FLog(V_out),
                                       L_in,
                                       decimal=7)
Esempio n. 3
0
    def test_domain_range_scale_log_decoding_FLog(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.fujifilm_flog.\
log_decoding_FLog` definition domain and range scale support.
        """

        V_out = 0.459318458661621
        L_in = log_decoding_FLog(V_out)

        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_FLog(V_out *
                                                                 factor),
                                               L_in * factor,
                                               decimal=7)
Esempio n. 4
0
    def test_log_decoding_FLog(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.fujifilm_flog.\
log_decoding_FLog` definition.
        """

        self.assertAlmostEqual(log_decoding_FLog(0.092864000000000),
                               0.0,
                               places=7)

        self.assertAlmostEqual(log_decoding_FLog(0.459318458661621),
                               0.18,
                               places=7)

        self.assertAlmostEqual(log_decoding_FLog(0.459318458661621, 12),
                               0.18,
                               places=7)

        self.assertAlmostEqual(log_decoding_FLog(0.463336510514656, 10, False),
                               0.18,
                               places=7)

        self.assertAlmostEqual(log_decoding_FLog(0.446590337236003, 10, False,
                                                 False),
                               0.18,
                               places=7)

        self.assertAlmostEqual(log_decoding_FLog(0.704996409216428),
                               1.0,
                               places=7)