QwtPlotRenderer
Brought to you by:
rathmann
line 300 of qwt_plot_renderer.cpp
QImage image( imageRect.size(), QImage::Format_ARGB32 );
From http://doc.qt.io/qt-5/qimage.html#Format-enum
Note: Do not render into ARGB32 images using QPainter. Using QImage::Format_ARGB32_Premultiplied is significantly faster.
Is there a good reason to render into ARGB32?
Qt recomment to use Format_ARGB32_Premultiplied instead.
Other way is to provide a setter to change the QImage Format in qwt_plot_renderer.cpp.
Anonymous
I'm aware of the statement in the Qt docs, but I've never crossed an operation in the context of Qwt, where this statement proved to be true. Maybe for operations between images, but when manipualting RGB values directly ( spectrogram ) I would consider ARGB32 being faster - if there is much difference at all.
In QwtPlotRenderer there is only one occurence of a QImage - a temporary buffer used on the way for writing it to disk. In this context you can be sure, that the format will completely unimportant compared to what it takes to convert/store it to disk.
Just in case: QwtPlotRenderer::renderDocument() is a convenience method only and you could also decide to use a different format, when using a more low level method.
But please try yourself and let me know if you found operations where you prove of being faster with Format_ARGB32_Premultiplied.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Hi Uwe,
i checked ARGB32 and ARGB32_Premultiplied with a plot that contains same data with an export to PNG
file with 300dpi and 600dpi.
ARGB32 was quicker. I cant' confirm the official statement from Qt that ARGB32_Premultiplied should be
quicker. ARGB32 was less than 4% quicker.
I think the current setting ARGB32 is the better choice for Qwt.