use mode structs in Fill.c

This commit is contained in:
Yay295 2024-04-21 19:27:30 -05:00
parent e6d2f9a642
commit d2e691c788

View File

@ -68,11 +68,14 @@ ImagingFill(Imaging im, const void *colour) {
} }
Imaging Imaging
ImagingFillLinearGradient(const char *mode) { ImagingFillLinearGradient(const Mode *mode) {
Imaging im; Imaging im;
int y; int y;
if (strlen(mode) != 1) { if (mode != IMAGING_MODE_1 && mode != IMAGING_MODE_F &&
mode != IMAGING_MODE_I && mode != IMAGING_MODE_L &&
mode != IMAGING_MODE_P
) {
return (Imaging)ImagingError_ModeError(); return (Imaging)ImagingError_ModeError();
} }
@ -102,12 +105,15 @@ ImagingFillLinearGradient(const char *mode) {
} }
Imaging Imaging
ImagingFillRadialGradient(const char *mode) { ImagingFillRadialGradient(const Mode *mode) {
Imaging im; Imaging im;
int x, y; int x, y;
int d; int d;
if (strlen(mode) != 1) { if (mode != IMAGING_MODE_1 && mode != IMAGING_MODE_F &&
mode != IMAGING_MODE_I && mode != IMAGING_MODE_L &&
mode != IMAGING_MODE_P
) {
return (Imaging)ImagingError_ModeError(); return (Imaging)ImagingError_ModeError();
} }