def test_nan_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition nan support. """ eotf_RIMMRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_nan_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition nan support. """ eotf_RIMMRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_n_dimensional_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition n-dimensional arrays support. """ L = 74.376801781315210 V = 0.18 np.testing.assert_almost_equal( eotf_RIMMRGB(L), V, decimal=7) L = np.tile(L, 6) V = np.tile(V, 6) np.testing.assert_almost_equal( eotf_RIMMRGB(L), V, decimal=7) L = np.reshape(L, (2, 3)) V = np.reshape(V, (2, 3)) np.testing.assert_almost_equal( eotf_RIMMRGB(L), V, decimal=7) L = np.reshape(L, (2, 3, 1)) V = np.reshape(V, (2, 3, 1)) np.testing.assert_almost_equal( eotf_RIMMRGB(L), V, decimal=7)
def test_domain_range_scale_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition domain and range scale support. """ X_p = 0.291673732475746 X = eotf_RIMMRGB(X_p) d_r = (('reference', 1), (1, 1), (100, 100)) for scale, factor in d_r: with domain_range_scale(scale): np.testing.assert_almost_equal( eotf_RIMMRGB(X_p * factor), X * factor, decimal=7)
def test_domain_range_scale_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition domain and range scale support. """ X_p = 0.291673732475746 X = eotf_RIMMRGB(X_p) d_r = (('reference', 1), (1, 1), (100, 100)) for scale, factor in d_r: with domain_range_scale(scale): np.testing.assert_almost_equal(eotf_RIMMRGB(X_p * factor), X * factor, decimal=7)
def test_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition. """ self.assertAlmostEqual(eotf_RIMMRGB(0.0), 0.0, places=7) self.assertAlmostEqual(eotf_RIMMRGB(74.376801781315210), 0.18, places=7) self.assertAlmostEqual(eotf_RIMMRGB(181.846934745868940), 1.0, places=7)
def test_n_dimensional_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition n-dimensional arrays support. """ X_p = 0.291673732475746 X = eotf_RIMMRGB(X_p) X_p = np.tile(X_p, 6) X = np.tile(X, 6) np.testing.assert_almost_equal(eotf_RIMMRGB(X_p), X, decimal=7) X_p = np.reshape(X_p, (2, 3)) X = np.reshape(X, (2, 3)) np.testing.assert_almost_equal(eotf_RIMMRGB(X_p), X, decimal=7) X_p = np.reshape(X_p, (2, 3, 1)) X = np.reshape(X, (2, 3, 1)) np.testing.assert_almost_equal(eotf_RIMMRGB(X_p), X, decimal=7)
def test_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition. """ self.assertAlmostEqual(eotf_RIMMRGB(0.0), 0.0, places=7) self.assertAlmostEqual(eotf_RIMMRGB(0.291673732475746), 0.18, places=7) self.assertAlmostEqual(eotf_RIMMRGB(0.713125234297525), 1.0, places=7) np.testing.assert_allclose( eotf_RIMMRGB(74, in_int=True), 0.18, atol=0.005, rtol=0.005) np.testing.assert_allclose( eotf_RIMMRGB(1194, bit_depth=12, in_int=True), 0.18, atol=0.005, rtol=0.005)
def test_n_dimensional_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition n-dimensional arrays support. """ X_p = 0.291673732475746 X = eotf_RIMMRGB(X_p) X_p = np.tile(X_p, 6) X = np.tile(X, 6) np.testing.assert_almost_equal(eotf_RIMMRGB(X_p), X, decimal=7) X_p = np.reshape(X_p, (2, 3)) X = np.reshape(X, (2, 3)) np.testing.assert_almost_equal(eotf_RIMMRGB(X_p), X, decimal=7) X_p = np.reshape(X_p, (2, 3, 1)) X = np.reshape(X, (2, 3, 1)) np.testing.assert_almost_equal(eotf_RIMMRGB(X_p), X, decimal=7)
def test_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition. """ self.assertAlmostEqual( eotf_RIMMRGB(0.0), 0.0, places=7) self.assertAlmostEqual( eotf_RIMMRGB(74.376801781315210), 0.18, places=7) self.assertAlmostEqual( eotf_RIMMRGB(181.846934745868940), 1.0, places=7)
def test_n_dimensional_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition n-dimensional arrays support. """ L = 74.376801781315210 V = 0.18 np.testing.assert_almost_equal(eotf_RIMMRGB(L), V, decimal=7) L = np.tile(L, 6) V = np.tile(V, 6) np.testing.assert_almost_equal(eotf_RIMMRGB(L), V, decimal=7) L = np.reshape(L, (2, 3)) V = np.reshape(V, (2, 3)) np.testing.assert_almost_equal(eotf_RIMMRGB(L), V, decimal=7) L = np.reshape(L, (2, 3, 1)) V = np.reshape(V, (2, 3, 1)) np.testing.assert_almost_equal(eotf_RIMMRGB(L), V, decimal=7)
def test_eotf_RIMMRGB(self): """ Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\ eotf_RIMMRGB` definition. """ self.assertAlmostEqual(eotf_RIMMRGB(0.0), 0.0, places=7) self.assertAlmostEqual(eotf_RIMMRGB(0.291673732475746), 0.18, places=7) self.assertAlmostEqual(eotf_RIMMRGB(0.713125234297525), 1.0, places=7) np.testing.assert_allclose(eotf_RIMMRGB(74, in_int=True), 0.18, atol=0.005, rtol=0.005) np.testing.assert_allclose(eotf_RIMMRGB(1194, bit_depth=12, in_int=True), 0.18, atol=0.005, rtol=0.005)