Loading...
Searching...
No Matches
TiledBand.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/TiledBand.h
22
23 \brief A tiled band implementation for the In-Memory Raster.
24*/
25
26#ifndef __TERRALIB_MEMORY_INTERNAL_TILEDBAND_H
27#define __TERRALIB_MEMORY_INTERNAL_TILEDBAND_H
28
29// TerraLib
30#include "../raster/Band.h"
31#include "../raster/BlockUtils.h"
32#include "Config.h"
33
34namespace te
35{
36 namespace mem
37 {
38// Forward declaration
39 class Raster;
40
41 /*!
42 \class Band
43
44 \brief A tiled band implementation for the In-Memory Raster.
45 */
47 {
48 public:
49
50 TiledBand(Raster* r, te::rst::BandProperty* p, std::size_t idx);
51
52 TiledBand(const TiledBand& rhs);
53
55
57
59
60 void getValue(unsigned int c, unsigned int r, double& value) const;
61
62 void setValue(unsigned int c, unsigned int r, const double value);
63
64 void getIValue(unsigned int c, unsigned int r, double& value) const;
65
66 void setIValue(unsigned int c, unsigned int r, const double value);
67
68 void read(int x, int y, void* buffer) const;
69
70 void* read(int x, int y);
71
72 void write(int x, int y, void* buffer);
73
74 /*!
75 \note In-Memory driver extended method.
76 */
77 void setRaster(Raster* r);
78
79 private:
80
82 unsigned char*** m_buff; //!< A internal block buffer.
83 te::rst::GetBufferValueFPtr m_getBuff; //!< A pointer to a function that helps to extract a double or complex value from a specific buffer data type (char, int16, int32, float, ...).
84 te::rst::GetBufferValueFPtr m_getBuffI; //!< A pointer to a function that helps to extract the imaginary part value from a specific buffer data type (cint16, cint32, cfloat, cdouble).
85 te::rst::SetBufferValueFPtr m_setBuff; //!< A pointer to a function that helps to insert a double or complex value into a specific buffer data type (char, int16, int32, float, ...).
86 te::rst::SetBufferValueFPtr m_setBuffI; //!< A pointer to a function that helps to insert the imaginary part value into a specific buffer data type (cint16, cint32, cfloat, cdouble).
87 int m_ncols; //!< Buffered number of cols.
88 int m_nrows; //!< Buffered number of rows.
89 int m_blksize; //!< The data block size.
92 int m_blkw;
93 int m_blkh;
94 };
95
96 } // end namespace mem
97} // end namespace te
98
99#endif // __TERRALIB_MEMORY_INTERNAL_TILEDBAND_H
A raster class for memory.
Definition: Raster.h:45
int m_blksize
The data block size.
Definition: TiledBand.h:89
void write(int x, int y, void *buffer)
It writes a data block from the specified buffer.
te::rst::GetBufferValueFPtr m_getBuff
A pointer to a function that helps to extract a double or complex value from a specific buffer data t...
Definition: TiledBand.h:83
void getIValue(unsigned int c, unsigned int r, double &value) const
Returns the imaginary attribute value in a complex band of a cell.
te::rst::SetBufferValueFPtr m_setBuffI
A pointer to a function that helps to insert the imaginary part value into a specific buffer data typ...
Definition: TiledBand.h:86
TiledBand & operator=(const TiledBand &rhs)
TiledBand(const TiledBand &rhs)
void setRaster(Raster *r)
te::rst::SetBufferValueFPtr m_setBuff
A pointer to a function that helps to insert a double or complex value into a specific buffer data ty...
Definition: TiledBand.h:85
te::rst::Raster * getRaster() const
Returns the associated raster.
void getValue(unsigned int c, unsigned int r, double &value) const
Returns the cell attribute value.
TiledBand(Raster *r, te::rst::BandProperty *p, std::size_t idx)
void setIValue(unsigned int c, unsigned int r, const double value)
Sets the imaginary attribute value in a complex band of a cell.
void read(int x, int y, void *buffer) const
It reads a data block to the specified buffer.
void setValue(unsigned int c, unsigned int r, const double value)
Sets the cell attribute value.
unsigned char *** m_buff
A internal block buffer.
Definition: TiledBand.h:82
void * read(int x, int y)
It reads and returns a data block.
Raster * m_raster
Definition: TiledBand.h:81
te::rst::GetBufferValueFPtr m_getBuffI
A pointer to a function that helps to extract the imaginary part value from a specific buffer data ty...
Definition: TiledBand.h:84
int m_nrows
Buffered number of rows.
Definition: TiledBand.h:88
int m_ncols
Buffered number of cols.
Definition: TiledBand.h:87
A raster band description.
Definition: BandProperty.h:62
A raster band description.
Definition: Band.h:64
An abstract class for raster data strucutures.
Definition: Raster.h:72
void(* SetBufferValueFPtr)(int index, void *buffer, const double *value)
The type of function used to extract data from a buffer.
Definition: BlockUtils.h:40
void(* GetBufferValueFPtr)(int index, void *buffer, double *value)
The type of function used to extract data from a buffer.
Definition: BlockUtils.h:37
TerraLib.
#define TEMEMORYEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:84
Proxy configuration file for TerraView (see terraview_config.h).