def test_n_dimensional_log_encoding_ACEScct(self): """ Test :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition n-dimensional arrays support. """ lin_AP1 = 0.18 ACEScct = log_encoding_ACEScct(lin_AP1) lin_AP1 = np.tile(lin_AP1, 6) ACEScct = np.tile(ACEScct, 6) np.testing.assert_almost_equal( log_encoding_ACEScct(lin_AP1), ACEScct, decimal=7 ) lin_AP1 = np.reshape(lin_AP1, (2, 3)) ACEScct = np.reshape(ACEScct, (2, 3)) np.testing.assert_almost_equal( log_encoding_ACEScct(lin_AP1), ACEScct, decimal=7 ) lin_AP1 = np.reshape(lin_AP1, (2, 3, 1)) ACEScct = np.reshape(ACEScct, (2, 3, 1)) np.testing.assert_almost_equal( log_encoding_ACEScct(lin_AP1), ACEScct, decimal=7 )
def test_n_dimensional_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition n-dimensional arrays support. """ linear = 0.18 log = 0.413588402492442 np.testing.assert_almost_equal(log_encoding_ACEScct(linear), log, decimal=7) linear = np.tile(linear, 6) log = np.tile(log, 6) np.testing.assert_almost_equal(log_encoding_ACEScct(linear), log, decimal=7) linear = np.reshape(linear, (2, 3)) log = np.reshape(log, (2, 3)) np.testing.assert_almost_equal(log_encoding_ACEScct(linear), log, decimal=7) linear = np.reshape(linear, (2, 3, 1)) log = np.reshape(log, (2, 3, 1)) np.testing.assert_almost_equal(log_encoding_ACEScct(linear), log, decimal=7)
def test_nan_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition nan support. """ log_encoding_ACEScct( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_nan_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition nan support. """ log_encoding_ACEScct( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition. """ self.assertAlmostEqual( log_encoding_ACEScct(0.0), 0.072905534195835495, places=7) self.assertAlmostEqual( log_encoding_ACEScct(0.18), 0.413588402492442, places=7) self.assertAlmostEqual( log_encoding_ACEScct(1.0), 0.554794520547945, places=7)
def test_domain_range_scale_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition domain and range scale support. """ lin_AP1 = 0.18 ACEScct = log_encoding_ACEScct(lin_AP1) 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_encoding_ACEScct(lin_AP1 * factor), ACEScct * factor, decimal=7)
def test_domain_range_scale_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition domain and range scale support. """ lin_AP1 = 0.18 ACEScct = log_encoding_ACEScct(lin_AP1) 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_encoding_ACEScct(lin_AP1 * factor), ACEScct * factor, decimal=7)
def test_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition. """ self.assertAlmostEqual(log_encoding_ACEScct(0.0), 0.072905534195835495, places=7) self.assertAlmostEqual(log_encoding_ACEScct(0.18), 0.413588402492442, places=7) self.assertAlmostEqual(log_encoding_ACEScct(1.0), 0.554794520547945, places=7)
def test_ACEScc_equivalency_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition ACEScc equivalency, and explicit requirement specified by AMPAS ACES specification S-2016-001 (https://github.com/ampas/\ aces-dev/blob/v1.0.3/documents/LaTeX/S-2016-001/introduction.tex#L14) """ equiv = np.linspace(0.0078125, 222.86094420380761, 100) np.testing.assert_almost_equal( log_encoding_ACEScct(equiv), log_encoding_ACEScc(equiv), decimal=7)
def test_ACEScc_equivalency_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition ACEScc equivalency, and explicit requirement specified by AMPAS ACES specification S-2016-001 (https://github.com/ampas/\ aces-dev/blob/v1.0.3/documents/LaTeX/S-2016-001/introduction.tex#L14) """ equiv = np.linspace(0.0078125, 222.86094420380761, 100) np.testing.assert_almost_equal(log_encoding_ACEScct(equiv), log_encoding_ACEScc(equiv), decimal=7)
def test_n_dimensional_log_encoding_ACEScct(self): """ Tests :func:`colour.models.rgb.transfer_functions.aces.\ log_encoding_ACEScct` definition n-dimensional arrays support. """ lin_AP1 = 0.18 ACEScct = log_encoding_ACEScct(lin_AP1) lin_AP1 = np.tile(lin_AP1, 6) ACEScct = np.tile(ACEScct, 6) np.testing.assert_almost_equal( log_encoding_ACEScct(lin_AP1), ACEScct, decimal=7) lin_AP1 = np.reshape(lin_AP1, (2, 3)) ACEScct = np.reshape(ACEScct, (2, 3)) np.testing.assert_almost_equal( log_encoding_ACEScct(lin_AP1), ACEScct, decimal=7) lin_AP1 = np.reshape(lin_AP1, (2, 3, 1)) ACEScct = np.reshape(ACEScct, (2, 3, 1)) np.testing.assert_almost_equal( log_encoding_ACEScct(lin_AP1), ACEScct, decimal=7)