Composition.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 #ifndef __TERRALIB_RP_INTERNAL_COMPOSITION_H
21 #define __TERRALIB_RP_INTERNAL_COMPOSITION_H
22 
23 #include "Algorithm.h"
24 #include "FeedersRaster.h"
25 #include "Composer.h"
26 #include "../raster/Interpolator.h"
27 
28 #include <vector>
29 #include <string>
30 #include <map>
31 #include <memory>
32 
33 namespace te
34 {
35  namespace rp
36  {
37  class GeoComposition;
38 
39  /*!
40  \class Composition
41  \brief Create a composition (a mosaic created using user defined rules) from a set of geo-referenced rasters.
42  \ingroup rp_mos
43  */
45  {
46  public:
47 
48  /*!
49  \class InputParameters
50  \brief Composition input parameters
51  */
53  {
54  public:
55 
56  FeederConstRaster* m_feederRasterPtr; //!< Input rasters feeder.
57 
58  std::vector< std::vector< unsigned int > > m_inputRastersBands; //!< Bands to process for each input raster.
59 
60  te::rst::Interpolator::Method m_interpMethod; //!< The raster interpolator method (default:NearestNeighbor).
61 
62  double m_noDataValue; //!< The pixel value used where no raster data is avaliable (defaul:0).
63 
64  bool m_forceInputNoDataValue; //!< If true, m_noDataValue will be used as the no-data value for input rasters (defalt:false).
65 
66  bool m_autoEqualize; //!< Auto equalization will be performed using the overlaped image areas (default:true).
67 
68  bool m_useRasterCache; //!< Enable(true) or disable the use of raster caching (default:true).
69 
70  bool m_enableProgress; //!< Enable/Disable the progress interface (default:false).
71 
72  bool m_enableMultiThread; //!< Enable/disable the use of threads (default:true).
73 
74  std::vector< double > m_compositionTargetMeans; //!< An empty vector for automatic composition target means calcule or a vector of target means for each mosaic baind.
75 
76  std::vector< double > m_compositionTargetStdDevs; //!< An empty vector for automatic composition target standart deviation values calcule or a vector of target standart deviantion values for each mosaic baind.
77 
78  ComposerRule const * m_composerRulePtr; //!< A pointer to a valid composer rule.
79 
81 
83 
85 
86  //overload
87  void reset() _NOEXCEPT_OP(false);
88 
89  //overload
90  const InputParameters& operator=( const InputParameters& params );
91 
92  //overload
93  AbstractParameters* clone() const;
94 
95  //overload
96  bool serialize ( AlgorithmParametersSerializer& serializer ) const;
97  };
98 
99  /*!
100  \class OutputParameters
101  \brief Composition output parameters
102  */
104  {
105  public:
106 
107  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
108 
109  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
110 
111  std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output mosaic raster.
112 
114 
116 
118 
119  //overload
120  void reset() _NOEXCEPT_OP(false);
121 
122  //overload
123  const OutputParameters& operator=( const OutputParameters& params );
124 
125  //overload
126  AbstractParameters* clone() const;
127  };
128 
130 
132 
133  //overload
134  bool execute( AlgorithmOutputParameters& outputParams ) _NOEXCEPT_OP(false);
135 
136  //overload
137  void reset() _NOEXCEPT_OP(false);
138 
139  //overload
140  bool initialize( const AlgorithmInputParameters& inputParams ) _NOEXCEPT_OP(false);
141 
142  bool isInitialized() const;
143 
144  protected:
145 
146  Composition::InputParameters m_inputParameters; //!< Input execution parameters.
147 
148  bool m_isInitialized; //!< Tells if this instance is initialized.
149 
150  };
151 
152  } // end namespace rp
153 } // end namespace te
154 
155 #endif
156 
Raster objects feeders.
#define _NOEXCEPT_OP(x)
Raster Processing algorithm input parameters base interface.
Raster Processing algorithm output parameters base interface.
A class to standardize algorithm parameters serialization.
Raster Processing algorithm base interface.
Definition: Algorithm.h:42
Composition input parameters.
Definition: Composition.h:53
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: Composition.h:70
std::vector< double > m_compositionTargetStdDevs
An empty vector for automatic composition target standart deviation values calcule or a vector of tar...
Definition: Composition.h:76
ComposerRule const * m_composerRulePtr
A pointer to a valid composer rule.
Definition: Composition.h:78
bool m_autoEqualize
Auto equalization will be performed using the overlaped image areas (default:true).
Definition: Composition.h:66
bool m_useRasterCache
Enable(true) or disable the use of raster caching (default:true).
Definition: Composition.h:68
InputParameters(const InputParameters &)
std::vector< std::vector< unsigned int > > m_inputRastersBands
Bands to process for each input raster.
Definition: Composition.h:58
FeederConstRaster * m_feederRasterPtr
Input rasters feeder.
Definition: Composition.h:56
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: Composition.h:60
double m_noDataValue
The pixel value used where no raster data is avaliable (defaul:0).
Definition: Composition.h:62
bool m_forceInputNoDataValue
If true, m_noDataValue will be used as the no-data value for input rasters (defalt:false).
Definition: Composition.h:64
std::vector< double > m_compositionTargetMeans
An empty vector for automatic composition target means calcule or a vector of target means for each m...
Definition: Composition.h:74
bool m_enableMultiThread
Enable/disable the use of threads (default:true).
Definition: Composition.h:72
Composition output parameters.
Definition: Composition.h:104
std::map< std::string, std::string > m_rInfo
The necessary information to create the output rasters (as described in te::raster::RasterFactory).
Definition: Composition.h:109
OutputParameters(const OutputParameters &)
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output mosaic raster.
Definition: Composition.h:111
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: Composition.h:107
Create a composition (a mosaic created using user defined rules) from a set of geo-referenced rasters...
Definition: Composition.h:45
Feeder from a input rasters.
Definition: FeedersRaster.h:47
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:93
TerraLib.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
Abstract algorithm.