|
From: Daniele C. <dca...@in...> - 2008-03-14 11:27:04
|
I tried to implement this solution but it don't work well. (I set anUnsignedInt like TQ3Uns32 ) The create colors aren't correct. You can see As it would have to be http://www.interstudio.net/quesa/init.jpg as it is http://www.interstudio.net/quesa/res.jpg I use imac intel. I don't know why doesn't work. It isn't a good solution to use #define /QUESA_HOST_IS_BIG_ENDIAN /because there are mac with intel and powerpc processor. How I know in runtime if computer have an intel or powerpc processor? Have you Some ideas? // Roger Holmes ha scritto: > On the other hand, if we define > > union longAndFourChars > { > char fourChars [ 4 ] ; > unsigned long int anUnsignedInt ; > } > > longAndFourChars pixel ; > > then > > pixel. fourChars [ 0 ] = correct ( rgbaPixels [ i ] [ 3 ] ) ;// Alpha > pixel. fourChars [ 1 ] = correct ( rgbaPixels [ i ] [ 2 ] ) ; > pixel. fourChars [ 2 ] = correct ( rgbaPixels [ i ] [ 1 ] ) ; > pixel. fourChars [ 3 ] = correct ( rgbaPixels [ i ] [0 ] ) ; > > * ( ( unsigned int* ) rowAddr ) = pixel. anUnsignedInt ; > > > > Then won't that work on either endian machine? > > Roger. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Quesa-develop mailing list > Que...@li... > https://lists.sourceforge.net/lists/listinfo/quesa-develop > > |