Loading...
Searching...
No Matches
BandProperty.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/raster/BandProperty.h
22
23 \brief It describes one band (or dimension) of a raster.
24*/
25
26#ifndef __TERRALIB_RASTER_INTERNAL_BANDPROPERTY_H
27#define __TERRALIB_RASTER_INTERNAL_BANDPROPERTY_H
28
29// TerraLib
31#include "Config.h"
32#include "Enums.h"
33
34// STL
35#include <complex>
36#include <string>
37#include <vector>
38
39// Boost
40#include <boost/shared_ptr.hpp>
41
42namespace te
43{
44 namespace rst
45 {
46 /*!
47 \class BandProperty
48
49 \brief A raster band description.
50
51 The band property describes how to interpret (and use) values that
52 can be associated to each element of a raster, in one given dimension
53 (e.g. a band of multi-hiperspectral remote sensing image). Each instance
54 of this class refers to a particular dimension. This implementation defines
55 a set of information commonly used to describe any raster.
56
57 \ingroup rst
58
59 \sa RasterProperty, Raster, Band
60 */
62 {
63 public:
64
65 /*!
66 \struct ColorEntry
67
68 \brief An structure to represent a color tuple.
69 */
71 {
72 short c1; //!< gray, red, cyan or hue.
73 short c2; //!< green, magenta, or lightness.
74 short c3; //!< blue, yellow, or saturation.
75 short c4; //!< alpha or blackband.
76 };
77
78 /*!
79 \brief Constructor.
80
81 \param idx The band index in the set of bands.
82 \param t The data type of the band elements.
83 \param desc The band description.
84 */
85 BandProperty(std::size_t idx, int t, const std::string& desc = std::string(""));
86
87 /*!
88 \brief Copy constructor.
89
90 \param rhs The right-hand-side copy that would be used to copy from.
91 */
93
94 /*! \brief Destructor. */
96
97 /*!
98 \brief Assignment operator.
99
100 \param rhs The right-hand-side copy that would be used to copy from.
101
102 \return A reference to this object.
103 */
105
106 /*!
107 \brief It returns the data type of the elements in the band.
108
109 \note The types are listed in terralib/datatype/DataTypes.h
110
111 \return The data type of the elements in the band.
112 */
113 int getType() const { return m_type; }
114
115 /*! \brief It returns the unit of measure of the values. */
117
118 /*!
119 \brief Sets the unit of measure of the values;
120
121 \param u The new unit of measure.
122
123 \note The object does not take the ownership of the unit.
124 */
126
127 /* \brief Returns if the band is complex (true) or not (false). */
128 bool isComplex() const;
129
130 public:
131
132 std::size_t m_idx; //!< The band index.
133 int m_type; //!< The data type of the elements in the band ( See te::dt namespace basic data types for reference ).
134 std::string m_description; //!< A description.
135 std::vector<std::pair<std::string, std::string> > m_metadata; //!< A list of metadata where each element consists of a (key, value).
136 double m_noDataValue; //!< Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
137 std::complex<double> m_valuesOffset; //!< Offset is the values (real and imaginary) to add to grid values for this sample dimension, default is 0.
138 std::complex<double> m_valuesScale; //!< Scale is the values (real and imaginary) which is multiplied to grid values for this sample dimension, default is 1.
139 std::vector<std::string> m_categoryNames; //!< Set of categoric names for the values contained in a dimension.
140 ColorInterp m_colorInterp; //!< The color interpretation.
141 PaletteInterpretation m_paletteInterp; //!< Pallete interpretation.
142 std::vector<ColorEntry> m_palette; //!< The color palette.
143 int m_blkw; //!< Block width (pixels).
144 int m_blkh; //!< Block height (pixels).
145 int m_nblocksx; //!< The number of blocks in x.
146 int m_nblocksy; //!< The number of blocks in y.
147 double m_min; //!< Minimum pixel value (default is std::numeric_limits<double>::max() which means no value set).
148 double m_max; //!< Maximum pixel value (default is std::numeric_limits<double>::max() which means no value set).
149 double m_mean; //!< Mean of all pixel values (default is std::numeric_limits<double>::max() which means no value set).
150 double m_stdDev; //!< Standard deviation of all pixel values (default is std::numeric_limits<double>::max() which means no value set).
151
152 protected:
153
154 te::common::UnitOfMeasurePtr m_unit; //!< The unit of values.
155 };
156
157 typedef boost::shared_ptr<BandProperty> BandPropertyPtr;
158
159 } // end namespace rst
160} // end namespace te
161
162#endif // __TERRALIB_RASTER_INTERNAL_BANDPROPERTY_H
A class for representing a unit of measure.
BandProperty & operator=(const BandProperty &rhs)
Assignment operator.
int m_nblocksx
The number of blocks in x.
int getType() const
It returns the data type of the elements in the band.
double m_max
Maximum pixel value (default is std::numeric_limits<double>::max() which means no value set).
BandProperty(const BandProperty &rhs)
Copy constructor.
double m_min
Minimum pixel value (default is std::numeric_limits<double>::max() which means no value set).
std::string m_description
A description.
std::complex< double > m_valuesScale
Scale is the values (real and imaginary) which is multiplied to grid values for this sample dimension...
PaletteInterpretation m_paletteInterp
Pallete interpretation.
std::complex< double > m_valuesOffset
Offset is the values (real and imaginary) to add to grid values for this sample dimension,...
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
std::vector< ColorEntry > m_palette
The color palette.
int m_blkw
Block width (pixels).
bool isComplex() const
double m_stdDev
Standard deviation of all pixel values (default is std::numeric_limits<double>::max() which means no ...
void setUnitOfMeasure(te::common::UnitOfMeasurePtr u)
Sets the unit of measure of the values;.
~BandProperty()
Destructor.
int m_blkh
Block height (pixels).
te::common::UnitOfMeasurePtr m_unit
The unit of values.
ColorInterp m_colorInterp
The color interpretation.
std::vector< std::string > m_categoryNames
Set of categoric names for the values contained in a dimension.
const te::common::UnitOfMeasurePtr & getUnitOfMeasure() const
It returns the unit of measure of the values.
std::vector< std::pair< std::string, std::string > > m_metadata
A list of metadata where each element consists of a (key, value).
BandProperty(std::size_t idx, int t, const std::string &desc=std::string(""))
Constructor.
int m_nblocksy
The number of blocks in y.
int m_type
The data type of the elements in the band ( See te::dt namespace basic data types for reference ).
std::size_t m_idx
The band index.
double m_mean
Mean of all pixel values (default is std::numeric_limits<double>::max() which means no value set).
boost::shared_ptr< UnitOfMeasure > UnitOfMeasurePtr
Namespace for the Raster module of TerraLib.
PaletteInterpretation
Palette interpratation types.
Definition Enums.h:81
boost::shared_ptr< BandProperty > BandPropertyPtr
ColorInterp
Color model component use.
Definition Enums.h:55
TerraLib.
Enumerations for the Raster module.
An structure to represent a color tuple.
short c1
gray, red, cyan or hue.
short c3
blue, yellow, or saturation.
short c2
green, magenta, or lightness.
short c4
alpha or blackband.
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