RasterContrast.h
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 RasterContrast.h
22 
23  \brief This class contains the parameters needed to apply dynamic contrast over a raster.
24 */
25 
26 #ifndef __TERRALIB_MAPTOOLS_INTERNAL_RASTERCONTRAST_H
27 #define __TERRALIB_MAPTOOLS_INTERNAL_RASTERCONTRAST_H
28 
29 // TerraLib
30 #include "Config.h"
31 #include "Enums.h"
32 #include "RasterTransform.h"
33 
34 // STL
35 #include <cstdlib>
36 #include <string>
37 #include <vector>
38 
39 namespace te
40 {
41  namespace map
42  {
43  /*!
44  \class RasterContrast
45 
46  \brief This class contains the parameters needed to apply dynamic contrast over a raster.
47 
48  \ingroup map
49 
50  \sa RasterTransform
51  */
53  {
54  public:
55 
56  /*!
57  \brief It constructs a new RasterContrast instance.
58 
59  \param type The contrast type.
60  */
61  RasterContrast(const te::map::RasterTransform::ContrastType& type, const std::size_t& nBands);
62 
63  /*! \brief Destructor. */
64  ~RasterContrast();
65 
66  /*! \brief Copy constructor. */
67  RasterContrast(const RasterContrast& rhs);
68 
69  /*!
70  \brief It gets the contrast type.
71 
72  \return The contrast type.
73  */
74  const te::map::RasterTransform::ContrastType getType() const;
75 
76  /*!
77  \brief It gets the contrast number of bands.
78 
79  \return The number of bands
80  */
81  std::size_t getNBands();
82 
83  /*!
84  \brief It set the transformation values for contranst of one band.
85 
86  \param gain The gain value of transformation.
87  \param offset1 The offset1 value of transformation.
88  \param offset2 The offset2 value of transformation.
89  \param min The minimun band value for this transformation.
90  \param max The maximum band value for this transformation.
91  \param band The band index.
92  */
93  void setValues(const double& gain, const double& offset1, const double& offset2, const double& min, const double& max, const std::size_t& band);
94 
95  /*!
96  \brief It get the contrast transformation values.
97 
98  \param gain The vector with gain values of transformation.
99  \param offset1 The vector with offset1 values of transformation.
100  \param offset2 The vector with offset2 values of transformation.
101  \param min The vector with minimun band values for this transformation.
102  \param max The vector with maximum band values for this transformation.
103  */
104  void getValues(std::vector<double>& gain, std::vector<double>& offset1, std::vector<double>& offset2, std::vector<double>& min, std::vector<double>& max);
105 
106 
107  private:
108 
110 
111  std::size_t m_nBands;
112 
113  std::vector<double> m_gain;
114  std::vector<double> m_offset1;
115  std::vector<double> m_offset2;
116  std::vector<double> m_min;
117  std::vector<double> m_max;
118  };
119 
120  } // end namespace map
121 } // end namespace te
122 
123 #endif // __TERRALIB_MAPTOOLS_INTERNAL_RASTERCONTRAST_H
124 
A Raster Transform is a class that defines functions to transform a styled raster.
te::map::RasterTransform::ContrastType m_type
The contrast type.
URI C++ Library.
#define TEMAPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
This class contains the parameters needed to apply dynamic contrast over a raster.
std::vector< double > m_offset2
std::vector< double > m_max
std::vector< double > m_min
std::vector< double > m_gain
std::vector< double > m_offset1