SourceXtractorPlusPlus
0.12
Please provide a description of the project.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SEImplementation
src
lib
Plugin
SourceFlags
SourceFlagsSourceTask.cpp
Go to the documentation of this file.
1
17
/*
18
* Copyright (C) 2012-2020 Euclid Science Ground Segment
19
*
20
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
21
* Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option)
22
* any later version.
23
*
24
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
25
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
26
* details.
27
*
28
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
29
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30
*/
31
39
#include "
SEImplementation/Plugin/BlendedFlag/BlendedFlag.h
"
40
#include "
SEImplementation/Plugin/SourceFlags/SourceFlagsSourceTask.h
"
41
#include "
SEImplementation/Plugin/SourceFlags/SourceFlags.h
"
42
43
namespace
SourceXtractor {
44
45
void
SourceFlagsSourceTask::computeProperties
(
SourceInterface
&source)
const
{
46
std::vector<Flags>
source_flags
;
47
48
for
(
auto
group :
m_instances_per_group
) {
49
Flags
source_flag =
Flags::NONE
;
50
51
for
(
auto
instance : group.second) {
52
source_flag |=
Flags::SATURATED
* source.
getProperty
<
SaturateFlag
>(instance).getSaturateFlag();
53
source_flag |=
Flags::BOUNDARY
* source.
getProperty
<
BoundaryFlag
>(instance).getBoundaryFlag();
54
source_flag |=
Flags::BLENDED
* source.
getProperty
<
BlendedFlag
>().getBlendedFlag();
55
}
56
57
source_flags.
emplace_back
(source_flag);
58
}
59
60
// set the combined source flag
61
source.
setProperty
<
SourceFlags
>(
source_flags
);
62
}
63
64
}
// end SourceXtractor
SourceXtractor::source_flags
static StaticPlugin< SourceFlagsPlugin > source_flags
Definition:
SourceFlagsPlugin.cpp:43
SourceXtractor::SaturateFlag
Definition:
SaturateFlag.h:46
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition:
SourceInterface.h:57
SourceXtractor::Flags::NONE
No flag is set.
SourceXtractor::BlendedFlag
Definition:
BlendedFlag.h:31
SourceFlags.h
SourceXtractor::SourceFlagsSourceTask::computeProperties
virtual void computeProperties(SourceInterface &source) const
Computes one or more properties for the Source.
Definition:
SourceFlagsSourceTask.cpp:45
SourceXtractor::SourceInterface::setProperty
void setProperty(Args...args)
Definition:
SourceInterface.h:72
SourceXtractor::Flags::BOUNDARY
The object is truncated (too close to an image boundary)
SourceXtractor::SourceFlagsSourceTask::m_instances_per_group
std::map< std::string, std::vector< unsigned int > > m_instances_per_group
Definition:
SourceFlagsSourceTask.h:58
SourceFlagsSourceTask.h
SourceXtractor::SourceFlags
Definition:
SourceFlags.h:48
std::vector< Flags >
SourceXtractor::BoundaryFlag
Definition:
BoundaryFlag.h:46
SourceXtractor::Flags::SATURATED
At least one pixel of the object is saturated.
SourceXtractor::Flags
Flags
Flagging of bad sources.
Definition:
SourceFlags.h:34
SourceXtractor::Flags::BLENDED
The object was originally blended with another one.
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition:
SourceInterface.h:46
BlendedFlag.h
std::vector::emplace_back
T emplace_back(T...args)
Generated by
1.8.5