From f2fac0b39e452a46cd7a835297c998afb0228842 Mon Sep 17 00:00:00 2001 From: Yay295 Date: Sun, 21 Apr 2024 22:36:23 -0500 Subject: [PATCH] use mode structs in Point.c --- src/libImaging/Point.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libImaging/Point.c b/src/libImaging/Point.c index 6a4060b4b..f56ca7bfb 100644 --- a/src/libImaging/Point.c +++ b/src/libImaging/Point.c @@ -128,7 +128,7 @@ im_point_32_8(Imaging imOut, Imaging imIn, im_point_context *context) { } Imaging -ImagingPoint(Imaging imIn, const char *mode, const void *table) { +ImagingPoint(Imaging imIn, const Mode *mode, const void *table) { /* lookup table transform */ ImagingSectionCookie cookie; @@ -145,10 +145,10 @@ ImagingPoint(Imaging imIn, const char *mode, const void *table) { } if (imIn->type != IMAGING_TYPE_UINT8) { - if (imIn->type != IMAGING_TYPE_INT32 || strcmp(mode, "L") != 0) { + if (imIn->type != IMAGING_TYPE_INT32 || mode != IMAGING_MODE_L) { goto mode_mismatch; } - } else if (!imIn->image8 && strcmp(imIn->mode, mode) != 0) { + } else if (!imIn->image8 && imIn->mode != mode) { goto mode_mismatch; } @@ -209,8 +209,8 @@ ImagingPointTransform(Imaging imIn, double scale, double offset) { Imaging imOut; int x, y; - if (!imIn || (strcmp(imIn->mode, "I") != 0 && strcmp(imIn->mode, "I;16") != 0 && - strcmp(imIn->mode, "F") != 0)) { + if (!imIn || (imIn->mode != IMAGING_MODE_I && + imIn->mode != IMAGING_MODE_I_16 && imIn->mode != IMAGING_MODE_F)) { return (Imaging)ImagingError_ModeError(); } @@ -244,7 +244,7 @@ ImagingPointTransform(Imaging imIn, double scale, double offset) { ImagingSectionLeave(&cookie); break; case IMAGING_TYPE_SPECIAL: - if (strcmp(imIn->mode, "I;16") == 0) { + if (imIn->mode == IMAGING_MODE_I_16) { ImagingSectionEnter(&cookie); for (y = 0; y < imIn->ysize; y++) { char *in = (char *)imIn->image[y];