CMorphologicalProcessorComp.h
Go to the documentation of this file.
1 #ifndef iipr_CMorphologicalProcessorComp_included
2 #define iipr_CMorphologicalProcessorComp_included
3 
4 
5 // ACF includes
6 #include <iprm/COptionsManager.h>
7 #include <imod/TModelWrap.h>
8 
9 
10 // ACF-Solutions includes
12 
13 
14 namespace iipr
15 {
16 
17 
22 {
23 public:
25 
27  {
37  };
38 
40  {
45  };
46 
47  I_BEGIN_COMPONENT(CMorphologicalProcessorComp);
48  I_REGISTER_SUBELEMENT(ProcessingModes);
49  I_REGISTER_SUBELEMENT_INTERFACE(ProcessingModes, istd::IChangeable, ExtractProcessingModes);
50  I_REGISTER_SUBELEMENT_INTERFACE(ProcessingModes, iprm::IOptionsList, ExtractProcessingModes);
51  I_REGISTER_SUBELEMENT(FilterForms);
52  I_REGISTER_SUBELEMENT_INTERFACE(FilterForms, istd::IChangeable, ExtractFilterForms);
53  I_REGISTER_SUBELEMENT_INTERFACE(FilterForms, iprm::IOptionsList, ExtractFilterForms);
54  I_ASSIGN(m_filterSizeParamsIdAttrPtr, "FilterSizeParamsId", "ID of the filter dimension parameter in the processing parameter set", true, "FilterSizeParamsId");
55  I_ASSIGN(m_defaultProcessingModeAttrPtr, "ProcessingMode", "Filter processing mode\n0 - Erosion\n1 - Dilatation\n2 - Opening\n3 - Closing\n4 - White Top Hat\n5 - Black Top Hat\n6 - Morphological Gradient", true, PM_FIRST);
56  I_ASSIGN(m_processingModeIdAttrPtr, "ProcessingModeId", "ID of the the procesing mode parameter in the processing parameter set", false, "ProcessingMode");
57  I_ASSIGN(m_defaultFilterFormTypeAttrPtr, "FilterFormType", "Type of filter form:\n0 - Rectangular([n, m])\n1 - Circular([n, n])", true, 0);
58  I_ASSIGN(m_filterFormTypeIdAttrPtr, "FilterFormTypeParamId", "ID of the filter form type parameter in the processing parameter set", false, "FilterFormType");
59  I_END_COMPONENT;
60 
61 protected:
62  // reimplemented (CImageRegionProcessorCompBase)
63  virtual bool ProcessImageRegion(
64  const iimg::IBitmap& inputBitmap,
65  const iprm::IParamsSet* paramsPtr,
66  const i2d::IObject2d* aoiPtr,
67  istd::IChangeable* outputPtr) const;
68 
69  // reimplemented (icomp::CComponentBase)
70  void OnComponentCreated();
71 
72 private:
73  ProcessingMode GetProcessingMode(const iprm::IParamsSet* paramsPtr) const;
74  KernelType GetKernelType(const iprm::IParamsSet* paramsPtr) const;
75 
76  template <class InterfaceType>
77  static InterfaceType* ExtractProcessingModes(CMorphologicalProcessorComp& component)
78  {
79  return &component.m_processingModes;
80  }
81 
82  template <class InterfaceType>
83  static InterfaceType* ExtractFilterForms(CMorphologicalProcessorComp& component)
84  {
85  return &component.m_filterForms;
86  }
87 
88 private:
89  I_ATTR(QByteArray, m_filterSizeParamsIdAttrPtr);
90  I_ATTR(int, m_defaultProcessingModeAttrPtr);
91  I_ATTR(QByteArray, m_processingModeIdAttrPtr);
92 
93  I_ATTR(int, m_defaultFilterFormTypeAttrPtr);
94  I_ATTR(QByteArray, m_filterFormTypeIdAttrPtr);
95 
98 };
99 
100 
101 } // namespace iipr
102 
103 
104 #endif // !iipr_CMorphologicalProcessorComp_included
105 
CImageRegionProcessorCompBase BaseClass
Basic implementation for a image region processor.
virtual bool ProcessImageRegion(const iimg::IBitmap &inputBitmap, const iprm::IParamsSet *paramsPtr, const i2d::IObject2d *aoiPtr, istd::IChangeable *outputPtr) const
Process the defined image region.

© 2007-2017 Witold Gantzke and Kirill Lepskiy