Re: [sdljava-users] Anyone using get/setPixelDataXX()?
Status: Beta
Brought to you by:
ivan_ganza
From: S. Meslin-W. <st...@ta...> - 2005-07-18 22:18:47
|
Hi Rainer, On Tue, Jul 19, 2005 at 12:04:57AM +0200, Rainer Koschnick wrote: > Maybe there's nothing to fix. Java primitives are always signed so the= =20 > range is not the same as the unsigned 32 bit int. > > Java Data Types: >=20 > int > 4 bytes, signed (two's complement). -2,147,483,648 to=20 > 2,147,483,647. Like all numeric types ints may be cast into other=20 [snip] So... 32 bits, right? we're dealing with pixel data here, not arithmetic operations. When I deal with colour information, each byte is treated as unsigned and upcasted to int (Java does love its ints); things are then repacked into 32bits, again ignoring signs. The fact that Java deems them signed isn't relevant in this context. So ok, since SWIG is multipurpose, perhaps we simply need to let it know that we have a specific interpretation of these type conversions? Cheers, Steph --=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Stephane Meslin-Weber Email: st...@ta... Senior Software Engineer Web: http://odonata.tangency.co.uk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D |