All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BandSummary.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/raster/BandSummary.cpp
22 
23  \brief A struct that can be used to keep the summary of a raster band (most statistics).
24 */
25 
26 // TerraLib
27 #include "BandSummary.h"
28 
30  : m_minVal(0),
31  m_maxVal(0),
32  m_stdVal(0),
33  m_meanVal(0),
34  m_histogramR(0),
35  m_histogramI(0)
36 {
37 }
38 
40  : m_minVal(0),
41  m_maxVal(0),
42  m_stdVal(0),
43  m_meanVal(0),
44  m_histogramR(0),
45  m_histogramI(0)
46 {
47  m_minVal = rhs.m_minVal ? new std::complex<double>(*rhs.m_minVal) : 0;
48  m_maxVal = rhs.m_maxVal ? new std::complex<double>(*rhs.m_maxVal) : 0;
49  m_stdVal = rhs.m_stdVal ? new std::complex<double>(*rhs.m_stdVal) : 0;
50  m_meanVal = rhs.m_meanVal ? new std::complex<double>(*rhs.m_meanVal) : 0;
51  m_histogramR = rhs.m_histogramR ? new std::map<double, unsigned int>(*rhs.m_histogramR) : 0;
52  m_histogramI = rhs.m_histogramI ? new std::map<double, unsigned int>(*rhs.m_histogramI) : 0;
53 }
54 
56 {
57  clear();
58 }
59 
61 {
62  if(this != &rhs)
63  {
64  clear();
65 
66  m_minVal = rhs.m_minVal ? new std::complex<double>(*rhs.m_minVal) : 0;
67  m_maxVal = rhs.m_maxVal ? new std::complex<double>(*rhs.m_maxVal) : 0;
68  m_stdVal = rhs.m_stdVal ? new std::complex<double>(*rhs.m_stdVal) : 0;
69  m_meanVal = rhs.m_meanVal ? new std::complex<double>(*rhs.m_meanVal) : 0;
70  m_histogramR = rhs.m_histogramR ? new std::map<double, unsigned int>(*rhs.m_histogramR) : 0;
71  m_histogramI = rhs.m_histogramI ? new std::map<double, unsigned int>(*rhs.m_histogramI) : 0;
72  }
73 
74  return *this;
75 }
76 
78 {
79  delete m_minVal;
80  m_minVal = 0;
81 
82  delete m_maxVal;
83  m_maxVal = 0;
84 
85  delete m_stdVal;
86  m_stdVal = 0;
87 
88  delete m_meanVal;
89  m_meanVal = 0;
90 
91  delete m_histogramR;
92  m_histogramR = 0;
93 
94  delete m_histogramI;
95  m_histogramI = 0;
96 }
97 
A struct that can be used to keep the summary of a raster band (most statistics). ...
std::map< double, unsigned int > * m_histogramR
The histogram (a map of occurring values and frequency) of the real part of a band.
Definition: BandSummary.h:82
std::complex< double > * m_minVal
The minimum occurring values (real and imaginary), default is std::numeric_limits::min().
Definition: BandSummary.h:78
std::complex< double > * m_stdVal
The standard deviation of the occurring values (real and imaginary), default is 1.0.
Definition: BandSummary.h:80
std::map< double, unsigned int > * m_histogramI
The histogram (a map of occurring values and frequency) of the imaginary part of a band...
Definition: BandSummary.h:83
std::complex< double > * m_maxVal
The maximum occurring values (real and imaginary), default is std::numeric_limits::max().
Definition: BandSummary.h:79
~BandSummary()
Destructor.
Definition: BandSummary.cpp:55
A summary of a raster band (most statistics).
Definition: BandSummary.h:47
BandSummary()
Constructor.
Definition: BandSummary.cpp:29
BandSummary & operator=(const BandSummary &rhs)
Assignment operator.
Definition: BandSummary.cpp:60
void clear()
Clears all attributes from this class.
Definition: BandSummary.cpp:77
std::complex< double > * m_meanVal
The mean of the occurring values (real and imaginary), default is 0.0.
Definition: BandSummary.h:81