Merge pull request #4619 from radarhere/unused

This commit is contained in:
Hugo van Kemenade 2020-05-31 23:20:06 +03:00 committed by GitHub
commit 9f4c5810ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,10 +19,10 @@
#include "Imaging.h" #include "Imaging.h"
#define CHOP(operation, mode)\ #define CHOP(operation)\
int x, y;\ int x, y;\
Imaging imOut;\ Imaging imOut;\
imOut = create(imIn1, imIn2, mode);\ imOut = create(imIn1, imIn2, NULL);\
if (!imOut) {\ if (!imOut) {\
return NULL;\ return NULL;\
}\ }\
@ -83,43 +83,43 @@ create(Imaging im1, Imaging im2, char* mode)
Imaging Imaging
ImagingChopLighter(Imaging imIn1, Imaging imIn2) ImagingChopLighter(Imaging imIn1, Imaging imIn2)
{ {
CHOP((in1[x] > in2[x]) ? in1[x] : in2[x], NULL); CHOP((in1[x] > in2[x]) ? in1[x] : in2[x]);
} }
Imaging Imaging
ImagingChopDarker(Imaging imIn1, Imaging imIn2) ImagingChopDarker(Imaging imIn1, Imaging imIn2)
{ {
CHOP((in1[x] < in2[x]) ? in1[x] : in2[x], NULL); CHOP((in1[x] < in2[x]) ? in1[x] : in2[x]);
} }
Imaging Imaging
ImagingChopDifference(Imaging imIn1, Imaging imIn2) ImagingChopDifference(Imaging imIn1, Imaging imIn2)
{ {
CHOP(abs((int) in1[x] - (int) in2[x]), NULL); CHOP(abs((int) in1[x] - (int) in2[x]));
} }
Imaging Imaging
ImagingChopMultiply(Imaging imIn1, Imaging imIn2) ImagingChopMultiply(Imaging imIn1, Imaging imIn2)
{ {
CHOP((int) in1[x] * (int) in2[x] / 255, NULL); CHOP((int) in1[x] * (int) in2[x] / 255);
} }
Imaging Imaging
ImagingChopScreen(Imaging imIn1, Imaging imIn2) ImagingChopScreen(Imaging imIn1, Imaging imIn2)
{ {
CHOP(255 - ((int) (255 - in1[x]) * (int) (255 - in2[x])) / 255, NULL); CHOP(255 - ((int) (255 - in1[x]) * (int) (255 - in2[x])) / 255);
} }
Imaging Imaging
ImagingChopAdd(Imaging imIn1, Imaging imIn2, float scale, int offset) ImagingChopAdd(Imaging imIn1, Imaging imIn2, float scale, int offset)
{ {
CHOP(((int) in1[x] + (int) in2[x]) / scale + offset, NULL); CHOP(((int) in1[x] + (int) in2[x]) / scale + offset);
} }
Imaging Imaging
ImagingChopSubtract(Imaging imIn1, Imaging imIn2, float scale, int offset) ImagingChopSubtract(Imaging imIn1, Imaging imIn2, float scale, int offset)
{ {
CHOP(((int) in1[x] - (int) in2[x]) / scale + offset, NULL); CHOP(((int) in1[x] - (int) in2[x]) / scale + offset);
} }
Imaging Imaging