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