[Qt-interest] QImage and ARGB32_Premultiplied

Thiago Macieira thiago at kde.org
Sun Jan 30 00:12:26 CET 2011


On Saturday, 29 de January de 2011 14:41:14 Joshua Grauman wrote:
> 1) If I have one QImage that is ARGB32_Premultiplied and one that is
> ARGB32, if I assign one into the other (ie. image1=image2), will QImage do
> the conversion for me?

No. The two images will be equal (QImage is implicitly shared). They will be 
both of the same format, with the exact same pixel content.

> 3) Seeing that setAlphaChannel() is deprecated, what is the fastest way to
> set the alpha channel to a single value for an entire image (for an
> ARGB32_Premultiplied QImage). Do I have to iterate over each pixel and
> calculate/set the premultiplied values?

Probably by blending with another image that has an alpha channel. Iterating 
would be slower than doing the blend.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110130/d8fceb0b/attachment.bin 


More information about the Qt-interest-old mailing list