mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-01 04:46:18 +03:00
use mode structs in Matrix.c
This commit is contained in:
parent
68028fd513
commit
e598741876
|
@ -18,7 +18,7 @@
|
||||||
#define CLIPF(v) ((v <= 0.0) ? 0 : (v >= 255.0F) ? 255 : (UINT8)v)
|
#define CLIPF(v) ((v <= 0.0) ? 0 : (v >= 255.0F) ? 255 : (UINT8)v)
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
ImagingConvertMatrix(Imaging im, const char *mode, float m[]) {
|
ImagingConvertMatrix(Imaging im, const Mode *mode, float m[]) {
|
||||||
Imaging imOut;
|
Imaging imOut;
|
||||||
int x, y;
|
int x, y;
|
||||||
ImagingSectionCookie cookie;
|
ImagingSectionCookie cookie;
|
||||||
|
@ -28,8 +28,8 @@ ImagingConvertMatrix(Imaging im, const char *mode, float m[]) {
|
||||||
return (Imaging)ImagingError_ModeError();
|
return (Imaging)ImagingError_ModeError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(mode, "L") == 0) {
|
if (mode == IMAGING_MODE_L) {
|
||||||
imOut = ImagingNewDirty("L", im->xsize, im->ysize);
|
imOut = ImagingNewDirty(IMAGING_MODE_L, im->xsize, im->ysize);
|
||||||
if (!imOut) {
|
if (!imOut) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -46,8 +46,7 @@ ImagingConvertMatrix(Imaging im, const char *mode, float m[]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImagingSectionLeave(&cookie);
|
ImagingSectionLeave(&cookie);
|
||||||
|
} else if (strlen(mode->name) == 3) {
|
||||||
} else if (strlen(mode) == 3) {
|
|
||||||
imOut = ImagingNewDirty(mode, im->xsize, im->ysize);
|
imOut = ImagingNewDirty(mode, im->xsize, im->ysize);
|
||||||
if (!imOut) {
|
if (!imOut) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user