コード例 #1
0
ファイル: tests_lightness.py プロジェクト: brehm/colour
    def test_n_dimensional_lightness_Glasser1958(self):
        """
        Tests :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition n-dimensional arrays support.
        """

        Y = 10.08
        L = 36.2505626458
        np.testing.assert_almost_equal(
            lightness_Glasser1958(Y),
            L,
            decimal=7)

        Y = np.tile(Y, 6)
        L = np.tile(L, 6)
        np.testing.assert_almost_equal(
            lightness_Glasser1958(Y),
            L,
            decimal=7)

        Y = np.reshape(Y, (2, 3))
        L = np.reshape(L, (2, 3))
        np.testing.assert_almost_equal(
            lightness_Glasser1958(Y),
            L,
            decimal=7)

        Y = np.reshape(Y, (2, 3, 1))
        L = np.reshape(L, (2, 3, 1))
        np.testing.assert_almost_equal(
            lightness_Glasser1958(Y),
            L,
            decimal=7)
コード例 #2
0
ファイル: tests_lightness.py プロジェクト: brehm/colour
    def test_nan_lightness_Glasser1958(self):
        """
        Tests :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition nan support.
        """

        lightness_Glasser1958(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
コード例 #3
0
ファイル: tests_lightness.py プロジェクト: yeekzhang/colour
    def test_nan_lightness_Glasser1958(self):
        """
        Tests :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition nan support.
        """

        lightness_Glasser1958(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
コード例 #4
0
ファイル: test_lightness.py プロジェクト: ajun73/Work_Code
    def test_lightness_Glasser1958(self):
        """
        Tests :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition.
        """

        self.assertAlmostEqual(
            lightness_Glasser1958(12.19722535), 39.83512646492521, places=7)

        self.assertAlmostEqual(
            lightness_Glasser1958(23.04276781), 53.585946877480623, places=7)

        self.assertAlmostEqual(
            lightness_Glasser1958(6.15720079), 27.972867038082629, places=7)
コード例 #5
0
ファイル: tests_lightness.py プロジェクト: yeekzhang/colour
    def test_lightness_Glasser1958(self):
        """
        Tests :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition.
        """

        self.assertAlmostEqual(
            lightness_Glasser1958(10.08), 36.25056265, places=7)

        self.assertAlmostEqual(
            lightness_Glasser1958(56.76), 78.81179990, places=7)

        self.assertAlmostEqual(
            lightness_Glasser1958(98.32), 98.34470526, places=7)
コード例 #6
0
    def test_lightness_Glasser1958(self):
        """
        Tests :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition.
        """

        self.assertAlmostEqual(
            lightness_Glasser1958(12.19722535), 39.83512646492521, places=7)

        self.assertAlmostEqual(
            lightness_Glasser1958(23.04276781), 53.585946877480623, places=7)

        self.assertAlmostEqual(
            lightness_Glasser1958(6.15720079), 27.972867038082629, places=7)
コード例 #7
0
ファイル: test_lightness.py プロジェクト: ajun73/Work_Code
    def test_domain_range_scale_lightness_Glasser1958(self):
        """
        Tests :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition domain and range scale support.
        """

        L = lightness_Glasser1958(12.19722535)

        d_r = (('reference', 1), (1, 0.01), (100, 1))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(
                    lightness_Glasser1958(12.19722535 * factor),
                    L * factor,
                    decimal=7)
コード例 #8
0
    def test_domain_range_scale_lightness_Glasser1958(self):
        """
        Tests :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition domain and range scale support.
        """

        L = lightness_Glasser1958(12.19722535)

        d_r = (('reference', 1), (1, 0.01), (100, 1))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(
                    lightness_Glasser1958(12.19722535 * factor),
                    L * factor,
                    decimal=7)
コード例 #9
0
ファイル: tests_lightness.py プロジェクト: aforsythe/colour
    def test_lightness_Glasser1958(self):
        """
        Tests :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition.
        """

        self.assertAlmostEqual(
            lightness_Glasser1958(10.08),
            36.2505626458,
            places=7)
        self.assertAlmostEqual(
            lightness_Glasser1958(56.76),
            78.8117999039,
            places=7)
        self.assertAlmostEqual(
            lightness_Glasser1958(98.32),
            98.3447052593,
            places=7)
コード例 #10
0
    def test_n_dimensional_lightness_Glasser1958(self):
        """
        Test :func:`colour.colorimetry.lightness.lightness_Glasser1958`
        definition n-dimensional arrays support.
        """

        Y = 12.19722535
        L = lightness_Glasser1958(Y)

        Y = np.tile(Y, 6)
        L = np.tile(L, 6)
        np.testing.assert_almost_equal(lightness_Glasser1958(Y), L, decimal=7)

        Y = np.reshape(Y, (2, 3))
        L = np.reshape(L, (2, 3))
        np.testing.assert_almost_equal(lightness_Glasser1958(Y), L, decimal=7)

        Y = np.reshape(Y, (2, 3, 1))
        L = np.reshape(L, (2, 3, 1))
        np.testing.assert_almost_equal(lightness_Glasser1958(Y), L, decimal=7)