QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsrasterbandstats.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterbandstats.h - description
3 -------------------
4 begin : Fri Jun 28 2002
5 copyright : (C) 2005 by T.Sutton
7***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSRASTERBANDSTATS
19#define QGSRASTERBANDSTATS
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
23#include "qgis.h"
24#include <QString>
25#include <QVector>
26
27#include <limits>
28
29#include "qgsrectangle.h"
30
36class CORE_EXPORT QgsRasterBandStats
37{
38 public:
39
43 QgsRasterBandStats() = default;
44
46 bool contains( const QgsRasterBandStats &s ) const
47 {
48 return ( s.bandNumber == bandNumber &&
49 s.extent == extent &&
50 s.width == width &&
51 s.height == height &&
52 s.statsGathered == ( statsGathered & s.statsGathered ) );
53 }
54
56 int bandNumber = 1;
57
58 // TODO: check if no data are excluded in stats calculation
59
61 qgssize elementCount = 0;
62
67 double maximumValue = -std::numeric_limits<double>::max();
68
73 double minimumValue = std::numeric_limits<double>::max();
74
76 double mean = 0;
77
79 double range = 0;
80
82 double stdDev = 0;
83
86
88 double sum = 0;
89
91 double sumOfSquares = 0;
92
94 int width = 0;
95
97 int height = 0;
98
101};
102
103#endif
QFlags< RasterBandStatistic > RasterBandStatistics
Statistics to be calculated for raster bands.
Definition: qgis.h:4856
The RasterBandStats struct is a container for statistics about a single raster band.
int bandNumber
The gdal band number (starts at 1)
int height
Number of rows used to calc statistics.
QgsRasterBandStats()=default
Constructor for QgsRasterBandStats.
QgsRectangle extent
Extent used to calc statistics.
int width
Number of columns used to calc statistics.
Qgis::RasterBandStatistics statsGathered
Collected statistics.
bool contains(const QgsRasterBandStats &s) const
Compares region, size etc. not collected statistics.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...
Definition: qgis.h:5747