[Qt-interest] in fact, QImage::ARGB32 is BGRA32 ?

Rainer Wiesenfarth Rainer.Wiesenfarth at inpho.de
Wed Mar 18 15:39:35 CET 2009


From: Samuel Rødal [mailto:sroedal at trolltech.com] 
> James Yan wrote:
>  > OK, I C. :-)
>  > but, in fact my buff-modify function is requested to wrote 
>  > with in ANSI C, so no Qt-way available for such case. :(
> 
> As long as you operate on an int at a time instead of a char 
> at a time, 
> and use shift operators and bit masks to manipulate the pixel's color 
> channels, your code should be endian-independent.

Endian-independent, yes, but not platform independent: you have to take care
of the size of int ...

That is why I recommended QRgb: It is guaranteed 32bit unsigned integer, and
the access methods take care of both endian and size.

If you want to use your own datatype, it has to be unsigned and 32bit.

Best Regards / Mit freundlichen Grüßen
Rainer Wiesenfarth

-- 
INPHO GmbH * Smaragdweg 1 * 70174 Stuttgart * Germany
phone: +49 711 2288 10 * fax: +49 711 2288 111 * web: www.inpho.de
place of business: Stuttgart * managing director: Johannes Saile
commercial register: Stuttgart, HRB 9586
Leader in Photogrammetry and Digital Surface Modelling
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3359 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090318/686837a4/attachment.bin 


More information about the Qt-interest-old mailing list