A blog about random things and sometimes about my work translating and developing KDE and anything
Showing posts with label qimage. Show all posts
Showing posts with label qimage. Show all posts
Sunday, September 09, 2012
Trobadour knowledge about QImage
If you are using QImage::Format_RGB32 and the QImage constructor that takes uchar * data make sure your format is 0xffRRGGBB (i.e. the missing alpha channel is exactly 0xff) otherwise some operations won't work.
Thursday, October 04, 2007
QImage::Format_ARGB32_Premultiplied is your friend
If you have looked at QImage in Qt4 you'll have noticed that there is the typical QImage::Format_RGB32 and QImage::Format_ARGB32 plus QImage::Format_ARGB32_Premultiplied.
Maybe you have wondered why is there, well, i'll tell you, it's FAST.
I have done a simple test rendering 100 times gear-flowers.svg wallpaper in a qimage of 1024x768. The results follow
RGB32: 20351 msec
ARGB32: 39273 msec
ARGB32_Premultiplied: 20248 msec
So if you look at the numbers, you'll see ARGB32_Premultiplied is actually faster than RGB32 that is not even producing correct results.
So QImage::Format_ARGB32_Premultiplied should be probably renamed to QImage::Format_ARGB32_UseMeBecauseImFast :D
Maybe you have wondered why is there, well, i'll tell you, it's FAST.
I have done a simple test rendering 100 times gear-flowers.svg wallpaper in a qimage of 1024x768. The results follow
RGB32: 20351 msec
ARGB32: 39273 msec
ARGB32_Premultiplied: 20248 msec
So if you look at the numbers, you'll see ARGB32_Premultiplied is actually faster than RGB32 that is not even producing correct results.
So QImage::Format_ARGB32_Premultiplied should be probably renamed to QImage::Format_ARGB32_UseMeBecauseImFast :D
Subscribe to:
Posts (Atom)