def test_n_dimensional_log_encoding_Cineon(self): """ Tests :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition n-dimensional arrays support. """ L = 0.18 V = 0.457319613085418 np.testing.assert_almost_equal( log_encoding_Cineon(L), V, decimal=7) L = np.tile(L, 6) V = np.tile(V, 6) np.testing.assert_almost_equal( log_encoding_Cineon(L), V, decimal=7) L = np.reshape(L, (2, 3)) V = np.reshape(V, (2, 3)) np.testing.assert_almost_equal( log_encoding_Cineon(L), V, decimal=7) L = np.reshape(L, (2, 3, 1)) V = np.reshape(V, (2, 3, 1)) np.testing.assert_almost_equal( log_encoding_Cineon(L), V, decimal=7)
def test_n_dimensional_log_encoding_Cineon(self): """ Tests :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition n-dimensional arrays support. """ L = 0.18 V = 0.457319613085418 np.testing.assert_almost_equal( log_encoding_Cineon(L), V, decimal=7) L = np.tile(L, 6) V = np.tile(V, 6) np.testing.assert_almost_equal( log_encoding_Cineon(L), V, decimal=7) L = np.reshape(L, (2, 3)) V = np.reshape(V, (2, 3)) np.testing.assert_almost_equal( log_encoding_Cineon(L), V, decimal=7) L = np.reshape(L, (2, 3, 1)) V = np.reshape(V, (2, 3, 1)) np.testing.assert_almost_equal( log_encoding_Cineon(L), V, decimal=7)
def test_nan_log_encoding_Cineon(self): """ Tests :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition nan support. """ log_encoding_Cineon( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_nan_log_encoding_Cineon(self): """ Tests :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition nan support. """ log_encoding_Cineon(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
def test_domain_range_scale_log_encoding_Cineon(self): """ Tests :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition domain and range scale support. """ x = 0.18 y = log_encoding_Cineon(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( log_encoding_Cineon(x * factor), y * factor, decimal=7)
def test_log_encoding_Cineon(self): """ Tests :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition. """ self.assertAlmostEqual( log_encoding_Cineon(0.0), 0.092864125122190, places=7) self.assertAlmostEqual( log_encoding_Cineon(0.18), 0.457319613085418, places=7) self.assertAlmostEqual( log_encoding_Cineon(1.0), 0.669599217986315, places=7)
def test_log_encoding_Cineon(self): """ Tests :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition. """ self.assertAlmostEqual( log_encoding_Cineon(0.0), 0.092864125122190, places=7) self.assertAlmostEqual( log_encoding_Cineon(0.18), 0.457319613085418, places=7) self.assertAlmostEqual( log_encoding_Cineon(1.0), 0.669599217986315, places=7)
def test_domain_range_scale_log_encoding_Cineon(self): """ Tests :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition domain and range scale support. """ x = 0.18 y = log_encoding_Cineon(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(log_encoding_Cineon(x * factor), y * factor, decimal=7)
def log_encoding_REDLogFilm(x, black_offset=10**((95 - 685) / 300)): """ Defines the *REDLogFilm* log encoding curve / opto-electronic transfer function. Parameters ---------- x : numeric or array_like Linear data :math:`x`. black_offset : numeric or array_like Black offset. Returns ------- numeric or ndarray Non-linear data :math:`y`. References ---------- - :cite:`SonyImageworks2012a` Examples -------- >>> log_encoding_REDLogFilm(0.18) # doctest: +ELLIPSIS 0.4573196... """ return log_encoding_Cineon(x, black_offset)
def log_encoding_REDLogFilm(x, black_offset=10 ** ((95 - 685) / 300)): """ Defines the *REDLogFilm* log encoding curve / opto-electronic transfer function. Parameters ---------- x : numeric or array_like Linear data :math:`x`. black_offset : numeric or array_like Black offset. Returns ------- numeric or ndarray Non-linear data :math:`y`. Examples -------- >>> log_encoding_REDLogFilm(0.18) # doctest: +ELLIPSIS 0.4573196... """ return log_encoding_Cineon(x, black_offset)
def test_n_dimensional_log_encoding_Cineon(self): """ Tests :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition n-dimensional arrays support. """ x = 0.18 y = log_encoding_Cineon(x) x = np.tile(x, 6) y = np.tile(y, 6) np.testing.assert_almost_equal(log_encoding_Cineon(x), y, decimal=7) x = np.reshape(x, (2, 3)) y = np.reshape(y, (2, 3)) np.testing.assert_almost_equal(log_encoding_Cineon(x), y, decimal=7) x = np.reshape(x, (2, 3, 1)) y = np.reshape(y, (2, 3, 1)) np.testing.assert_almost_equal(log_encoding_Cineon(x), y, decimal=7)
def test_n_dimensional_log_encoding_Cineon(self): """ Test :func:`colour.models.rgb.transfer_functions.cineon.\ log_encoding_Cineon` definition n-dimensional arrays support. """ x = 0.18 y = log_encoding_Cineon(x) x = np.tile(x, 6) y = np.tile(y, 6) np.testing.assert_almost_equal(log_encoding_Cineon(x), y, decimal=7) x = np.reshape(x, (2, 3)) y = np.reshape(y, (2, 3)) np.testing.assert_almost_equal(log_encoding_Cineon(x), y, decimal=7) x = np.reshape(x, (2, 3, 1)) y = np.reshape(y, (2, 3, 1)) np.testing.assert_almost_equal(log_encoding_Cineon(x), y, decimal=7)
def log_encoding_REDLogFilm( x: FloatingOrArrayLike, black_offset: FloatingOrArrayLike = 10 ** ((95 - 685) / 300), ) -> FloatingOrNDArray: """ Define the *REDLogFilm* log encoding curve / opto-electronic transfer function. Parameters ---------- x Linear data :math:`x`. black_offset Black offset. Returns ------- :class:`numpy.floating` or :class:`numpy.ndarray` Non-linear data :math:`y`. Notes ----- +------------+-----------------------+---------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +============+=======================+===============+ | ``x`` | [0, 1] | [0, 1] | +------------+-----------------------+---------------+ +------------+-----------------------+---------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +============+=======================+===============+ | ``y`` | [0, 1] | [0, 1] | +------------+-----------------------+---------------+ References ---------- :cite:`SonyImageworks2012a` Examples -------- >>> log_encoding_REDLogFilm(0.18) # doctest: +ELLIPSIS 0.4573196... """ return log_encoding_Cineon(x, black_offset)
def log_encoding_REDLogFilm(x, black_offset=10 ** ((95 - 685) / 300)): """ Defines the *REDLogFilm* log encoding curve / opto-electronic transfer function. Parameters ---------- x : numeric or array_like Linear data :math:`x`. black_offset : numeric or array_like Black offset. Returns ------- numeric or ndarray Non-linear data :math:`y`. Notes ----- +------------+-----------------------+---------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +============+=======================+===============+ | ``x`` | [0, 1] | [0, 1] | +------------+-----------------------+---------------+ +------------+-----------------------+---------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +============+=======================+===============+ | ``y`` | [0, 1] | [0, 1] | +------------+-----------------------+---------------+ References ---------- :cite:`SonyImageworks2012a` Examples -------- >>> log_encoding_REDLogFilm(0.18) # doctest: +ELLIPSIS 0.4573196... """ return log_encoding_Cineon(x, black_offset)