QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 <QString>
22 #include <QVector>
23 
24 #include <limits>
25 
30 class CORE_EXPORT QgsRasterHistogram
31 {
32  public:
33  typedef QVector<int> HistogramVector;
34 
36  {
37  bandNumber = 0;
38  binCount = 0;
39  nonNullCount = 0;
40  includeOutOfRange = false;
41  maximum = 0;
42  minimum = 0;
43  width = 0;
44  height = 0;
45  valid = false;
46  }
47 
49  bool operator==( const QgsRasterHistogram &h ) const
50  {
51  return ( h.bandNumber == bandNumber &&
52  h.binCount == binCount &&
53  h.includeOutOfRange == includeOutOfRange &&
54  h.maximum == maximum &&
55  h.minimum == minimum &&
56  h.extent == extent &&
57  h.width == width &&
58  h.height == height );
59  }
60 
63 
65  int binCount;
66 
69 
72 
76  HistogramVector histogramVector;
77 
79  double maximum;
80 
82  double minimum;
83 
85  int width;
86 
88  int height;
89 
92 
94  bool valid;
95 };
96 #endif
A rectangle specified with double values.
Definition: qgsrectangle.h:35
int bandNumber
The gdal band number (starts at 1)
Definition: qgsrasterhistogram.h:62
int width
Number of columns used to calc histogram.
Definition: qgsrasterhistogram.h:85
QVector< int > HistogramVector
Definition: qgsrasterhistogram.h:33
double minimum
The minimum histogram value.
Definition: qgsrasterhistogram.h:82
int height
Number of rows used to calc histogram.
Definition: qgsrasterhistogram.h:88
double maximum
The maximum histogram value.
Definition: qgsrasterhistogram.h:79
QgsRasterHistogram()
Definition: qgsrasterhistogram.h:35
The QgsRasterHistogram is a container for histogram of a single raster band.
Definition: qgsrasterhistogram.h:30
int binCount
Number of bins (intervals,buckets) in histogram.
Definition: qgsrasterhistogram.h:65
HistogramVector histogramVector
Store the histogram for a given layer.
Definition: qgsrasterhistogram.h:76
bool valid
Histogram is valid.
Definition: qgsrasterhistogram.h:94
QgsRectangle extent
Extent used to calc histogram.
Definition: qgsrasterhistogram.h:91
bool includeOutOfRange
Whether histogram includes out of range values (in first and last bin)
Definition: qgsrasterhistogram.h:71
bool operator==(const QgsRasterHistogram &h) const
Definition: qgsrasterhistogram.h:49
int nonNullCount
The number of non NULL cells used to calculate histogram.
Definition: qgsrasterhistogram.h:68