mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Add RGBXX RGBXXX YCbCrXX YCbCrXXX rawmodes for TIFFs
This commit is contained in:
parent
1f4fd49a80
commit
dc127273f4
|
@ -223,7 +223,7 @@ class TestLibUnpack(PillowTestCase):
|
|||
self.assert_unpack("L", "L;R", 1, 128, 64, 192, 32)
|
||||
self.assert_unpack("L", "L;16", 2, 2, 4, 6, 8)
|
||||
self.assert_unpack("L", "L;16B", 2, 1, 3, 5, 7)
|
||||
self.assert_unpack("L", "L;16", b'\x00\xc6\x00\xaf', 198, 175)
|
||||
self.assert_unpack("L", "L;16", b'\x00\xc6\x00\xaf', 198, 175)
|
||||
self.assert_unpack("L", "L;16B", b'\xc6\x00\xaf\x00', 198, 175)
|
||||
|
||||
|
||||
|
@ -339,6 +339,10 @@ class TestLibUnpack(PillowTestCase):
|
|||
self.assert_unpack("RGBX", "RGB;4B", 2, (17,0,34,X), (51,0,68,X))
|
||||
self.assert_unpack("RGBX", "RGBX", 4,
|
||||
(1,2,3,4), (5,6,7,8), (9,10,11,12))
|
||||
self.assert_unpack("RGBX", "RGBXX", 5,
|
||||
(1,2,3,4), (6,7,8,9), (11,12,13,14))
|
||||
self.assert_unpack("RGBX", "RGBXXX", 6,
|
||||
(1,2,3,4), (7,8,9,10), (13,14,15,16))
|
||||
self.assert_unpack("RGBX", "RGBX;L", 4,
|
||||
(1,4,7,10), (2,5,8,11), (3,6,9,12))
|
||||
self.assert_unpack("RGBX", "RGBX;16L", 8, (2,4,6,8), (10,12,14,16))
|
||||
|
@ -355,7 +359,12 @@ class TestLibUnpack(PillowTestCase):
|
|||
self.assert_unpack("RGBX", "X", 1, (0,0,0,1), (0,0,0,2), (0,0,0,3))
|
||||
|
||||
def test_CMYK(self):
|
||||
self.assert_unpack("CMYK", "CMYK", 4, (1,2,3,4), (5,6,7,8), (9,10,11,12))
|
||||
self.assert_unpack("CMYK", "CMYK", 4,
|
||||
(1,2,3,4), (5,6,7,8), (9,10,11,12))
|
||||
self.assert_unpack("CMYK", "CMYKX", 5,
|
||||
(1,2,3,4), (6,7,8,9), (11,12,13,14))
|
||||
self.assert_unpack("CMYK", "CMYKXX", 6,
|
||||
(1,2,3,4), (7,8,9,10), (13,14,15,16))
|
||||
self.assert_unpack("CMYK", "CMYK;I", 4,
|
||||
(254,253,252,251), (250,249,248,247), (246,245,244,243))
|
||||
self.assert_unpack("CMYK", "CMYK;L", 4,
|
||||
|
@ -376,8 +385,10 @@ class TestLibUnpack(PillowTestCase):
|
|||
def test_YCbCr(self):
|
||||
self.assert_unpack("YCbCr", "YCbCr", 3, (1,2,3), (4,5,6), (7,8,9))
|
||||
self.assert_unpack("YCbCr", "YCbCr;L", 3, (1,4,7), (2,5,8), (3,6,9))
|
||||
self.assert_unpack("YCbCr", "YCbCrX", 4, (1,2,3), (5,6,7), (9,10,11))
|
||||
self.assert_unpack("YCbCr", "YCbCrK", 4, (1,2,3), (5,6,7), (9,10,11))
|
||||
self.assert_unpack("YCbCr", "YCbCrX", 4, (1,2,3), (5,6,7), (9,10,11))
|
||||
self.assert_unpack("YCbCr", "YCbCrXX", 5, (1,2,3), (6,7,8), (11,12,13))
|
||||
self.assert_unpack("YCbCr", "YCbCrXXX", 6, (1,2,3), (7,8,9), (13,14,15))
|
||||
|
||||
def test_LAB(self):
|
||||
self.assert_unpack("LAB", "LAB", 3,
|
||||
|
|
|
@ -194,6 +194,10 @@ OPEN_INFO = {
|
|||
(MM, 2, (1,), 1, (8, 8, 8, 8), ()): ("RGBA", "RGBA"), # missing ExtraSamples
|
||||
(II, 2, (1,), 1, (8, 8, 8, 8), (0,)): ("RGBX", "RGBX"),
|
||||
(MM, 2, (1,), 1, (8, 8, 8, 8), (0,)): ("RGBX", "RGBX"),
|
||||
(II, 2, (1,), 1, (8, 8, 8, 8, 8), (0, 0)): ("RGBX", "RGBXX"),
|
||||
(MM, 2, (1,), 1, (8, 8, 8, 8, 8), (0, 0)): ("RGBX", "RGBXX"),
|
||||
(II, 2, (1,), 1, (8, 8, 8, 8, 8, 8), (0, 0, 0)): ("RGBX", "RGBXXX"),
|
||||
(MM, 2, (1,), 1, (8, 8, 8, 8, 8, 8), (0, 0, 0)): ("RGBX", "RGBXXX"),
|
||||
(II, 2, (1,), 1, (8, 8, 8, 8), (1,)): ("RGBA", "RGBa"),
|
||||
(MM, 2, (1,), 1, (8, 8, 8, 8), (1,)): ("RGBA", "RGBa"),
|
||||
(II, 2, (1,), 1, (8, 8, 8, 8), (2,)): ("RGBA", "RGBA"),
|
||||
|
@ -240,6 +244,12 @@ OPEN_INFO = {
|
|||
|
||||
(II, 6, (1,), 1, (8, 8, 8), ()): ("YCbCr", "YCbCr"),
|
||||
(MM, 6, (1,), 1, (8, 8, 8), ()): ("YCbCr", "YCbCr"),
|
||||
(II, 6, (1,), 1, (8, 8, 8, 8), (0,)): ("YCbCr", "YCbCrX"),
|
||||
(MM, 6, (1,), 1, (8, 8, 8, 8), (0,)): ("YCbCr", "YCbCrX"),
|
||||
(II, 6, (1,), 1, (8, 8, 8, 8, 8), (0, 0)): ("YCbCr", "YCbCrXXX"),
|
||||
(MM, 6, (1,), 1, (8, 8, 8, 8, 8), (0, 0)): ("YCbCr", "YCbCrXXX"),
|
||||
(II, 6, (1,), 1, (8, 8, 8, 8, 8, 8), (0, 0, 0)): ("YCbCr", "YCbCrXXX"),
|
||||
(MM, 6, (1,), 1, (8, 8, 8, 8, 8, 8), (0, 0, 0)): ("YCbCr", "YCbCrXXX"),
|
||||
|
||||
(II, 8, (1,), 1, (8, 8, 8), ()): ("LAB", "LAB"),
|
||||
(MM, 8, (1,), 1, (8, 8, 8), ()): ("LAB", "LAB"),
|
||||
|
|
|
@ -1352,6 +1352,8 @@ static struct {
|
|||
{"RGBX", "RGB;4B", 16, ImagingUnpackRGB4B},
|
||||
{"RGBX", "BGR;5", 16, ImagingUnpackBGR15}, /* compat */
|
||||
{"RGBX", "RGBX", 32, copy4},
|
||||
{"RGBX", "RGBXX", 40, copy4skip1},
|
||||
{"RGBX", "RGBXXX", 48, copy4skip2},
|
||||
{"RGBX", "RGBX;L", 32, unpackRGBAL},
|
||||
{"RGBX", "RGBX;16L", 64, unpackRGBA16L},
|
||||
{"RGBX", "RGBX;16B", 64, unpackRGBA16B},
|
||||
|
@ -1383,6 +1385,8 @@ static struct {
|
|||
{"YCbCr", "YCbCr", 24, ImagingUnpackRGB},
|
||||
{"YCbCr", "YCbCr;L", 24, unpackRGBL},
|
||||
{"YCbCr", "YCbCrX", 32, copy4},
|
||||
{"YCbCr", "YCbCrXX", 40, copy4skip1},
|
||||
{"YCbCr", "YCbCrXXX", 48, copy4skip2},
|
||||
{"YCbCr", "YCbCrK", 32, copy4},
|
||||
|
||||
/* LAB Color */
|
||||
|
|
Loading…
Reference in New Issue
Block a user