def test_n_dimensional_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition n-dimensional arrays support.
        """

        L = 0.385711424751138
        V = 0.18
        np.testing.assert_almost_equal(
            eotf_ROMMRGB(L),
            V,
            decimal=7)

        L = np.tile(L, 6)
        V = np.tile(V, 6)
        np.testing.assert_almost_equal(
            eotf_ROMMRGB(L),
            V,
            decimal=7)

        L = np.reshape(L, (2, 3))
        V = np.reshape(V, (2, 3))
        np.testing.assert_almost_equal(
            eotf_ROMMRGB(L),
            V,
            decimal=7)

        L = np.reshape(L, (2, 3, 1))
        V = np.reshape(V, (2, 3, 1))
        np.testing.assert_almost_equal(
            eotf_ROMMRGB(L),
            V,
            decimal=7)
    def test_nan_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition nan support.
        """

        eotf_ROMMRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Beispiel #3
0
    def test_nan_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition nan support.
        """

        eotf_ROMMRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Beispiel #4
0
    def test_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition.
        """

        self.assertAlmostEqual(eotf_ROMMRGB(0.0), 0.0, places=7)

        self.assertAlmostEqual(eotf_ROMMRGB(0.385711424751138), 0.18, places=7)

        self.assertAlmostEqual(eotf_ROMMRGB(1.0), 1.0, places=7)
Beispiel #5
0
    def test_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition.
        """

        self.assertAlmostEqual(eotf_ROMMRGB(0.0), 0.0, places=7)

        self.assertAlmostEqual(eotf_ROMMRGB(98.356413311540095),
                               0.18,
                               places=7)

        self.assertAlmostEqual(eotf_ROMMRGB(255.0), 1.0, places=7)
    def test_domain_range_scale_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition domain and range scale support.
        """

        X_p = 0.385711424751138
        X = eotf_ROMMRGB(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_ROMMRGB(X_p * factor), X * factor, decimal=7)
Beispiel #7
0
    def test_domain_range_scale_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition domain and range scale support.
        """

        X_p = 0.385711424751138
        X = eotf_ROMMRGB(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_ROMMRGB(X_p * factor),
                                               X * factor,
                                               decimal=7)
    def test_n_dimensional_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition n-dimensional arrays support.
        """

        X_p = 0.385711424751138
        X = eotf_ROMMRGB(X_p)

        X_p = np.tile(X_p, 6)
        X = np.tile(X, 6)
        np.testing.assert_almost_equal(eotf_ROMMRGB(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_ROMMRGB(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_ROMMRGB(X_p), X, decimal=7)
    def test_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition.
        """

        self.assertAlmostEqual(eotf_ROMMRGB(0.0), 0.0, places=7)

        self.assertAlmostEqual(eotf_ROMMRGB(0.385711424751138), 0.18, places=7)

        self.assertAlmostEqual(eotf_ROMMRGB(1.0), 1.0, places=7)

        np.testing.assert_allclose(
            eotf_ROMMRGB(98, in_int=True), 0.18, atol=0.001, rtol=0.001)

        np.testing.assert_allclose(
            eotf_ROMMRGB(1579, bit_depth=12, in_int=True),
            0.18,
            atol=0.001,
            rtol=0.001)
Beispiel #10
0
    def test_n_dimensional_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition n-dimensional arrays support.
        """

        X_p = 0.385711424751138
        X = eotf_ROMMRGB(X_p)

        X_p = np.tile(X_p, 6)
        X = np.tile(X, 6)
        np.testing.assert_almost_equal(eotf_ROMMRGB(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_ROMMRGB(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_ROMMRGB(X_p), X, decimal=7)
Beispiel #11
0
    def test_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition.
        """

        self.assertAlmostEqual(
            eotf_ROMMRGB(0.0),
            0.0,
            places=7)

        self.assertAlmostEqual(
            eotf_ROMMRGB(0.385711424751138),
            0.18,
            places=7)

        self.assertAlmostEqual(
            eotf_ROMMRGB(1.0),
            1.0,
            places=7)
Beispiel #12
0
    def test_n_dimensional_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition n-dimensional arrays support.
        """

        L = 98.356413311540095
        V = 0.18
        np.testing.assert_almost_equal(eotf_ROMMRGB(L), V, decimal=7)

        L = np.tile(L, 6)
        V = np.tile(V, 6)
        np.testing.assert_almost_equal(eotf_ROMMRGB(L), V, decimal=7)

        L = np.reshape(L, (2, 3))
        V = np.reshape(V, (2, 3))
        np.testing.assert_almost_equal(eotf_ROMMRGB(L), V, decimal=7)

        L = np.reshape(L, (2, 3, 1))
        V = np.reshape(V, (2, 3, 1))
        np.testing.assert_almost_equal(eotf_ROMMRGB(L), V, decimal=7)
Beispiel #13
0
    def test_eotf_ROMMRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.rimm_romm_rgb.\
eotf_ROMMRGB` definition.
        """

        self.assertAlmostEqual(eotf_ROMMRGB(0.0), 0.0, places=7)

        self.assertAlmostEqual(eotf_ROMMRGB(0.385711424751138), 0.18, places=7)

        self.assertAlmostEqual(eotf_ROMMRGB(1.0), 1.0, places=7)

        np.testing.assert_allclose(eotf_ROMMRGB(98, in_int=True),
                                   0.18,
                                   atol=0.001,
                                   rtol=0.001)

        np.testing.assert_allclose(eotf_ROMMRGB(1579,
                                                bit_depth=12,
                                                in_int=True),
                                   0.18,
                                   atol=0.001,
                                   rtol=0.001)