19
19
#define QGSRASTERHISTOGRAM
20
20
21
21
#include " qgis_core.h"
22
+ #include " qgsrectangle.h"
22
23
#include < QString>
23
24
#include < QVector>
24
25
@@ -34,18 +35,10 @@ class CORE_EXPORT QgsRasterHistogram
34
35
public:
35
36
typedef QVector<int > HistogramVector;
36
37
37
- QgsRasterHistogram ()
38
- {
39
- bandNumber = 0 ;
40
- binCount = 0 ;
41
- nonNullCount = 0 ;
42
- includeOutOfRange = false ;
43
- maximum = 0 ;
44
- minimum = 0 ;
45
- width = 0 ;
46
- height = 0 ;
47
- valid = false ;
48
- }
38
+ /* *
39
+ * Constructor for an invalid QgsRasterHistogram.
40
+ */
41
+ QgsRasterHistogram () = default ;
49
42
50
43
// ! Compares region, size etc. not histogram itself
51
44
bool operator ==( const QgsRasterHistogram &h ) const
@@ -61,39 +54,38 @@ class CORE_EXPORT QgsRasterHistogram
61
54
}
62
55
63
56
// ! \brief The gdal band number (starts at 1)
64
- int bandNumber;
57
+ int bandNumber = 0 ;
65
58
66
59
// ! \brief Number of bins (intervals,buckets) in histogram.
67
- int binCount;
60
+ int binCount = 0 ;
68
61
69
62
// ! \brief The number of non NULL cells used to calculate histogram.
70
- int nonNullCount;
63
+ int nonNullCount = 0 ;
71
64
72
65
// ! \brief Whether histogram includes out of range values (in first and last bin)
73
- bool includeOutOfRange;
66
+ bool includeOutOfRange = false ;
74
67
75
68
/* *
76
- * \brief Store the histogram for a given layer
77
- * \note not available via Python binding
78
- */
69
+ * Stores the histogram for a given layer
70
+ */
79
71
QgsRasterHistogram::HistogramVector histogramVector;
80
72
81
73
// ! \brief The maximum histogram value.
82
- double maximum;
74
+ double maximum = 0 ;
83
75
84
76
// ! \brief The minimum histogram value.
85
- double minimum;
77
+ double minimum = 0 ;
86
78
87
79
// ! \brief Number of columns used to calc histogram
88
- int width;
80
+ int width = 0 ;
89
81
90
82
// ! \brief Number of rows used to calc histogram
91
- int height;
83
+ int height = 0 ;
92
84
93
85
// ! \brief Extent used to calc histogram
94
86
QgsRectangle extent;
95
87
96
88
// ! \brief Histogram is valid
97
- bool valid;
89
+ bool valid = false ;
98
90
};
99
91
#endif
0 commit comments