コード例 #1
0
ファイル: colors.py プロジェクト: JoseCarlosGarcia95/Wolfie
def rgb_to_xyz(r, g, b, *rest):
    r, g, b = map(_inverse_compand_srgb, (r, g, b))
    x, y, z = unstack(_clip1(dot_t(stack(r, g, b), _xyz_from_rgb)))
    return map(_clip1, (x, y, z) + rest)
コード例 #2
0
ファイル: colors.py プロジェクト: JoseCarlosGarcia95/Wolfie
def xyz_to_rgb(x, y, z, *rest):
    x, y, z = map(_clip1, (x, y, z))
    r, g, b = unstack(dot_t(stack(x, y, z), _rgb_from_xyz))
    r, g, b = map(_clip1, (r, g, b))
    r, g, b = map(_compand_srgb, (r, g, b))
    return map(_clip1, (r, g, b) + rest)
コード例 #3
0
 def testDot(self):
     self.assertEqual(dot_t([1, 2, 3], [4, 5, 6]), 32)
     self.assertEqualArrays(
         dot_t([1, 2, 3], [[4, 5, 6], [7, 8, 9], [10, 11, 12]]),
         [32, 50, 68])
コード例 #4
0
ファイル: test_numpy_utils.py プロジェクト: Piruzzolo/Mathics
 def testDot(self):
     self.assertEqual(dot_t([1, 2, 3], [4, 5, 6]), 32)
     self.assertEqualArrays(dot_t([1, 2, 3], [[4, 5, 6], [7, 8, 9], [10, 11, 12]]), [32, 50, 68])
コード例 #5
0
ファイル: colors.py プロジェクト: Piruzzolo/Mathics
def rgb_to_xyz(r, g, b, *rest):
    r, g, b = map(_inverse_compand_srgb, (r, g, b))
    x, y, z = unstack(_clip1(dot_t(stack(r, g, b), _xyz_from_rgb)))
    return map(_clip1, (x, y, z) + rest)
コード例 #6
0
ファイル: colors.py プロジェクト: Piruzzolo/Mathics
def xyz_to_rgb(x, y, z, *rest):
    x, y, z = map(_clip1, (x, y, z))
    r, g, b = unstack(dot_t(stack(x, y, z), _rgb_from_xyz))
    r, g, b = map(_clip1, (r, g, b))
    r, g, b = map(_compand_srgb, (r, g, b))
    return map(_clip1, (r, g, b) + rest)