QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsrasterhistogram.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterhistogram.h
3  -------------------
4  begin : July 2012
5  copyright : (C) 2012 by Radim Blazek
6  email : radim dot blazek at gmail dot com
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 QGSRASTERHISTOGRAM
19 #define QGSRASTERHISTOGRAM
20 
21 #include "qgis_core.h"
22 #include "qgsrectangle.h"
23 #include <QString>
24 #include <QVector>
25 
26 #include <limits>
27 
33 class CORE_EXPORT QgsRasterHistogram
34 {
35  public:
36  typedef QVector<int> HistogramVector;
37 
41  QgsRasterHistogram() = default;
42 
44  bool operator==( const QgsRasterHistogram &h ) const
45  {
46  return ( h.bandNumber == bandNumber &&
47  h.binCount == binCount &&
48  h.includeOutOfRange == includeOutOfRange &&
49  qgsDoubleNear( h.maximum, maximum ) &&
50  qgsDoubleNear( h.minimum, minimum ) &&
51  h.extent == extent &&
52  h.width == width &&
53  h.height == height );
54  }
55 
57  int bandNumber = 0;
58 
60  int binCount = 0;
61 
63  int nonNullCount = 0;
64 
66  bool includeOutOfRange = false;
67 
72 
74  double maximum = 0;
75 
77  double minimum = 0;
78 
80  int width = 0;
81 
83  int height = 0;
84 
86  QgsRectangle extent;
87 
89  bool valid = false;
90 };
91 #endif
QgsRasterHistogram::HistogramVector
QVector< int > HistogramVector
Definition: qgsrasterhistogram.h:49
qgsrectangle.h
operator==
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Definition: qgsfeatureiterator.h:425
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:41
QgsRasterHistogram::extent
QgsRectangle extent
Extent used to calc histogram.
Definition: qgsrasterhistogram.h:99
QgsRasterHistogram::includeOutOfRange
bool includeOutOfRange
Whether histogram includes out of range values (in first and last bin)
Definition: qgsrasterhistogram.h:79
QgsRasterHistogram::minimum
double minimum
The minimum histogram value.
Definition: qgsrasterhistogram.h:90
qgsDoubleNear
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2265
QgsRasterHistogram::binCount
int binCount
Number of bins (intervals,buckets) in histogram.
Definition: qgsrasterhistogram.h:73
QgsRasterHistogram
The QgsRasterHistogram is a container for histogram of a single raster band. It is used to cache comp...
Definition: qgsrasterhistogram.h:33
QgsRasterHistogram::height
int height
Number of rows used to calc histogram.
Definition: qgsrasterhistogram.h:96
QgsRasterHistogram::width
int width
Number of columns used to calc histogram.
Definition: qgsrasterhistogram.h:93
QgsRasterHistogram::maximum
double maximum
The maximum histogram value.
Definition: qgsrasterhistogram.h:87
QgsRasterHistogram::bandNumber
int bandNumber
The gdal band number (starts at 1)
Definition: qgsrasterhistogram.h:70