QGIS API Documentation  2.10.1-Pisa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsmultirenderchecker.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmultirenderchecker.h
3  --------------------------------------
4  Date : 6.11.2014
5  Copyright : (C) 2014 Matthias Kuhn
6  Email : matthias dot kuhn at gmx dot ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSMULTIRENDERCHECKER_H
17 #define QGSMULTIRENDERCHECKER_H
18 
19 #include "qgsrenderchecker.h"
20 
51 class CORE_EXPORT QgsMultiRenderChecker
52 {
53  public:
55 
61  void setControlName( const QString& theName );
62 
63  void setControlPathPrefix( const QString& prefix );
64 
71  void setRenderedImage( const QString& renderedImagePath ) { mRenderedImage = renderedImagePath; }
72 
78  void setMapSettings( const QgsMapSettings& mapSettings );
79 
87  void setColorTolerance( unsigned int theColorTolerance ) { mColorTolerance = theColorTolerance; }
88 
102  bool runTest( const QString& theTestName, unsigned int theMismatchCount = 0 );
103 
109  const QString& report() const { return mReport; }
110 
115  const QString controlImagePath() const;
116 
120  static void drawBackground( QImage* image ) { QgsRenderChecker::drawBackground( image ); }
121 
122  private:
123  QString mReport;
124  QString mRenderedImage;
125  QString mControlName;
126  QString mControlPathPrefix;
127  unsigned int mColorTolerance;
128  QgsMapSettings mMapSettings;
129 };
130 
131 #endif // QGSMULTIRENDERCHECKER_H
const 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.
static void drawBackground(QImage *image)
Draws a checkboard pattern for image backgrounds, so that transparency is visible without requiring a...
void setColorTolerance(unsigned int theColorTolerance)
Set tolerance for color components used by runTest() Default value is 0.
static void drawBackground(QImage *image)
Draws a checkboard pattern for image backgrounds, so that transparency is visible without requiring a...
void setRenderedImage(const QString &renderedImagePath)
Set the path to the rendered image.