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
ImagingFillLinearGradient(const char *mode) {
ImagingFillLinearGradient(const Mode *mode) {
Imaging im;
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();
}
@ -102,12 +105,15 @@ ImagingFillLinearGradient(const char *mode) {
}
Imaging
ImagingFillRadialGradient(const char *mode) {
ImagingFillRadialGradient(const Mode *mode) {
Imaging im;
int x, y;
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();
}