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 
96  /*!
97  \class OutputParameters
98  \brief Composition output parameters
99  */
101  {
102  public:
103 
104  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
105 
106  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the output rasters (as described in te::raster::RasterFactory).
107 
108  std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< The generated output mosaic raster.
109 
111 
113 
115 
116  //overload
117  void reset() _NOEXCEPT_OP(false);
118 
119  //overload
120  const OutputParameters& operator=( const OutputParameters& params );
121 
122  //overload
123  AbstractParameters* clone() const;
124  };
125 
127 
129 
130  //overload
131  bool execute( AlgorithmOutputParameters& outputParams ) _NOEXCEPT_OP(false);
132 
133  //overload
134  void reset() _NOEXCEPT_OP(false);
135 
136  //overload
137  bool initialize( const AlgorithmInputParameters& inputParams ) _NOEXCEPT_OP(false);
138 
139  bool isInitialized() const;
140 
141  protected:
142 
143  Composition::InputParameters m_inputParameters; //!< Input execution parameters.
144 
145  bool m_isInitialized; //!< Tells if this instance is initialized.
146 
147  };
148 
149  } // end namespace rp
150 } // end namespace te
151 
152 #endif
153 
te::rp::Composition::InputParameters::reset
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::rp::Composition::OutputParameters::m_rInfo
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:106
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::rp::AlgorithmOutputParameters
Raster Processing algorithm output parameters base interface.
Definition: AlgorithmOutputParameters.h:40
te::rp::Composition::InputParameters::InputParameters
InputParameters()
te::rp::Composition::InputParameters::m_compositionTargetStdDevs
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
te::rp::Composition::OutputParameters::~OutputParameters
~OutputParameters()
te::rp::AlgorithmInputParameters
Raster Processing algorithm input parameters base interface.
Definition: AlgorithmInputParameters.h:40
te::rp::FeederConstRaster
Feeder from a input rasters.
Definition: FeedersRaster.h:47
te::rp::Composition::InputParameters::~InputParameters
~InputParameters()
te::rp::Composition::InputParameters
Composition input parameters.
Definition: Composition.h:53
te::rp::Composition::InputParameters::m_interpMethod
te::rst::Interpolator::Method m_interpMethod
The raster interpolator method (default:NearestNeighbor).
Definition: Composition.h:60
_NOEXCEPT_OP
#define _NOEXCEPT_OP(x)
Definition: NoExceptDefinition.h:36
te::rp::Composition::OutputParameters::OutputParameters
OutputParameters()
te::rp::Composition::InputParameters::m_useRasterCache
bool m_useRasterCache
Enable(true) or disable the use of raster caching (default:true).
Definition: Composition.h:68
te::rp::Composition::OutputParameters
Composition output parameters.
Definition: Composition.h:101
te::rp::Algorithm
Raster Processing algorithm base interface.
Definition: Algorithm.h:42
FeedersRaster.h
Raster objects feeders.
te::rp::Composition::InputParameters::InputParameters
InputParameters(const InputParameters &)
te::rp::Composition::InputParameters::m_enableProgress
bool m_enableProgress
Enable/Disable the progress interface (default:false).
Definition: Composition.h:70
te::rst::InterpolationMethod
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:93
te::rp::Composition
Create a composition (a mosaic created using user defined rules) from a set of geo-referenced rasters...
Definition: Composition.h:45
te::rp::Composition::OutputParameters::m_rType
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: Composition.h:104
te::rp::Composition::InputParameters::m_composerRulePtr
ComposerRule const * m_composerRulePtr
A pointer to a valid composer rule.
Definition: Composition.h:78
TERPEXPORT
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
te::rp::ComposerRule
Definition: ComposerRule.h:44
te::rp::Composition::InputParameters::m_inputRastersBands
std::vector< std::vector< unsigned int > > m_inputRastersBands
Bands to process for each input raster.
Definition: Composition.h:58
te::rp::Composition::InputParameters::m_enableMultiThread
bool m_enableMultiThread
Enable/disable the use of threads (default:true).
Definition: Composition.h:72
te::rp::Composition::OutputParameters::OutputParameters
OutputParameters(const OutputParameters &)
Algorithm.h
Abstract algorithm.
te::rp::Composition::InputParameters::m_feederRasterPtr
FeederConstRaster * m_feederRasterPtr
Input rasters feeder.
Definition: Composition.h:56
Composer.h
te::rp::Composition::OutputParameters::reset
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::rp::Composition::OutputParameters::m_outputRasterPtr
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
The generated output mosaic raster.
Definition: Composition.h:108
te::rp::Composition::InputParameters::m_forceInputNoDataValue
bool m_forceInputNoDataValue
If true, m_noDataValue will be used as the no-data value for input rasters (defalt:false).
Definition: Composition.h:64
te::rp::Composition::InputParameters::m_compositionTargetMeans
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
te::rp::Composition::InputParameters::m_autoEqualize
bool m_autoEqualize
Auto equalization will be performed using the overlaped image areas (default:true).
Definition: Composition.h:66
te::rp::Composition::InputParameters::m_noDataValue
double m_noDataValue
The pixel value used where no raster data is avaliable (defaul:0).
Definition: Composition.h:62