[Qt-interest] QImage and ARGB32_Premultiplied
Joshua Grauman
jnfo-c at grauman.com
Sat Jan 29 23:41:14 CET 2011
Hello all,
I've been trying to figure out how to combine two QImages in the best way
possible (to fade between them) and have some easy questions that have
been troubling me and so I thought I'd ask for some clarification.
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?
2) When calling QImage::setPixel() and QImage::pixel() on a
ARGB32_Premultiplied QImage, do these functions set/return premultiplied
values, or does QImage convert the values. Ie. if I call
setPixel(x,y,0x80FF00FF) will the pixel have an Alpha:128, Red:255,
Blue:0, Green:255? or are the Red, Green, and Blue values invalid in this
case?
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?
Thanks, that's it for now!
Josh
More information about the Qt-interest-old
mailing list