mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Added unpacker from I;16B to I;16
This commit is contained in:
parent
b62c3baeee
commit
ff003bfbcc
|
@ -757,6 +757,7 @@ class TestLibUnpack:
|
||||||
|
|
||||||
def test_I16(self):
|
def test_I16(self):
|
||||||
self.assert_unpack("I;16", "I;16", 2, 0x0201, 0x0403, 0x0605)
|
self.assert_unpack("I;16", "I;16", 2, 0x0201, 0x0403, 0x0605)
|
||||||
|
self.assert_unpack("I;16", "I;16B", 2, 0x0102, 0x0304, 0x0506)
|
||||||
self.assert_unpack("I;16B", "I;16B", 2, 0x0102, 0x0304, 0x0506)
|
self.assert_unpack("I;16B", "I;16B", 2, 0x0102, 0x0304, 0x0506)
|
||||||
self.assert_unpack("I;16L", "I;16L", 2, 0x0201, 0x0403, 0x0605)
|
self.assert_unpack("I;16L", "I;16L", 2, 0x0201, 0x0403, 0x0605)
|
||||||
self.assert_unpack("I;16", "I;12", 2, 0x0010, 0x0203, 0x0040)
|
self.assert_unpack("I;16", "I;12", 2, 0x0010, 0x0203, 0x0040)
|
||||||
|
|
|
@ -1149,6 +1149,16 @@ unpackI16N_I16(UINT8 *out, const UINT8 *in, int pixels) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void
|
static void
|
||||||
|
unpackI16B_I16(UINT8 *out, const UINT8 *in, int pixels) {
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < pixels; i++) {
|
||||||
|
out[0] = in[1];
|
||||||
|
out[1] = in[0];
|
||||||
|
in += 2;
|
||||||
|
out += 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static void
|
||||||
unpackI16R_I16(UINT8 *out, const UINT8 *in, int pixels) {
|
unpackI16R_I16(UINT8 *out, const UINT8 *in, int pixels) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < pixels; i++) {
|
for (i = 0; i < pixels; i++) {
|
||||||
|
@ -1764,6 +1774,7 @@ static struct {
|
||||||
{"I;16L", "I;16L", 16, copy2},
|
{"I;16L", "I;16L", 16, copy2},
|
||||||
{"I;16N", "I;16N", 16, copy2},
|
{"I;16N", "I;16N", 16, copy2},
|
||||||
|
|
||||||
|
{"I;16", "I;16B", 16, unpackI16B_I16},
|
||||||
{"I;16", "I;16N", 16, unpackI16N_I16}, // LibTiff native->image endian.
|
{"I;16", "I;16N", 16, unpackI16N_I16}, // LibTiff native->image endian.
|
||||||
{"I;16L", "I;16N", 16, unpackI16N_I16}, // LibTiff native->image endian.
|
{"I;16L", "I;16N", 16, unpackI16N_I16}, // LibTiff native->image endian.
|
||||||
{"I;16B", "I;16N", 16, unpackI16N_I16B},
|
{"I;16B", "I;16N", 16, unpackI16N_I16B},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user