Loading...
Searching...
No Matches
GainOffsetProxyRaster.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_RASTER_INTERNAL_GAINOFFSETPROXYRASTER_H
21#define __TERRALIB_RASTER_INTERNAL_GAINOFFSETPROXYRASTER_H
22
23// TerraLib
24#include "Raster.h"
25#include "Config.h"
26
27#include <memory>
28#include <vector>
29
30namespace te
31{
32 namespace rst
33 {
35
36 /*!
37 \class GainOffsetProxyRaster
38
39 \brief A proxy class to dynamically apply gains/offsets to/from each input raster band.
40
41 \note OutputValue = ( InputValue * gain ) + offset
42
43 \ingroup rst
44 */
46 {
47 public:
48
49 /*!
50 \brief Default Constructor.
51 \param inputRaster Input raster (this instance must be always valid).
52 \param gains A vector of gains for each input band..
53 \param offsets A vector of offsets for each input band..
54 \param noDataValues External values to be interpreted as No-data values.
55 */
57 const std::vector< double >& gains, const std::vector< double >& offsets,
58 const std::vector< double >& noDataValues );
59
60 /*! \brief Destructor. */
62
63 // mandatory overloads of pure virtual methods
64 void open(const std::map<std::string, std::string>& rinfo, te::common::AccessPolicy p = te::common::RAccess);
65 std::map<std::string, std::string> getInfo() const;
66 std::size_t getNumberOfBands() const;
67 int getBandDataType(std::size_t i) const;
68 const Band* getBand(std::size_t i) const;
69 Band* getBand(std::size_t i);
70 const Band& operator[](std::size_t i) const;
71 Band& operator[](std::size_t i);
72 bool createMultiResolution( const unsigned int levels,
73 const InterpolationMethod interpMethod );
75 unsigned int getMultiResLevelsCount() const;
76 Raster* getMultiResLevel( const unsigned int level ) const;
77
78 // overloads
79
80 protected:
81
82 te::rst::Raster const * m_inputRasterPtr; //!< Input raster pointer.
83 std::vector< std::shared_ptr< GainOffsetProxyBand > > m_bands; //!< Pointers the this instance bands.
84 std::vector< double > m_noDataValues; //!< External values to be interpreted as No-data values..
85
86 /*!
87 \brief This instance info.
88 */
89 std::map<std::string, std::string> m_rasterInfo;
90
92
93 private:
94
98 };
99 } // end namespace rst
100} // end namespace te
101
102#endif //__TERRALIB_RASTER_INTERNAL_GAINOFFSETPROXYRASTER_H
AbstractData()
Constructor.
A raster band description.
Definition Band.h:64
GainOffsetProxyRaster raster band.
void open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
Opens a raster.
unsigned int getMultiResLevelsCount() const
Returns the current number of multi-resolution pyramid levels.
std::size_t getNumberOfBands() const
Returns the number of bands (dimension of cells attribute values) in the raster.
const Band * getBand(std::size_t i) const
Returns the raster i-th band.
GainOffsetProxyRaster(const GainOffsetProxyRaster &rhs)
Raster * getMultiResLevel(const unsigned int level) const
Returns the required level of a multi-resolution pyramid or NULL if that level does not exists.
te::rst::Raster const * m_inputRasterPtr
Input raster pointer.
GainOffsetProxyRaster(te::rst::Raster &inputRaster, const std::vector< double > &gains, const std::vector< double > &offsets, const std::vector< double > &noDataValues)
Default Constructor.
std::map< std::string, std::string > m_rasterInfo
This instance info.
std::map< std::string, std::string > getInfo() const
It returns additional information about the raster.
std::vector< std::shared_ptr< GainOffsetProxyBand > > m_bands
Pointers the this instance bands.
int getBandDataType(std::size_t i) const
Returns the data type in a particular band (or dimension).
AbstractData * clone() const
It returns a clone of this object.
const Band & operator[](std::size_t i) const
Access band in i position.
bool createMultiResolution(const unsigned int levels, const InterpolationMethod interpMethod)
Create a sub-sampled multi-resolution pyramid.
bool removeMultiResolution()
Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.
Band & operator[](std::size_t i)
Access band in i position.
std::vector< double > m_noDataValues
External values to be interpreted as No-data values..
Band * getBand(std::size_t i)
Returns the raster i-th band.
An abstract class for raster data strucutures.
Definition Raster.h:72
Raster()
Default constructor.
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition Enums.h:41
@ RAccess
Definition Enums.h:43
Namespace for the Raster module of TerraLib.
InterpolationMethod
Allowed interpolation methods.
Definition Enums.h:93
TerraLib.
An abstract class for raster data strucutures.
Configuration flags for the Raster module of TerraLib.
#define TERASTEREXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition Config.h:63