SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BackgroundAnalyzerFactory.cpp
Go to the documentation of this file.
1 
17 /*
18  * BackgroundAnalyzerFactory.cpp
19  *
20  * Created on: Mar 29, 2017
21  * Author: mschefer
22  */
23 
24 
26 
29 
30 namespace SourceXtractor {
31 
34 }
35 
37  WeightImageConfig::WeightType weight_type) const {
38  // make a SE2 background if cell size and smoothing box are given
39  if (m_cell_size.size() > 0 && m_smoothing_box.size() > 0) {
40  return std::make_shared<SEBackgroundLevelAnalyzer>(m_cell_size, m_smoothing_box, weight_type);
41  } else {
42  // make a simple background
43  return std::make_shared<SimpleBackgroundAnalyzer>();
44  }
45 }
46 
48  : Configuration(manager_id), m_weight_type(WeightImageConfig::WeightType::WEIGHT_TYPE_NONE) {
49  declareDependency<SE2BackgroundConfig>();
50  declareDependency<WeightImageConfig>();
51 }
52 
53 void BackgroundAnalyzerFactory::initialize(const UserValues&) {
54  auto se2background_config = getDependency<SE2BackgroundConfig>();
55  auto weight_image_config = getDependency<WeightImageConfig>();
56  m_cell_size = se2background_config.getCellSize();
57  m_smoothing_box = se2background_config.getSmoothingBox();
58  m_weight_type = weight_image_config.getWeightType();
59 }
60 
61 }
void initialize(const UserValues &args) override
T size(T...args)
std::shared_ptr< BackgroundAnalyzer > createBackgroundAnalyzer() const