Revert "Fix C extension build warnings"
This reverts commit 03a8697866.
Turns out there was a good reason for this: it makes Overviewer work on
Debian. Why? Who knows. It's a mystery.
This commit is contained in:
@@ -64,6 +64,13 @@
|
|||||||
#define INK8(ink) (*(UINT8*)ink)
|
#define INK8(ink) (*(UINT8*)ink)
|
||||||
#define INK32(ink) (*(INT32*)ink)
|
#define INK32(ink) (*(INT32*)ink)
|
||||||
|
|
||||||
|
/* like (a * b + 127) / 255), but much faster on most platforms */
|
||||||
|
#define MULDIV255(a, b, tmp)\
|
||||||
|
(tmp = (a) * (b) + 128, ((((tmp) >> 8) + (tmp)) >> 8))
|
||||||
|
|
||||||
|
#define BLEND(mask, in1, in2, tmp1, tmp2)\
|
||||||
|
(MULDIV255(in1, 255 - mask, tmp1) + MULDIV255(in2, mask, tmp2))
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/* Primitives */
|
/* Primitives */
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
@@ -93,14 +100,14 @@ point32(Imaging im, int x, int y, int ink)
|
|||||||
static inline void
|
static inline void
|
||||||
point32rgba(Imaging im, int x, int y, int ink)
|
point32rgba(Imaging im, int x, int y, int ink)
|
||||||
{
|
{
|
||||||
unsigned int tmp1;
|
unsigned int tmp1, tmp2;
|
||||||
|
|
||||||
if (x >= 0 && x < im->xsize && y >= 0 && y < im->ysize) {
|
if (x >= 0 && x < im->xsize && y >= 0 && y < im->ysize) {
|
||||||
UINT8* out = (UINT8*) im->image[y]+x*4;
|
UINT8* out = (UINT8*) im->image[y]+x*4;
|
||||||
UINT8* in = (UINT8*) &ink;
|
UINT8* in = (UINT8*) &ink;
|
||||||
out[0] = BLEND(in[3], out[0], in[0], tmp1);
|
out[0] = BLEND(in[3], out[0], in[0], tmp1, tmp2);
|
||||||
out[1] = BLEND(in[3], out[1], in[1], tmp1);
|
out[1] = BLEND(in[3], out[1], in[1], tmp1, tmp2);
|
||||||
out[2] = BLEND(in[3], out[2], in[2], tmp1);
|
out[2] = BLEND(in[3], out[2], in[2], tmp1, tmp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +159,7 @@ static inline void
|
|||||||
hline32rgba(Imaging im, int x0, int y0, int x1, int ink)
|
hline32rgba(Imaging im, int x0, int y0, int x1, int ink)
|
||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
unsigned int tmp1;
|
unsigned int tmp1, tmp2;
|
||||||
|
|
||||||
if (y0 >= 0 && y0 < im->ysize) {
|
if (y0 >= 0 && y0 < im->ysize) {
|
||||||
if (x0 > x1)
|
if (x0 > x1)
|
||||||
@@ -169,9 +176,9 @@ hline32rgba(Imaging im, int x0, int y0, int x1, int ink)
|
|||||||
UINT8* out = (UINT8*) im->image[y0]+x0*4;
|
UINT8* out = (UINT8*) im->image[y0]+x0*4;
|
||||||
UINT8* in = (UINT8*) &ink;
|
UINT8* in = (UINT8*) &ink;
|
||||||
while (x0 <= x1) {
|
while (x0 <= x1) {
|
||||||
out[0] = BLEND(in[3], out[0], in[0], tmp1);
|
out[0] = BLEND(in[3], out[0], in[0], tmp1, tmp2);
|
||||||
out[1] = BLEND(in[3], out[1], in[1], tmp1);
|
out[1] = BLEND(in[3], out[1], in[1], tmp1, tmp2);
|
||||||
out[2] = BLEND(in[3], out[2], in[2], tmp1);
|
out[2] = BLEND(in[3], out[2], in[2], tmp1, tmp2);
|
||||||
x0++; out += 4;
|
x0++; out += 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
// increment this value if you've made a change to the c extesion
|
// increment this value if you've made a change to the c extesion
|
||||||
// and want to force users to rebuild
|
// and want to force users to rebuild
|
||||||
#define OVERVIEWER_EXTENSION_VERSION 55
|
#define OVERVIEWER_EXTENSION_VERSION 54
|
||||||
|
|
||||||
/* Python PIL, and numpy headers */
|
/* Python PIL, and numpy headers */
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
@@ -42,6 +42,11 @@
|
|||||||
/* Fix Pillow on mingw-w64 which includes windows.h in Imaging.h */
|
/* Fix Pillow on mingw-w64 which includes windows.h in Imaging.h */
|
||||||
#undef TRANSPARENT
|
#undef TRANSPARENT
|
||||||
|
|
||||||
|
/* like (a * b + 127) / 255), but much faster on most platforms
|
||||||
|
from PIL's _imaging.c */
|
||||||
|
#define MULDIV255(a, b, tmp) \
|
||||||
|
(tmp = (a) * (b) + 128, ((((tmp) >> 8) + (tmp)) >> 8))
|
||||||
|
|
||||||
/* macro for getting a value out of various numpy arrays the 3D arrays have
|
/* macro for getting a value out of various numpy arrays the 3D arrays have
|
||||||
interesting, swizzled coordinates because minecraft (anvil) stores blocks
|
interesting, swizzled coordinates because minecraft (anvil) stores blocks
|
||||||
in y/z/x order for 3D, z/x order for 2D */
|
in y/z/x order for 3D, z/x order for 2D */
|
||||||
|
|||||||
Reference in New Issue
Block a user