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:
Tom Goddard 2017-06-13 18:24:07 -07:00 committed by wiredfool
parent 1f61c4efd4
commit 69a179af25
4 changed files with 5 additions and 1 deletions

View File

@ -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);

View File

@ -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},

View File

@ -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;

View File

@ -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.