All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ChannelSelection.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/se/ChannelSelection.cpp
22 
23  \brief ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such as a multi-band satellite-imagery source).
24 */
25 
26 // TerraLib
27 #include "ChannelSelection.h"
28 #include "SelectedChannel.h"
29 
31  : m_redChannel(0),
32  m_greenChannel(0),
33  m_blueChannel(0),
34  m_grayChannel(0),
35  m_colorCompType(UNKNOWN_COMPOSITION)
36 {
37 }
38 
40 {
41  delete m_redChannel;
42  delete m_greenChannel;
43  delete m_blueChannel;
44  delete m_grayChannel;
45 }
46 
48 {
49  delete m_redChannel;
50  m_redChannel = c;
51 }
52 
54 {
55  delete m_greenChannel;
56  m_greenChannel = c;
57 }
58 
60 {
61  delete m_blueChannel;
62  m_blueChannel = c;
63 }
64 
66 {
67  delete m_grayChannel;
68  m_grayChannel = c;
69 }
70 
72 {
73  m_colorCompType = cct;
74 }
75 
77 {
79 
80  cs->setColorCompositionType(m_colorCompType);
81 
82  if(m_redChannel)
83  cs->setRedChannel(m_redChannel->clone());
84 
85  if(m_greenChannel)
86  cs->setGreenChannel(m_greenChannel->clone());
87 
88  if(m_blueChannel)
89  cs->setBlueChannel(m_blueChannel->clone());
90 
91  if(m_grayChannel)
92  cs->setGrayChannel(m_grayChannel->clone());
93 
94  return cs;
95 }
void setRedChannel(SelectedChannel *c)
A selected channel to be display.
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...
ChannelSelection * clone() const
It creates a new copy of this object.
void setGrayChannel(SelectedChannel *c)
void setColorCompositionType(ColorCompositionType cct)
ColorCompositionType
Allowed color compositions type.
Definition: Enums.h:38
A selected channel to be display.
void setBlueChannel(SelectedChannel *c)
void setGreenChannel(SelectedChannel *c)
ChannelSelection()
It initializes a new ChannelSelection.
ChannelSelection specifies the false-color channel selection for a multi-spectral raster source (such...