fix fill_mask_L() by adding more parentheses to the macros it uses

This commit is contained in:
Yay295 2022-08-22 18:44:30 -05:00
parent 96e791b037
commit 1f1dfc3fb7

View File

@ -14,16 +14,16 @@
#define MASK_UINT32_CHANNEL_3 0xff000000
#endif
#define SHIFTFORDIV255(a) ((((a) >> 8) + a) >> 8)
#define SHIFTFORDIV255(a) ((((a) >> 8) + (a)) >> 8)
/* like (a * b + 127) / 255), but much faster on most platforms */
#define MULDIV255(a, b, tmp) (tmp = (a) * (b) + 128, SHIFTFORDIV255(tmp))
#define DIV255(a, tmp) (tmp = (a) + 128, SHIFTFORDIV255(tmp))
#define BLEND(mask, in1, in2, tmp1) DIV255(in1 *(255 - mask) + in2 * mask, tmp1)
#define BLEND(mask, in1, in2, tmp1) DIV255((in1) * (255 - (mask)) + (in2) * (mask), tmp1)
#define PREBLEND(mask, in1, in2, tmp1) (MULDIV255(in1, (255 - mask), tmp1) + in2)
#define PREBLEND(mask, in1, in2, tmp1) (MULDIV255(in1, 255 - (mask), tmp1) + (in2))
#define CLIP8(v) ((v) <= 0 ? 0 : (v) < 256 ? (v) : 255)