Combined conditions

This commit is contained in:
Andrew Murray 2024-04-25 16:16:33 +10:00
parent 4241836012
commit bbd5a87e60

View File

@ -213,34 +213,37 @@ cms_transform_dealloc(CmsTransformObject *self) {
static cmsUInt32Number static cmsUInt32Number
findLCMStype(char *PILmode) { findLCMStype(char *PILmode) {
if (strcmp(PILmode, "RGB") == 0) { if (
strcmp(PILmode, "RGB") == 0 ||
strcmp(PILmode, "RGBA") == 0 ||
strcmp(PILmode, "RGBX") == 0
) {
return TYPE_RGBA_8; return TYPE_RGBA_8;
} else if (strcmp(PILmode, "RGBA") == 0) { }
return TYPE_RGBA_8; if (strcmp(PILmode, "RGBA;16B") == 0) {
} else if (strcmp(PILmode, "RGBX") == 0) {
return TYPE_RGBA_8;
} else if (strcmp(PILmode, "RGBA;16B") == 0) {
return TYPE_RGBA_16; return TYPE_RGBA_16;
} else if (strcmp(PILmode, "CMYK") == 0) { }
if (strcmp(PILmode, "CMYK") == 0) {
return TYPE_CMYK_8; return TYPE_CMYK_8;
} else if (strcmp(PILmode, "L") == 0) { }
return TYPE_GRAY_8; if (strcmp(PILmode, "L;16") == 0) {
} else if (strcmp(PILmode, "L;16") == 0) {
return TYPE_GRAY_16; return TYPE_GRAY_16;
} else if (strcmp(PILmode, "L;16B") == 0) { }
if (strcmp(PILmode, "L;16B") == 0) {
return TYPE_GRAY_16_SE; return TYPE_GRAY_16_SE;
} else if (strcmp(PILmode, "YCCA") == 0) { }
if (
strcmp(PILmode, "YCCA") == 0 ||
strcmp(PILmode, "YCC") == 0
) {
return TYPE_YCbCr_8; return TYPE_YCbCr_8;
} else if (strcmp(PILmode, "YCC") == 0) { }
return TYPE_YCbCr_8; if (strcmp(PILmode, "LAB") == 0) {
} else if (strcmp(PILmode, "LAB") == 0) {
// LabX equivalent like ALab, but not reversed -- no #define in lcms2 // LabX equivalent like ALab, but not reversed -- no #define in lcms2
return (COLORSPACE_SH(PT_LabV2) | CHANNELS_SH(3) | BYTES_SH(1) | EXTRA_SH(1)); return (COLORSPACE_SH(PT_LabV2) | CHANNELS_SH(3) | BYTES_SH(1) | EXTRA_SH(1));
} }
else { /* presume "L" by default */
/* take a wild guess... */
return TYPE_GRAY_8; return TYPE_GRAY_8;
}
} }
#define Cms_Min(a, b) ((a) < (b) ? (a) : (b)) #define Cms_Min(a, b) ((a) < (b) ? (a) : (b))