subsurface/qt-ui/printlayout.h
Lubomir I. Ivanov fc84f8868d Print: add method to convert profile to grayscale
(experimental)

Add the method PrintLayout::convertPixmapToGrayscale()
to convert a rendered profile pixmap to grayscale.
It will probably be faster to have
ProfileGraphicsView render in grayscale under certain
conditions (and use a specific color table) instead -
e.g.:

ProfileGraphicsView::setPrintMode(bool printMode,
	bool useGrayScale);

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-18 12:00:12 -07:00

40 lines
826 B
C++

#ifndef PRINTLAYOUT_H
#define PRINTLAYOUT_H
#include <QPrinter>
#include <QStringList>
class PrintDialog;
class PrintLayout : public QObject {
Q_OBJECT
public:
PrintLayout(PrintDialog *, QPrinter *, struct options *);
void print();
private:
PrintDialog *dialog;
QPrinter *printer;
struct options *printOptions;
QPainter *painter;
int screenDpiX, screenDpiY, printerDpi;
qreal scaleX, scaleY;
QRect pageRect;
QStringList tableColumnNames;
QStringList tableColumnWidths;
void setup();
void printSixDives() const;
void printTwoDives() const;
void printTable() const;
QString insertTableHeadingRow() const;
QString insertTableHeadingCol(int) const;
QString insertTableDataRow(struct dive *) const;
QString insertTableDataCol(QString) const;
QPixmap convertPixmapToGrayscale(QPixmap) const;
};
#endif