Пример #1
0
    def test_nan_oetf_reverse_sRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.sRGB.\
oetf_reverse_sRGB` definition nan support.
        """

        oetf_reverse_sRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Пример #2
0
    def test_nan_oetf_reverse_sRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.sRGB.\
oetf_reverse_sRGB` definition nan support.
        """

        oetf_reverse_sRGB(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Пример #3
0
    def test_oetf_reverse_sRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.sRGB.\
oetf_reverse_sRGB` definition.
        """

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

        self.assertAlmostEqual(
            oetf_reverse_sRGB(0.461356129500442), 0.18, places=7)

        self.assertAlmostEqual(oetf_reverse_sRGB(1.0), 1.0, places=7)
Пример #4
0
    def test_oetf_reverse_sRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.sRGB.\
oetf_reverse_sRGB` definition.
        """

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

        self.assertAlmostEqual(
            oetf_reverse_sRGB(0.461356129500442), 0.18, places=7)

        self.assertAlmostEqual(oetf_reverse_sRGB(1.0), 1.0, places=7)
Пример #5
0
    def test_domain_range_scale_oetf_reverse_sRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.sRGB.\
oetf_reverse_sRGB` definition domain and range scale support.
        """

        V = 0.461356129500442
        L = oetf_reverse_sRGB(V)

        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_reverse_sRGB(V * factor), L * factor, decimal=7)
Пример #6
0
    def test_domain_range_scale_oetf_reverse_sRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.sRGB.\
oetf_reverse_sRGB` definition domain and range scale support.
        """

        V = 0.461356129500442
        L = oetf_reverse_sRGB(V)

        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_reverse_sRGB(V * factor),
                                               L * factor,
                                               decimal=7)
Пример #7
0
    def test_n_dimensional_oetf_reverse_sRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.sRGB.\
oetf_reverse_sRGB` definition n-dimensional arrays support.
        """

        V = 0.461356129500442
        L = oetf_reverse_sRGB(V)

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

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

        V = np.reshape(V, (2, 3, 1))
        L = np.reshape(L, (2, 3, 1))
        np.testing.assert_almost_equal(oetf_reverse_sRGB(V), L, decimal=7)
Пример #8
0
    def test_n_dimensional_oetf_reverse_sRGB(self):
        """
        Tests :func:`colour.models.rgb.transfer_functions.sRGB.\
oetf_reverse_sRGB` definition n-dimensional arrays support.
        """

        V = 0.461356129500442
        L = oetf_reverse_sRGB(V)

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

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

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