All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Raster.h
Go to the documentation of this file.
1 /* Copyright (C) 2008-2013 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  private:
86 
87  std::vector<te::rst::Band*> m_bands; //!< The list of data bands.
88  void (*m_deleter)(void*); //!< A pointer to a deleter function, if the buffer needs to be deleted by this object.
89  void* m_externalBuffer; //!< An external buffer.
90  };
91 
92  } // end namespace mem
93 } // end namespace te
94 
95 #endif //__TERRALIB_MEMORY_INTERNAL_RASTER_H
void * m_externalBuffer
An external buffer.
Definition: Raster.h:89
#define TEMEMORYEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:122
Configuration flags for the TerraLib In-memory Data Access driver.
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:40
A raster class for memory.
Definition: Raster.h:44
A rectified grid is the spatial support for raster data.
Definition: Grid.h:55
A raster band description.
Definition: Band.h:63
std::vector< te::rst::Band * > m_bands
The list of data bands.
Definition: Raster.h:87
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
An abstract class for raster data strucutures.
Definition: Raster.h:70