def test_n_dimensional_log_decoding_PivotedLog(self): """ Test :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition n-dimensional arrays support. """ y = 0.434995112414467 x = log_decoding_PivotedLog(y) y = np.tile(y, 6) x = np.tile(x, 6) np.testing.assert_almost_equal( log_decoding_PivotedLog(y), x, decimal=7 ) y = np.reshape(y, (2, 3)) x = np.reshape(x, (2, 3)) np.testing.assert_almost_equal( log_decoding_PivotedLog(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_PivotedLog(y), x, decimal=7 )
def test_n_dimensional_log_decoding_PivotedLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition n-dimensional arrays support. """ V = 0.434995112414467 L = 0.18 np.testing.assert_almost_equal(log_decoding_PivotedLog(V), L, decimal=7) V = np.tile(V, 6) L = np.tile(L, 6) np.testing.assert_almost_equal(log_decoding_PivotedLog(V), L, decimal=7) V = np.reshape(V, (2, 3)) L = np.reshape(L, (2, 3)) np.testing.assert_almost_equal(log_decoding_PivotedLog(V), L, decimal=7) V = np.reshape(V, (2, 3, 1)) L = np.reshape(L, (2, 3, 1)) np.testing.assert_almost_equal(log_decoding_PivotedLog(V), L, decimal=7)
def test_n_dimensional_log_decoding_PivotedLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition n-dimensional arrays support. """ V = 0.434995112414467 L = 0.18 np.testing.assert_almost_equal( log_decoding_PivotedLog(V), L, decimal=7) V = np.tile(V, 6) L = np.tile(L, 6) np.testing.assert_almost_equal( log_decoding_PivotedLog(V), L, decimal=7) V = np.reshape(V, (2, 3)) L = np.reshape(L, (2, 3)) np.testing.assert_almost_equal( log_decoding_PivotedLog(V), L, decimal=7) V = np.reshape(V, (2, 3, 1)) L = np.reshape(L, (2, 3, 1)) np.testing.assert_almost_equal( log_decoding_PivotedLog(V), L, decimal=7)
def test_nan_log_decoding_PivotedLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition nan support. """ log_decoding_PivotedLog( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_nan_log_decoding_PivotedLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition nan support. """ log_decoding_PivotedLog( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_log_decoding_PivotedLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition. """ self.assertAlmostEqual(log_decoding_PivotedLog(-np.inf), 0.0, places=7) self.assertAlmostEqual( log_decoding_PivotedLog(0.434995112414467), 0.18, places=7) self.assertAlmostEqual( log_decoding_PivotedLog(0.653390272208219), 1.0, places=7)
def test_log_decoding_PivotedLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition. """ self.assertAlmostEqual(log_decoding_PivotedLog(-np.inf), 0.0, places=7) self.assertAlmostEqual( log_decoding_PivotedLog(0.434995112414467), 0.18, places=7) self.assertAlmostEqual( log_decoding_PivotedLog(0.653390272208219), 1.0, places=7)
def test_domain_range_scale_log_decoding_PivotedLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition domain and range scale support. """ y = 0.434995112414467 x = log_decoding_PivotedLog(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_PivotedLog(y * factor), x * factor, decimal=7)
def test_domain_range_scale_log_decoding_PivotedLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition domain and range scale support. """ y = 0.434995112414467 x = log_decoding_PivotedLog(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_PivotedLog(y * factor), x * factor, decimal=7)
def test_n_dimensional_log_decoding_PivotedLog(self): """ Tests :func:`colour.models.rgb.transfer_functions.pivoted_log.\ log_decoding_PivotedLog` definition n-dimensional arrays support. """ y = 0.434995112414467 x = log_decoding_PivotedLog(y) y = np.tile(y, 6) x = np.tile(x, 6) np.testing.assert_almost_equal( log_decoding_PivotedLog(y), x, decimal=7) y = np.reshape(y, (2, 3)) x = np.reshape(x, (2, 3)) np.testing.assert_almost_equal( log_decoding_PivotedLog(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_PivotedLog(y), x, decimal=7)