use mode structs in BoxBlur.c

This commit is contained in:
Yay295 2024-04-21 14:00:44 -05:00
parent 74b112dd55
commit 08575c682e

View File

@ -248,7 +248,7 @@ ImagingBoxBlur(Imaging imOut, Imaging imIn, float xradius, float yradius, int n)
return ImagingError_ValueError("radius must be >= 0"); return ImagingError_ValueError("radius must be >= 0");
} }
if (strcmp(imIn->mode, imOut->mode) || imIn->type != imOut->type || if (imIn->mode != imOut->mode || imIn->type != imOut->type ||
imIn->bands != imOut->bands || imIn->xsize != imOut->xsize || imIn->bands != imOut->bands || imIn->xsize != imOut->xsize ||
imIn->ysize != imOut->ysize) { imIn->ysize != imOut->ysize) {
return ImagingError_Mismatch(); return ImagingError_Mismatch();
@ -258,10 +258,10 @@ ImagingBoxBlur(Imaging imOut, Imaging imIn, float xradius, float yradius, int n)
return ImagingError_ModeError(); return ImagingError_ModeError();
} }
if (!(strcmp(imIn->mode, "RGB") == 0 || strcmp(imIn->mode, "RGBA") == 0 || if (imIn->mode != IMAGING_MODE_RGB && imIn->mode != IMAGING_MODE_RGBA &&
strcmp(imIn->mode, "RGBa") == 0 || strcmp(imIn->mode, "RGBX") == 0 || imIn->mode != IMAGING_MODE_RGBa && imIn->mode != IMAGING_MODE_RGBX &&
strcmp(imIn->mode, "CMYK") == 0 || strcmp(imIn->mode, "L") == 0 || imIn->mode != IMAGING_MODE_CMYK && imIn->mode != IMAGING_MODE_L &&
strcmp(imIn->mode, "LA") == 0 || strcmp(imIn->mode, "La") == 0)) { imIn->mode != IMAGING_MODE_LA && imIn->mode != IMAGING_MODE_La) {
return ImagingError_ModeError(); return ImagingError_ModeError();
} }