MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / engineMayRasterize

Method engineMayRasterize

src/core/map_printer.cpp:791–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789
790
791bool MapPrinter::engineMayRasterize() const
792{
793#ifdef Q_OS_WIN
794 /*
795 * For Windows, non-opaque drawing to QWin32PrintEngine will trigger internal
796 * rasterization in Qt (implemented in QAlphaPaintEngine), in order to do care
797 * for the printing system's incapability to handle alpha. However, this is not
798 * desired in our map printing where raster output is an explicit option.
799 *
800 * QAlphaPaintEngines rasterizes
801 * - with the device's logical resolution but at least 300 dpi,
802 * cf. QAlphaPaintEnginePrivate::drawAlphaImage(const QRectF &rect)
803 * - in tiles of 2048x2048 pixels,
804 * cf. QAlphaPaintEnginePrivate::drawAlphaImage(const QRectF &rect)
805 * - when the painter is not opaque,
806 * cf. QAlphaPaintEngine::updateState(const QPaintEngineState &state)
807 * - when the pen is not opaque,
808 * cf. QAlphaPaintEngine::updateState(const QPaintEngineState &state)
809 * - when the brush is not opaque,
810 * cf. QAlphaPaintEngine::updateState(const QPaintEngineState &state)
811 */
812 return !rasterModeSelected()
813 && target != pdfTarget()
814 && target != imageTarget();
815#else
816 /*
817 * For macOS (Cocoa), QMacPrintEngine does not rasterize.
818 *
819 * For Linux (CUPS), QCupsPrintEngine is based on QPdfEngine
820 * (via QPdfPrintEngine) which does not rasterize. (However, the print
821 * queue may rasterize, even when *spooling* to a PDF file. The vector
822 * output is preserved when redirecting the output to a file in
823 * Print... > Preview... > Print > Output file [...].)
824 */
825 return false;
826#endif
827}
828
829bool MapPrinter::engineWillRasterize() const
830{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected