ContrastEnhancement.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 terralib/se/ContrastEnhancement.h
22 
23  \brief ContrastEnhancement defines the 'stretching' of contrast for a channel of a false-color image or for a whole grey/color image.
24 */
25 
26 #ifndef __TERRALIB_SE_INTERNAL_CONTRASTENHANCEMENT_H
27 #define __TERRALIB_SE_INTERNAL_CONTRASTENHANCEMENT_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 // Boost
33 #include <boost/noncopyable.hpp>
34 
35 namespace te
36 {
37  namespace se
38  {
39  /*!
40  \class ContrastEnhancement
41 
42  \brief ContrastEnhancement defines the 'stretching' of contrast for a channel of a false-color image or for a whole grey/color image.
43 
44  Contrast enhancement is used to make ground features
45  in images more visible.
46  In the case of a color image, the relative grayscale brightness
47  of a pixel color is used. Normalize means to stretch the contrast
48  so that the dimmest color is stretched to black and the brightest
49  color is stretched to white, with all colors in between stretched
50  out linearly. Histogram means to stretch the contrast based on
51  a histogram of how many colors are at each brightness level on
52  input, with the goal of producing equal number of pixels in the
53  image at each brightness level on output. This has the effect of
54  revealing many subtle ground features. A GammaValue tells how much
55  to brighten (values greater than 1.0) or dim (values less than 1.0)
56  an image. The default GammaValue is 1.0 (no change). If none of
57  Normalize, Histogram, or GammaValue are selected in a ContrastEnhancement,
58  then no enhancement is performed.
59 
60  \ingroup se
61 
62  \sa SelectedChannel, RasterSymbolizer
63  */
64  class TESEEXPORT ContrastEnhancement : public boost::noncopyable
65  {
66  public:
67 
68  /*!
69  \enum ContrastEnhancementType
70 
71  \brief The type of contrast enhancement.
72  */
74  {
75  ENHANCEMENT_NORMALIZE, /*!< It means to stretch the contrast so that
76  the dimmest color is stretched to black
77  and the brightest color is stretched to
78  white, with all colors in between stretched
79  out linearly. */
80  ENHANCEMENT_HISTOGRAM, /*!< It means to stretch the contrast based on a
81  histogram of how many colors are at each
82  brightness level on input, with the goal of
83  producing equal number of pixels in the image
84  at each brightness level on output. This has
85  the effect of revealing many subtle ground
86  features. */
87  ENHANCEMENT_NONE /*!< No contrast enhancement must be applied. */
88  };
89 
90  /** @name Initializer Methods
91  * Methods related to instantiation and destruction.
92  */
93  //@{
94 
95  /*! \brief It initializes a new ContrastEnhancement. */
97 
98  /*! \brief Destructor. */
100 
101  //@}
102 
103  /** @name Accessor methods
104  * Methods used to get or set properties.
105  */
106  //@{
107 
108  void setContrastEnhancementType(ContrastEnhancementType t);
109 
110  ContrastEnhancementType getContrastEnhancementType() const { return m_contrast; }
111 
112  void setGammaValue(const double& v);
113 
114  double getGammaValue() const { return m_gammaValue; }
115 
116  //@}
117 
118  /*! \brief It creates a new copy of this object. */
119  ContrastEnhancement* clone() const;
120 
121  private:
122 
123  ContrastEnhancementType m_contrast; //!< Contrast enhancement type. (Optional)
124  double m_gammaValue; //!< It tells how much to brighten (values greater than 1.0) or dim (values less than 1.0) an image. (Optional)
125  };
126 
127  } // end namespace se
128 } // end namespace te
129 
130 #endif // __TERRALIB_SE_INTERNAL_CONTRASTENHANCEMENT_H
ContrastEnhancementType
The type of contrast enhancement.
URI C++ Library.
double m_gammaValue
It tells how much to brighten (values greater than 1.0) or dim (values less than 1.0) an image. (Optional)
ContrastEnhancement defines the 'stretching' of contrast for a channel of a false-color image or for ...
#define TESEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:187
Configuration flags for the Symbology Encoding support of TerraLib.
ContrastEnhancementType getContrastEnhancementType() const
ContrastEnhancementType m_contrast
Contrast enhancement type. (Optional)