Re: [sdljava-users] Anyone using get/setPixelDataXX()?
Status: Beta
Brought to you by:
ivan_ganza
From: Ivan Z. G. <iva...@ya...> - 2005-07-19 02:08:05
|
Interesting... I've had a look at vncJ. I didn't even know such a thing existed. vnc is an awesome program! I'm not sure why the swig team choose to use long. Probably because they wanted to support arithmetic operations. I see now that in our case, since we interpret as pixel data, things are different. I will investigate changing this but only when dealing with pixel data. The other instances of uint32 should remain longs I think. -Ivan/ S. Meslin-Weber wrote: >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 >>range is not the same as the unsigned 32 bit int. >> >>Java Data Types: >> >>int >> 4 bytes, signed (two's complement). -2,147,483,648 to >>2,147,483,647. Like all numeric types ints may be cast into other >> >> > >[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 > > > |