Raster.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/memory/Raster.h
22 
23  \brief A raster class for memory.
24 */
25 
26 #ifndef __TERRALIB_MEMORY_INTERNAL_RASTER_H
27 #define __TERRALIB_MEMORY_INTERNAL_RASTER_H
28 
29 // TerraLib
30 #include "../raster/Raster.h"
31 #include "Config.h"
32 
33 namespace te
34 {
35  namespace mem
36  {
37  /*!
38  \class Raster
39 
40  \brief A raster class for memory.
41 
42  \sa te::rst::Raster
43  */
45  {
46  public:
47 
48  Raster();
49 
50  Raster(const Raster& rhs);
51 
52  ~Raster();
53 
54  void open(const std::map<std::string, std::string>& rinfo, te::common::AccessPolicy p = te::common::RAccess);
55 
56  std::map<std::string, std::string> getInfo() const;
57 
58  std::size_t getNumberOfBands() const;
59 
60  int getBandDataType(std::size_t i) const;
61 
62  const te::rst::Band* getBand(std::size_t i) const;
63 
64  te::rst::Band* getBand(std::size_t i);
65 
66  const te::rst::Band& operator[](std::size_t i) const;
67 
68  te::rst::Band& operator[](std::size_t i);
69 
70  te::dt::AbstractData* clone() const;
71 
72  /*!
73  \note In-Memory driver extended method.
74  */
75  void close();
76 
77  /*!
78  \note In-Memory driver extended method.
79  */
80  void create(te::rst::Grid* g,
81  const std::vector<te::rst::BandProperty*> bands,
82  const std::map<std::string, std::string>& rinfo,
83  void* h, void (*deleter)(void*));
84 
85  bool createMultiResolution( const unsigned int levels, const te::rst::InterpolationMethod interpMethod )
86  {
87  return false;
88  };
89 
90  bool removeMultiResolution() { return false; };
91 
92  unsigned int getMultiResLevelsCount() const
93  {
94  return 0;
95  }
96 
97  te::rst::Raster* getMultiResLevel( const unsigned int level ) const
98  {
99  return 0;
100  }
101 
102  private:
103 
104  std::vector<te::rst::Band*> m_bands; //!< The list of data bands.
105  void (*m_deleter)(void*); //!< A pointer to a deleter function, if the buffer needs to be deleted by this object.
106  void* m_externalBuffer; //!< An external buffer.
107  };
108 
109  } // end namespace mem
110 } // end namespace te
111 
112 #endif //__TERRALIB_MEMORY_INTERNAL_RASTER_H
A raster class for memory.
Definition: Raster.h:44
#define TEMEMORYEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:84
std::vector< te::rst::Band * > m_bands
The list of data bands.
Definition: Raster.h:104
Configuration flags for the TerraLib In-memory Data Access driver.
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:92
bool createMultiResolution(const unsigned int levels, const te::rst::InterpolationMethod interpMethod)
Create a sub-sampled multi-resolution pyramid.
Definition: Raster.h:85
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:40
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
A raster band description.
Definition: Band.h:63
unsigned int getMultiResLevelsCount() const
Returns the current number of multi-resolution pyramid levels.
Definition: Raster.h:92
te::rst::Raster * getMultiResLevel(const unsigned int level) const
Returns the required level of a multi-resolution pyramid or NULL if that level does not exists...
Definition: Raster.h:97
bool removeMultiResolution()
Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.
Definition: Raster.h:90
A rectified grid is the spatial support for raster data.
Definition: Grid.h:68
void * m_externalBuffer
An external buffer.
Definition: Raster.h:106