QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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
40 QgsRasterBandStats() = default;
41
43 bool contains( const QgsRasterBandStats &s ) const
44 {
45 return ( s.bandNumber == bandNumber &&
46 s.extent == extent &&
47 s.width == width &&
48 s.height == height &&
49 s.statsGathered == ( statsGathered & s.statsGathered ) );
50 }
51
53 int bandNumber = 1;
54
55 // TODO: check if no data are excluded in stats calculation
56
58 qgssize elementCount = 0;
59
64 double maximumValue = -std::numeric_limits<double>::max();
65
70 double minimumValue = std::numeric_limits<double>::max();
71
73 double mean = 0;
74
76 double range = 0;
77
79 double stdDev = 0;
80
83
85 double sum = 0;
86
88 double sumOfSquares = 0;
89
91 int width = 0;
92
94 int height = 0;
95
98};
99
100#endif
QFlags< RasterBandStatistic > RasterBandStatistics
Statistics to be calculated for raster bands.
Definition qgis.h:5600
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
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.
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:6572