QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsrasterchecker.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterchecker.h - compare two rasters
3 --------------------------------------
4 Date : 5 Sep 2012
5 Copyright : (C) 2012 by Radim Blazek
6 email : radim dot blazek at gmail dot com
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 QGSRASTERCHECKER_H
17#define QGSRASTERCHECKER_H
18
19#include "qgis.h"
20#include "qgis_core.h"
21
22#include <QDir>
23#include <QString>
24
25class QImage;
26
33class CORE_EXPORT QgsRasterChecker
34{
35 public:
36
38
39 QString report() const { return mReport; }
40
48 bool runTest( const QString &verifiedKey, QString verifiedUri,
49 const QString &expectedKey, QString expectedUri );
50 private:
51 QString mReport;
52 QString mExpectedUri;
53 QString mCheckedUri;
54 QString mTabStyle;
55 QString mCellStyle;
56 QString mOkStyle;
57 QString mErrStyle;
58 QString mErrMsgStyle;
59
60 // Log error in html
61 void error( const QString &message, QString &report );
62 // compare values and add table row in html report, set ok to false if not equal
63 QString compareHead();
64 bool compare( double verifiedVal, double expectedVal, double tolerance );
65 void compare( const QString &paramName, int verifiedVal, int expectedVal, QString &report, bool &ok );
66
67#ifndef SIP_RUN
68
74 void compare( const QString &paramName, Qgis::DataType verifiedVal, Qgis::DataType expectedVal, QString &report, bool &ok );
75#endif
76
77 void compare( const QString &paramName, double verifiedVal, double expectedVal, QString &report, bool &ok, double tolerance = 0 );
78 void compareRow( const QString &paramName, const QString &verifiedVal, const QString &expectedVal, QString &report, bool ok, const QString &difference = QString(), const QString &tolerance = QString() );
79 double tolerance( double val, int places = 6 );
80}; // class QgsRasterChecker
81
82// clazy:excludeall=qstring-allocations
83
84#endif
DataType
Raster data types.
Definition qgis.h:372
QString report() const