SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SaturateFlagSourceTask.h
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#ifndef _SEIMPLEMENTATION_PLUGIN_ATURATEFLAGSOURCETASK_H_
40#define _SEIMPLEMENTATION_PLUGIN_ATURATEFLAGSOURCETASK_H_
41
44
49
51
52namespace SourceXtractor {
53
55public:
57
58 virtual ~SaturateFlagSourceTask() = default;
59
61 bool saturate_flag = false;
62
65
66 const auto saturation = measurement_frame_info.getSaturation();
68
69 if (saturation > 0 && measurement_rectangle.getWidth()) {
70 // iterate over all pixel values
72 measurement_rectangle.getTopLeft().m_x, measurement_rectangle.getTopLeft().m_y,
73 measurement_rectangle.getWidth(), measurement_rectangle.getHeight());
74
75 for (int y = 0; y < stamp->getHeight(); ++y) {
76 for (int x = 0; x < stamp->getWidth(); ++x) {
77 if (stamp->getValue(x, y) >= saturation) {
78 saturate_flag = true;
79 break;
80 }
81 }
82 }
83 }
84
85 // set the property
86 source.setIndexedProperty<SaturateFlag>(m_instance, saturate_flag);
87 };
88private:
89 unsigned m_instance;
90
91}; // End of SaturateFlagSourceTask class
92
93} // namespace SourceXtractor
94
95#endif /* _SEIMPLEMENTATION_PLUGIN_ATURATEFLAGSOURCETASK_H_ */
96
97
98
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
virtual void computeProperties(SourceInterface &source) const
Computes one or more properties for the Source.
The SourceInterface is an abstract "source" that has properties attached to it.
A Task that acts on a Source to compute one or more properties.
Definition SourceTask.h:36
@ LayerOriginalImage
Definition Frame.h:37
static StaticPlugin< SaturateFlagPlugin > saturate_flag