[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] surface.map_rgb() returns signed int, surfarray.array2d unsigned int



Hi,

I am writing more unit tests for surfarray after completing the blit_array tests. Right now I am working on array2d. It would seem natural to compare the elements of an array returned by array2d with values returned by map_rgb for the surface used to create the array. But it is not that easy. map_rgb returns a signed integer. The array is unsigned. So, though the two numbers may represent the same pixel value, they cannot be directly compared for assertion tests. It also brings up another issue, shouldn't map_rgb be compatible with array2d and blit_array. How else would one format surface specific pixel values from Color values. So the question is, do I change map_rgb to return an unsigned value as a Python long? Would this break anything?

Lenard

--
Lenard Lindstrom
<len-l@xxxxxxxxx>