16 #ifndef QGSMULTIRENDERCHECKER_H 17 #define QGSMULTIRENDERCHECKER_H 19 #include "qgis_core.h" 69 void setControlName(
const QString &name );
71 void setControlPathPrefix(
const QString &prefix );
79 void setRenderedImage(
const QString &renderedImagePath ) { mRenderedImage = renderedImagePath; }
103 void setSizeTolerance(
int xTolerance,
int yTolerance ) { mMaxSizeDifferenceX = xTolerance; mMaxSizeDifferenceY = yTolerance; }
118 bool runTest(
const QString &testName,
unsigned int mismatchCount = 0 );
125 QString
report()
const {
return mReport; }
131 QString controlImagePath()
const;
141 QString mRenderedImage;
142 QString mControlName;
143 QString mControlPathPrefix;
144 unsigned int mColorTolerance = 0;
145 int mMaxSizeDifferenceX = 0;
146 int mMaxSizeDifferenceY = 0;
169 QgsLayoutChecker(
const QString &testName,
QgsLayout *layout );
174 void setSize( QSize size ) { mSize = size; }
190 bool testLayout( QString &report,
int page = 0,
int pixelDiff = 0,
bool createReferenceImage =
false );
193 QgsLayoutChecker() =
delete;
206 #endif // QGSMULTIRENDERCHECKER_H void setColorTolerance(unsigned int colorTolerance)
Set tolerance for color components used by runTest() Default value is 0.
void setSizeTolerance(int xTolerance, int yTolerance)
Sets the largest allowable difference in size between the rendered and the expected image...
QString report() const
Returns a report for this test.
The QgsMapSettings class contains configuration for rendering of the map.
This class allows checking rendered images against comparison images.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
#define SIP_IF_FEATURE(feature)
static void drawBackground(QImage *image)
Draws a checkboard pattern for image backgrounds, so that opacity is visible without requiring a tran...
#define SIP_FEATURE(feature)
static void drawBackground(QImage *image)
Draws a checkboard pattern for image backgrounds, so that opacity is visible without requiring a tran...
void setRenderedImage(const QString &renderedImagePath)
Set the path to the rendered image.