|
From: Daniele C. <dca...@in...> - 2008-03-18 17:12:05
|
I wrote:
case kQ3PixelTypeRGB32:
case kQ3PixelTypeARGB32:
{
unsigned int pixel;
pixel = ( correct ( rgbaPixels[i][3] ) << 24) |
// Alpha
( correct ( rgbaPixels[i][0] ) << 16) |
( correct ( rgbaPixels[i][1] ) << 8) |
( correct ( rgbaPixels[i][2] ) << 0 ) ;
*((unsigned int *)rowAddr) = pixel;
}
break;
For all the configuration same code.
For mac osx powerPC.............OK
For mac osx Intel.....................OK
For Windows XP.....................OK
For Windows Vista..................OK
It is not so clear but the result are correct.
Roger Holmes ha scritto:
> It looks like Red has gone to Alpha, green has gone to Red, Blue has
> gone to green and Alpha has gone to Blue.
>
>
> Try this:
>
> pixel. fourChars [ 3 ] = correct ( rgbaPixels [ i ] [ 3 ] ) ;
> pixel. fourChars [ 0 ] = correct ( rgbaPixels [ i ] [ 2 ] ) ;
> pixel. fourChars [ 1 ] = correct ( rgbaPixels [ i ] [ 1 ] ) ;
> pixel. fourChars [ 2 ] = correct ( rgbaPixels [ i ] [0 ] ) ;
>
> and if that doesn't work it must be:
>
>
> pixel. fourChars [ 1 ] = correct ( rgbaPixels [ i ] [ 3 ] ) ;
> pixel. fourChars [ 2 ] = correct ( rgbaPixels [ i ] [ 2 ] ) ;
> pixel. fourChars [ 3 ] = correct ( rgbaPixels [ i ] [ 1 ] ) ;
> pixel. fourChars [ 0 ] = correct ( rgbaPixels [ i ] [0 ] ) ;
>
> Roger.
>
>
> On 14 Mar, 2008, at 11:26, Daniele Cavallini wrote:
>
>
>> 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
>>>
>>>
>>>
>> ----------------------------------------------------------------------
>> ---
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Quesa-develop mailing list
>> Que...@li...
>> https://lists.sourceforge.net/lists/listinfo/quesa-develop
>>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Quesa-develop mailing list
> Que...@li...
> https://lists.sourceforge.net/lists/listinfo/quesa-develop
>
>
|