Print: pass grayscale flag to setPrintMode()

We pass the value of 'color_selected' stored in the
print options to ProfileGraphicsView::setPrintMode().
This way the profile can be printed in grayscale
internally instead of converting a QPixmap to
grayscale.

There are a couple of questions here:
1) Are all the 'if/then' checks for all individual
colors faster than the direct QPixmap/QImage grayscale
coversation.
2) The direct grayscale conversation does not give
control of individual colors, but can it look actually
better?

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2013-07-13 18:09:22 +03:00 committed by Dirk Hohndel
parent 3076dc6d47
commit 17c97b921f

View file

@ -88,7 +88,7 @@ void PrintLayout::printSixDives() const
painter.scale(scaleX, scaleY);
profile->clear();
profile->setPrintMode(true);
profile->setPrintMode(true, !printOptions->color_selected);
QSize originalSize = profile->size();
profile->resize(pageRect.height()/scaleY, pageRect.width()/scaleX);
@ -108,8 +108,6 @@ void PrintLayout::printSixDives() const
QTransform transform;
transform.rotate(270);
pm = QPixmap(pm.transformed(transform));
if (!printOptions->color_selected)
pm = convertPixmapToGrayscale(pm);
painter.drawPixmap(0, 0, pm);
}
painter.end();