QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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 <limits>
22
23#include "qgis_core.h"
24#include "qgsrectangle.h"
25
26#include <QString>
27#include <QVector>
28
35class CORE_EXPORT QgsRasterHistogram
36{
37 public:
38 typedef QVector<int> HistogramVector;
39
43 QgsRasterHistogram() = default;
44
46 bool operator==( const QgsRasterHistogram &h ) const
47 {
48 return ( h.bandNumber == bandNumber &&
49 h.binCount == binCount &&
53 h.extent == extent &&
54 h.width == width &&
55 h.height == height );
56 }
57
59 int bandNumber = 0;
60
62 int binCount = 0;
63
65 int nonNullCount = 0;
66
68 bool includeOutOfRange = false;
69
74
76 double maximum = 0;
77
79 double minimum = 0;
80
82 int width = 0;
83
85 int height = 0;
86
89
91 bool valid = false;
92};
93#endif
bool operator==(const QgsRasterHistogram &h) const
Compares region, size etc. not histogram itself.
double minimum
The minimum histogram value.
int bandNumber
The gdal band number (starts at 1).
double maximum
The maximum histogram value.
QgsRasterHistogram()=default
Constructor for an invalid QgsRasterHistogram.
bool includeOutOfRange
Whether histogram includes out of range values (in first and last bin).
QgsRectangle extent
Extent used to calc histogram.
int nonNullCount
The number of non NULL cells used to calculate histogram.
QgsRasterHistogram::HistogramVector histogramVector
Stores the histogram for a given layer.
QVector< int > HistogramVector
int height
Number of rows used to calc histogram.
int width
Number of columns used to calc histogram.
bool valid
Histogram is valid.
int binCount
Number of bins (intervals,buckets) in histogram.
A rectangle specified with double values.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference).
Definition qgis.h:6607