mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-16 04:16:35 +03:00
use mode structs in Chops.c
This commit is contained in:
parent
08575c682e
commit
5197ad775c
|
@ -60,11 +60,11 @@
|
||||||
return imOut;
|
return imOut;
|
||||||
|
|
||||||
static Imaging
|
static Imaging
|
||||||
create(Imaging im1, Imaging im2, char *mode) {
|
create(Imaging im1, Imaging im2, const Mode *mode) {
|
||||||
int xsize, ysize;
|
int xsize, ysize;
|
||||||
|
|
||||||
if (!im1 || !im2 || im1->type != IMAGING_TYPE_UINT8 ||
|
if (!im1 || !im2 || im1->type != IMAGING_TYPE_UINT8 ||
|
||||||
(mode != NULL && (strcmp(im1->mode, "1") || strcmp(im2->mode, "1")))) {
|
(mode != NULL && (im1->mode != mode || im2->mode != mode))) {
|
||||||
return (Imaging)ImagingError_ModeError();
|
return (Imaging)ImagingError_ModeError();
|
||||||
}
|
}
|
||||||
if (im1->type != im2->type || im1->bands != im2->bands) {
|
if (im1->type != im2->type || im1->bands != im2->bands) {
|
||||||
|
@ -114,17 +114,17 @@ ImagingChopSubtract(Imaging imIn1, Imaging imIn2, float scale, int offset) {
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
ImagingChopAnd(Imaging imIn1, Imaging imIn2) {
|
ImagingChopAnd(Imaging imIn1, Imaging imIn2) {
|
||||||
CHOP2((in1[x] && in2[x]) ? 255 : 0, "1");
|
CHOP2((in1[x] && in2[x]) ? 255 : 0, IMAGING_MODE_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
ImagingChopOr(Imaging imIn1, Imaging imIn2) {
|
ImagingChopOr(Imaging imIn1, Imaging imIn2) {
|
||||||
CHOP2((in1[x] || in2[x]) ? 255 : 0, "1");
|
CHOP2((in1[x] || in2[x]) ? 255 : 0, IMAGING_MODE_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
ImagingChopXor(Imaging imIn1, Imaging imIn2) {
|
ImagingChopXor(Imaging imIn1, Imaging imIn2) {
|
||||||
CHOP2(((in1[x] != 0) ^ (in2[x] != 0)) ? 255 : 0, "1");
|
CHOP2(((in1[x] != 0) ^ (in2[x] != 0)) ? 255 : 0, IMAGING_MODE_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Imaging
|
Imaging
|
||||||
|
|
Loading…
Reference in New Issue
Block a user