mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-28 19:06:18 +03:00
use mode structs in tkImaging.c
This commit is contained in:
parent
cb62dbbd24
commit
7a7e8380cb
|
@ -121,15 +121,18 @@ PyImagingPhotoPut(
|
|||
|
||||
/* Mode */
|
||||
|
||||
if (strcmp(im->mode, "1") == 0 || strcmp(im->mode, "L") == 0) {
|
||||
if (im->mode == IMAGING_MODE_1 || im->mode == IMAGING_MODE_L) {
|
||||
block.pixelSize = 1;
|
||||
block.offset[0] = block.offset[1] = block.offset[2] = block.offset[3] = 0;
|
||||
} else if (strncmp(im->mode, "RGB", 3) == 0) {
|
||||
} else if (
|
||||
im->mode == IMAGING_MODE_RGB || im->mode == IMAGING_MODE_RGBA ||
|
||||
im->mode == IMAGING_MODE_RGBX || im->mode == IMAGING_MODE_RGBa
|
||||
) {
|
||||
block.pixelSize = 4;
|
||||
block.offset[0] = 0;
|
||||
block.offset[1] = 1;
|
||||
block.offset[2] = 2;
|
||||
if (strcmp(im->mode, "RGBA") == 0) {
|
||||
if (im->mode == IMAGING_MODE_RGBA) {
|
||||
block.offset[3] = 3; /* alpha (or reserved, under Tk 8.2) */
|
||||
} else {
|
||||
block.offset[3] = 0; /* no alpha */
|
||||
|
|
Loading…
Reference in New Issue
Block a user