def test_nan_log_decoding_DLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\ log_decoding_FilmLight_T_Log` definition nan support. """ log_decoding_DJIDLog( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_log_decoding_DJIDLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.filmlight_tlog.\ log_decoding_FilmLight_T_Log` definition. """ self.assertAlmostEqual(log_decoding_DJIDLog(0.0929), 0.0, places=7) self.assertAlmostEqual( log_decoding_DJIDLog(0.398764556189331), 0.18, places=6) self.assertAlmostEqual(log_decoding_DJIDLog(0.584555), 1.0, places=6)
def test_log_decoding_DJIDLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.dji_dlog.\ log_decoding_DJIDLog` definition. """ self.assertAlmostEqual(log_decoding_DJIDLog(0.0929), 0.0, places=7) self.assertAlmostEqual( log_decoding_DJIDLog(0.398764556189331), 0.18, places=6) self.assertAlmostEqual(log_decoding_DJIDLog(0.584555), 1.0, places=6)
def test_domain_range_scale_log_decoding_DLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.dji_dlog.\ log_decoding_DJIDLog` definition domain and range scale support. """ y = 0.398764556189331 x = log_decoding_DJIDLog(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_DJIDLog(y * factor), x * factor, decimal=7)
def test_n_dimensional_log_decoding_DLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.dji_dlog.\ log_decoding_DJIDLog` definition n-dimensional arrays support. """ y = 0.398764556189331 x = log_decoding_DJIDLog(y) y = np.tile(y, 6) x = np.tile(x, 6) np.testing.assert_almost_equal(log_decoding_DJIDLog(y), x, decimal=7) y = np.reshape(y, (2, 3)) x = np.reshape(x, (2, 3)) np.testing.assert_almost_equal(log_decoding_DJIDLog(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_DJIDLog(y), x, decimal=7)