All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BandProperty.cpp
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.cpp
22 
23  \brief It describes the range of one dimension of a raster.
24 */
25 
26 // TerraLib
27 #include "../common/UnitOfMeasure.h"
28 #include "../datatype/Enums.h"
29 #include "BandProperty.h"
30 #include "Enums.h"
31 
32 // STL
33 #include <limits>
34 
35 te::rst::BandProperty::BandProperty(std::size_t idx, int t, const std::string& desc)
36  : m_idx(idx),
37  m_type(t),
38  m_description(desc),
39  m_noDataValue(std::numeric_limits<double>::max()),
40  m_valuesOffset(0.0, 0.0),
41  m_valuesScale(1.0, 0.0),
42  m_colorInterp(te::rst::UndefCInt),
43  m_paletteInterp(te::rst::UndefPalInt),
44  m_blkw(0),
45  m_blkh(0),
46  m_nblocksx(0),
47  m_nblocksy(0)
48 {
49 }
50 
52  : m_idx(rhs.m_idx),
53  m_type(rhs.m_type),
54  m_description(rhs.m_description),
55  m_metadata(rhs.m_metadata),
56  m_noDataValue(rhs.m_noDataValue),
57  m_valuesOffset(rhs.m_valuesOffset),
58  m_valuesScale(rhs.m_valuesScale),
59  m_categoryNames(rhs.m_categoryNames),
60  m_colorInterp(rhs.m_colorInterp),
61  m_paletteInterp(rhs.m_paletteInterp),
62  m_palette(rhs.m_palette),
63  m_blkw(rhs.m_blkw),
64  m_blkh(rhs.m_blkh),
65  m_nblocksx(rhs.m_nblocksx),
66  m_nblocksy(rhs.m_nblocksy),
67  m_unit(rhs.m_unit)
68 {
69 }
70 
72 {
73 }
74 
76 {
77  if(this != &rhs)
78  {
79  m_idx = rhs.m_idx;
80  m_type = rhs.m_type;
81  m_description = rhs.m_description;
82  m_metadata = rhs.m_metadata;
83  m_noDataValue = rhs.m_noDataValue;
84  m_valuesOffset = rhs.m_valuesOffset;
85  m_valuesScale = rhs.m_valuesScale;
86  m_categoryNames = rhs.m_categoryNames;
87  m_colorInterp = rhs.m_colorInterp;
88  m_paletteInterp = rhs.m_paletteInterp;
89  m_palette = rhs.m_palette;
90  m_blkw = rhs.m_blkw;
91  m_blkh = rhs.m_blkh;
92  m_nblocksx = rhs.m_nblocksx;
93  m_nblocksy = rhs.m_nblocksy;
94  m_unit = rhs.m_unit;
95  }
96 
97  return *this;
98 }
99 
101 {
102  return (m_type == te::dt::CDOUBLE_TYPE || m_type == te::dt::CFLOAT_TYPE ||
103  m_type == te::dt::CINT16_TYPE || m_type == te::dt::CINT32_TYPE);
104 }
std::size_t m_idx
The band index.
Definition: BandProperty.h:132
It describes one band (or dimension) of a raster.
std::vector< ColorEntry > m_palette
The color palette.
Definition: BandProperty.h:142
std::vector< std::string > m_categoryNames
Set of categoric names for the values contained in a dimension.
Definition: BandProperty.h:139
A raster band description.
Definition: BandProperty.h:61
int m_nblocksx
The number of blocks in x.
Definition: BandProperty.h:145
int m_nblocksy
The number of blocks in y.
Definition: BandProperty.h:146
BandProperty(std::size_t idx, int t, const std::string &desc=std::string(""))
Constructor.
int m_type
The data type of the elements in the band.
Definition: BandProperty.h:133
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits::max().
Definition: BandProperty.h:136
bool isComplex() const
std::vector< std::pair< std::string, std::string > > m_metadata
A list of metadata where each element consists of a (key, value).
Definition: BandProperty.h:135
std::complex< double > m_valuesScale
Scale is the values (real and imaginary) which is multiplied to grid values for this sample dimension...
Definition: BandProperty.h:138
int m_blkw
Block width (pixels).
Definition: BandProperty.h:143
No color interpretation is associated with the band.
Definition: Enums.h:56
Undefined palette interpretation.
Definition: Enums.h:82
BandProperty & operator=(const BandProperty &rhs)
Assignment operator.
General enumerations for the data type module.
~BandProperty()
Destructor.
std::complex< double > m_valuesOffset
Offset is the values (real and imaginary) to add to grid values for this sample dimension, default is 0.
Definition: BandProperty.h:137
std::string m_description
A description.
Definition: BandProperty.h:134
te::common::UnitOfMeasurePtr m_unit
The unit of values.
Definition: BandProperty.h:150
int m_blkh
Block height (pixels).
Definition: BandProperty.h:144
ColorInterp m_colorInterp
The color interpretation.
Definition: BandProperty.h:140
PaletteInterpretation m_paletteInterp
Pallete interpretation.
Definition: BandProperty.h:141