mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-27 07:34:46 +03:00
Add basic support for TIFF 16-bit signed integer pixels (mode I;16S).
Only small additions needed to access the pixel data as numpy arrays were made. Code to convert to other pixel types such as 32-bit integers are not included.
This commit is contained in:
parent
1f61c4efd4
commit
69a179af25
|
@ -227,6 +227,7 @@ ImagingAccessInit()
|
|||
ADD("I;16", line_16, get_pixel_16L, put_pixel_16L);
|
||||
ADD("I;16L", line_16, get_pixel_16L, put_pixel_16L);
|
||||
ADD("I;16B", line_16, get_pixel_16B, put_pixel_16B);
|
||||
ADD("I;16S", line_16, get_pixel_16L, put_pixel_16L);
|
||||
ADD("I;32L", line_32, get_pixel_32L, put_pixel_32L);
|
||||
ADD("I;32B", line_32, get_pixel_32B, put_pixel_32B);
|
||||
ADD("F", line_32, get_pixel_32, put_pixel_32);
|
||||
|
|
|
@ -614,6 +614,7 @@ static struct {
|
|||
{"I;16", "I;16", 16, copy2},
|
||||
{"I;16B", "I;16B", 16, copy2},
|
||||
{"I;16L", "I;16L", 16, copy2},
|
||||
{"I;16S", "I;16S", 16, copy2},
|
||||
{"I;16", "I;16N", 16, packI16N_I16}, // LibTiff native->image endian.
|
||||
{"I;16L", "I;16N", 16, packI16N_I16},
|
||||
{"I;16B", "I;16N", 16, packI16N_I16B},
|
||||
|
|
|
@ -116,7 +116,8 @@ ImagingNewPrologueSubtype(const char *mode, int xsize, int ysize, int size)
|
|||
im->type = IMAGING_TYPE_INT32;
|
||||
|
||||
} else if (strcmp(mode, "I;16") == 0 || strcmp(mode, "I;16L") == 0 \
|
||||
|| strcmp(mode, "I;16B") == 0 || strcmp(mode, "I;16N") == 0) {
|
||||
|| strcmp(mode, "I;16B") == 0 || strcmp(mode, "I;16N") == 0 \
|
||||
|| strcmp(mode, "I;16S") == 0) {
|
||||
/* EXPERIMENTAL */
|
||||
/* 16-bit raw integer images */
|
||||
im->bands = 1;
|
||||
|
|
|
@ -1406,6 +1406,7 @@ static struct {
|
|||
{"I;16", "I;16", 16, copy2},
|
||||
{"I;16B", "I;16B", 16, copy2},
|
||||
{"I;16L", "I;16L", 16, copy2},
|
||||
{"I;16S", "I;16S", 16, copy2},
|
||||
|
||||
{"I;16", "I;16N", 16, unpackI16N_I16}, // LibTiff native->image endian.
|
||||
{"I;16L", "I;16N", 16, unpackI16N_I16}, // LibTiff native->image endian.
|
||||
|
|
Loading…
Reference in New Issue
Block a user