CRectImageSmoothProcessorComp.h
Go to the documentation of this file.
1 #ifndef iipr_CRectImageSmoothProcessorComp_included
2 #define iipr_CRectImageSmoothProcessorComp_included
3 
4 
5 // ACF-Solutions includes
6 #include <imeas/INumericValue.h>
9 
10 
11 namespace iipr
12 {
13 
14 
21 {
22 public:
24 
25  enum UnitMode
26  {
30  };
31 
33  {
36  };
37 
38  I_BEGIN_COMPONENT(CRectImageSmoothProcessorComp);
39  I_REGISTER_SUBELEMENT(FilterContraints);
40  I_REGISTER_SUBELEMENT_INTERFACE(FilterContraints, imeas::INumericConstraints, ExtractFilterContraints);
41  I_REGISTER_SUBELEMENT_INTERFACE(FilterContraints, istd::IChangeable, ExtractFilterContraints);
42  I_ASSIGN(m_unitModeAttrPtr, "UnitMode", "Define used units for filter kernel definition:\n\t0 - Pixels\n\t1 - Percent of width and height\n\t2 - Percent of diagonal", true, 0);
43  I_ASSIGN(m_borderModeAttrPtr, "BorderMode", "Define used mode for border area:\n\t0 - Kernel will be stretched, original image size will be outputed\n\t1 - Border area removed, output image will be smaller", true, 0);
44  I_ASSIGN(m_filterParamsIdAttrPtr, "FilterParamsId", "ID of filter length parameters in the parameter set (imeas::INumericValue)", false, "FilterParams");
45  I_ASSIGN(m_defaultFilterParamsCompPtr, "DefaultFilterParams", "Default filter parameters", false, "DefaultFilterParams");
46  I_END_COMPONENT;
47 
48  static bool DoRectFilter(
49  int filterWidth,
50  int filterHeight,
51  iimg::IBitmap::PixelFormat outputPixelFormat,
52  const iimg::IBitmap& inputBitmap,
53  iimg::IBitmap& outputBitmap,
54  BorderMode borderMode = BM_STRETCH_KERNEL);
55  static bool DoRectFilterHorizontal(
56  int filterWidth,
57  iimg::IBitmap::PixelFormat outputPixelFormat,
58  const iimg::IBitmap& inputBitmap,
59  iimg::IBitmap& outputBitmap,
60  BorderMode borderMode = BM_STRETCH_KERNEL);
61  static bool DoRectFilterVertical(
62  int filterHeight,
63  iimg::IBitmap::PixelFormat outputPixelFormat,
64  const iimg::IBitmap& inputBitmap,
65  iimg::IBitmap& outputBitmap,
66  BorderMode borderMode = BM_STRETCH_KERNEL);
67 
68 protected:
69  // reimplemented (iipr::CImageProcessorCompBase)
70  virtual bool ProcessImage(
71  const iprm::IParamsSet* paramsPtr,
72  const iimg::IBitmap& inputImage,
73  iimg::IBitmap& outputImage) const;
74 
75  // reimplemented (icomp::CComponentBase)
76  virtual void OnComponentCreated();
77 
78 private:
79  // static template methods for subelement access
80  template <class InterfaceType>
81  static InterfaceType* ExtractFilterContraints(CRectImageSmoothProcessorComp& component)
82  {
83  return &component.m_filterConstraints;
84  }
85 
86  I_ATTR(int, m_unitModeAttrPtr);
87  I_ATTR(int, m_borderModeAttrPtr);
88  I_ATTR(QByteArray, m_filterParamsIdAttrPtr);
89  I_REF(imeas::INumericValue, m_defaultFilterParamsCompPtr);
90 
91  imeas::CGeneralNumericConstraints m_filterConstraints;
92 };
93 
94 
95 } // namespace iipr
96 
97 
98 #endif // !iipr_CRectImageSmoothProcessorComp_included
99 
100 
static bool DoRectFilterHorizontal(int filterWidth, iimg::IBitmap::PixelFormat outputPixelFormat, const iimg::IBitmap &inputBitmap, iimg::IBitmap &outputBitmap, BorderMode borderMode=BM_STRETCH_KERNEL)
Describe additional meta information for set of numeric values.
Basic implementation for a simple bitmap processor.
static bool DoRectFilter(int filterWidth, int filterHeight, iimg::IBitmap::PixelFormat outputPixelFormat, const iimg::IBitmap &inputBitmap, iimg::IBitmap &outputBitmap, BorderMode borderMode=BM_STRETCH_KERNEL)
General parameter set containing list of numeric values.
Definition: INumericValue.h:20
Implementation of image smooth operator with homogeneous rectangle kernel.
virtual bool ProcessImage(const iprm::IParamsSet *paramsPtr, const iimg::IBitmap &inputImage, iimg::IBitmap &outputImage) const
static bool DoRectFilterVertical(int filterHeight, iimg::IBitmap::PixelFormat outputPixelFormat, const iimg::IBitmap &inputBitmap, iimg::IBitmap &outputBitmap, BorderMode borderMode=BM_STRETCH_KERNEL)
Simple implementation of imeas::INumericConstraints interface.

© 2007-2017 Witold Gantzke and Kirill Lepskiy