ComposerRuleValidPixel.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_COMPOSER_RULE_VALID_PIXEL_H
21 #define __TERRALIB_RP_INTERNAL_COMPOSER_RULE_VALID_PIXEL_H
22 
23 #include "ComposerRule.h"
24 #include "../srs/Converter.h"
25 #include "../raster/Interpolator.h"
26 
27 #include <memory>
28 
29 namespace te
30 {
31  namespace rp
32  {
33  /*!
34  \class ComposerRuleValidPixel A basic composer rule capable of choosing the valid pixels (all bands with no no-data values).
35  \brief A basic composer rule capable of choosing the valid pixels (all bands with no no-data values).
36  \ingroup rp_optical
37  */
39  {
40  public:
41 
43 
45 
46  protected:
47 
48  // overload
49  void getComposedValues( const double& line, const double& col,
50  double* const composedValuesPtr ) const;
51 
52  // overload
53  ComposerRule* clone() const;
54 
55  // overload
56  bool initialize(
57  const te::rst::Raster& raster1,
58  const std::vector< unsigned int >& raster1Bands,
59  const te::rst::Raster& raster2,
60  const std::vector< unsigned int >& raster2Bands,
61  te::rst::Raster& raster3,
62  const std::vector< unsigned int >& raster3Bands,
63  const te::rst::Interpolator::Method& interpMethod1,
64  const te::rst::Interpolator::Method& interpMethod2,
65  const double& noDataValue,
66  const bool forceRaster1NoDataValue,
67  const bool forceRaster2NoDataValue,
68  const std::vector< double >& pixelOffsets1,
69  const std::vector< double >& pixelScales1,
70  const std::vector< double >& pixelOffsets2,
71  const std::vector< double >& pixelScales2 );
72 
73  private :
74 
75  std::size_t m_raster1BandsSize;
76 
77  te::srs::Converter m_converter1; //<! Raster 1 converter.
78 
79  te::srs::Converter m_converter2; //<! Raster 2 converter.
80 
81  std::unique_ptr< te::rst::Interpolator > m_interpolator1Ptr; //<! Raster 1 interpolator.
82 
83  std::unique_ptr< te::rst::Interpolator > m_interpolator2Ptr; //<! Raster 1 interpolator.
84 
85  std::vector< std::complex< double > > m_noDataValues1;
86 
87  std::vector< std::complex< double > > m_noDataValues2;
88 
89  // variables used by getComposedValues method
92  mutable std::complex< double > m_getComposedValues_PixelValue;
96  mutable double m_getComposedValues_rasterY;
99 
101 
103 
104  void initState();
105 
106  void clear();
107 
108  };
109 
110  } // end namespace rp
111 } // end namespace te
112 
113 #endif
114 
te::rp::ComposerRuleValidPixel
A basic composer rule capable of choosing the valid pixels (all bands with no no-data values).
Definition: ComposerRuleValidPixel.h:39
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::rp::ComposerRuleValidPixel::m_interpolator2Ptr
std::unique_ptr< te::rst::Interpolator > m_interpolator2Ptr
Definition: ComposerRuleValidPixel.h:83
ComposerRule.h
te::rst::Raster
An abstract class for raster data strucutures.
Definition: Raster.h:72
te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterRow
double m_getComposedValues_rasterRow
Definition: ComposerRuleValidPixel.h:97
te::rp::ComposerRuleValidPixel::m_getComposedValues_raster3Y
double m_getComposedValues_raster3Y
Definition: ComposerRuleValidPixel.h:94
te::rp::ComposerRuleValidPixel::initialize
bool initialize(const te::rst::Raster &raster1, const std::vector< unsigned int > &raster1Bands, const te::rst::Raster &raster2, const std::vector< unsigned int > &raster2Bands, te::rst::Raster &raster3, const std::vector< unsigned int > &raster3Bands, const te::rst::Interpolator::Method &interpMethod1, const te::rst::Interpolator::Method &interpMethod2, const double &noDataValue, const bool forceRaster1NoDataValue, const bool forceRaster2NoDataValue, const std::vector< double > &pixelOffsets1, const std::vector< double > &pixelScales1, const std::vector< double > &pixelOffsets2, const std::vector< double > &pixelScales2)
Inititate the instance.
te::rst::InterpolationMethod
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:93
te::rp::ComposerRuleValidPixel::m_interpolator1Ptr
std::unique_ptr< te::rst::Interpolator > m_interpolator1Ptr
Definition: ComposerRuleValidPixel.h:81
te::srs::Converter
A Converter is responsible for the conversion of coordinates between different Coordinate Systems (CS...
Definition: Converter.h:54
te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterY
double m_getComposedValues_rasterY
Definition: ComposerRuleValidPixel.h:96
te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterX
double m_getComposedValues_rasterX
Definition: ComposerRuleValidPixel.h:95
te::rp::ComposerRuleValidPixel::m_raster1BandsSize
std::size_t m_raster1BandsSize
Definition: ComposerRuleValidPixel.h:75
te::rp::ComposerRuleValidPixel::clear
void clear()
te::rp::ComposerRuleValidPixel::m_getComposedValues_pixelIsValid
bool m_getComposedValues_pixelIsValid
Definition: ComposerRuleValidPixel.h:90
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::ComposerRuleValidPixel::m_converter1
te::srs::Converter m_converter1
Definition: ComposerRuleValidPixel.h:77
te::rp::ComposerRuleValidPixel::clone
ComposerRule * clone() const
Create a clone of this instance.
te::rp::ComposerRuleValidPixel::m_converter2
te::srs::Converter m_converter2
Definition: ComposerRuleValidPixel.h:79
te::rp::ComposerRuleValidPixel::initState
void initState()
te::rp::ComposerRule
Definition: ComposerRule.h:44
te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterBandsIdx
std::size_t m_getComposedValues_rasterBandsIdx
Definition: ComposerRuleValidPixel.h:91
te::rp::ComposerRuleValidPixel::m_getComposedValues_raster3X
double m_getComposedValues_raster3X
Definition: ComposerRuleValidPixel.h:93
te::rp::ComposerRuleValidPixel::m_noDataValues1
std::vector< std::complex< double > > m_noDataValues1
Definition: ComposerRuleValidPixel.h:85
te::rp::ComposerRuleValidPixel::getComposedValues
void getComposedValues(const double &line, const double &col, double *const composedValuesPtr) const
Compose a pixel value using the current parameters.
te::rp::ComposerRuleValidPixel::operator=
const ComposerRuleValidPixel & operator=(const ComposerRuleValidPixel &other)
te::rp::ComposerRuleValidPixel::m_noDataValues2
std::vector< std::complex< double > > m_noDataValues2
Definition: ComposerRuleValidPixel.h:87
te::rp::ComposerRuleValidPixel::ComposerRuleValidPixel
ComposerRuleValidPixel()
te::rp::ComposerRuleValidPixel::m_getComposedValues_rasterCol
double m_getComposedValues_rasterCol
Definition: ComposerRuleValidPixel.h:98
te::rp::ComposerRuleValidPixel::m_getComposedValues_PixelValue
std::complex< double > m_getComposedValues_PixelValue
Definition: ComposerRuleValidPixel.h:92
te::rp::ComposerRuleValidPixel::~ComposerRuleValidPixel
~ComposerRuleValidPixel()
te::rp::ComposerRuleValidPixel::ComposerRuleValidPixel
ComposerRuleValidPixel(const ComposerRuleValidPixel &other)