mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
3076dc6d47
commit
17c97b921f
1 changed files with 1 additions and 3 deletions
|
@ -88,7 +88,7 @@ void PrintLayout::printSixDives() const
|
||||||
painter.scale(scaleX, scaleY);
|
painter.scale(scaleX, scaleY);
|
||||||
|
|
||||||
profile->clear();
|
profile->clear();
|
||||||
profile->setPrintMode(true);
|
profile->setPrintMode(true, !printOptions->color_selected);
|
||||||
QSize originalSize = profile->size();
|
QSize originalSize = profile->size();
|
||||||
profile->resize(pageRect.height()/scaleY, pageRect.width()/scaleX);
|
profile->resize(pageRect.height()/scaleY, pageRect.width()/scaleX);
|
||||||
|
|
||||||
|
@ -108,8 +108,6 @@ void PrintLayout::printSixDives() const
|
||||||
QTransform transform;
|
QTransform transform;
|
||||||
transform.rotate(270);
|
transform.rotate(270);
|
||||||
pm = QPixmap(pm.transformed(transform));
|
pm = QPixmap(pm.transformed(transform));
|
||||||
if (!printOptions->color_selected)
|
|
||||||
pm = convertPixmapToGrayscale(pm);
|
|
||||||
painter.drawPixmap(0, 0, pm);
|
painter.drawPixmap(0, 0, pm);
|
||||||
}
|
}
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
Loading…
Add table
Reference in a new issue