mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 08:12:33 +03:00
reverted int32 changes
This commit is contained in:
parent
77c36d6edc
commit
1dd80b2625
|
@ -42,10 +42,6 @@ def test_signedness():
|
||||||
check(mode, 2**15+1)
|
check(mode, 2**15+1)
|
||||||
check(mode, 2**16-1)
|
check(mode, 2**16-1)
|
||||||
|
|
||||||
check("I", 2**31-1)
|
|
||||||
check("I", 2**31)
|
|
||||||
check("I", 2**31+1)
|
|
||||||
check("I", 2**32-1)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -464,7 +464,7 @@ getpixel(Imaging im, ImagingAccess access, int x, int y)
|
||||||
union {
|
union {
|
||||||
UINT8 b[4];
|
UINT8 b[4];
|
||||||
UINT16 h;
|
UINT16 h;
|
||||||
UINT32 i;
|
INT32 i;
|
||||||
FLOAT32 f;
|
FLOAT32 f;
|
||||||
} pixel;
|
} pixel;
|
||||||
|
|
||||||
|
|
|
@ -125,11 +125,11 @@ static void
|
||||||
get_pixel_32L(Imaging im, int x, int y, void* color)
|
get_pixel_32L(Imaging im, int x, int y, void* color)
|
||||||
{
|
{
|
||||||
UINT8* in = (UINT8*) &im->image[y][x*4];
|
UINT8* in = (UINT8*) &im->image[y][x*4];
|
||||||
UINT32* out = color;
|
INT32* out = color;
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
out[0] = in[0] + (in[1]<<8) + (in[2]<<16) + (in[3]<<24);
|
out[0] = in[0] + (in[1]<<8) + (in[2]<<16) + (in[3]<<24);
|
||||||
#else
|
#else
|
||||||
out[0] = *(UINT32*) in;
|
out[0] = *(INT32*) in;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,9 +137,9 @@ static void
|
||||||
get_pixel_32B(Imaging im, int x, int y, void* color)
|
get_pixel_32B(Imaging im, int x, int y, void* color)
|
||||||
{
|
{
|
||||||
UINT8* in = (UINT8*) &im->image[y][x*4];
|
UINT8* in = (UINT8*) &im->image[y][x*4];
|
||||||
UINT32* out = color;
|
INT32* out = color;
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
out[0] = *(UINT32*) in;
|
out[0] = *(INT32*) in;
|
||||||
#else
|
#else
|
||||||
out[0] = in[3] + (in[2]<<8) + (in[1]<<16) + (in[0]<<24);
|
out[0] = in[3] + (in[2]<<8) + (in[1]<<16) + (in[0]<<24);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user