ICF 3.1.1.10
Technical documentation of ICF Libraries
CRectImageSmoothProcessorComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iipr_CRectImageSmoothProcessorComp_included
7#define iipr_CRectImageSmoothProcessorComp_included
8
9
10// ICF includes
11#include <imeas/INumericValue.h>
14
15
16namespace iipr
17{
18
19
26{
27public:
29
36
42
43 I_BEGIN_COMPONENT(CRectImageSmoothProcessorComp);
44 I_REGISTER_SUBELEMENT(FilterContraints);
45 I_REGISTER_SUBELEMENT_INTERFACE(FilterContraints, imeas::INumericConstraints, ExtractFilterContraints);
46 I_REGISTER_SUBELEMENT_INTERFACE(FilterContraints, istd::IChangeable, ExtractFilterContraints);
47 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);
48 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);
49 I_ASSIGN(m_filterParamsIdAttrPtr, "FilterParamsId", "ID of filter length parameters in the parameter set (imeas::INumericValue)", false, "FilterParams");
50 I_ASSIGN(m_defaultFilterParamsCompPtr, "DefaultFilterParams", "Default filter parameters", false, "DefaultFilterParams");
51 I_END_COMPONENT;
52
53 static bool DoRectFilter(
54 int filterWidth,
55 int filterHeight,
56 iimg::IBitmap::PixelFormat outputPixelFormat,
57 const iimg::IBitmap& inputBitmap,
58 iimg::IBitmap& outputBitmap,
59 BorderMode borderMode = BM_STRETCH_KERNEL);
61 int filterWidth,
62 iimg::IBitmap::PixelFormat outputPixelFormat,
63 const iimg::IBitmap& inputBitmap,
64 iimg::IBitmap& outputBitmap,
65 BorderMode borderMode = BM_STRETCH_KERNEL);
67 int filterHeight,
68 iimg::IBitmap::PixelFormat outputPixelFormat,
69 const iimg::IBitmap& inputBitmap,
70 iimg::IBitmap& outputBitmap,
71 BorderMode borderMode = BM_STRETCH_KERNEL);
72
73protected:
74 // reimplemented (iipr::CImageProcessorCompBase)
75 virtual bool ProcessImage(
76 const iprm::IParamsSet* paramsPtr,
77 const iimg::IBitmap& inputImage,
78 iimg::IBitmap& outputImage) const override;
79
80 // reimplemented (icomp::CComponentBase)
81 void OnComponentCreated() override;
82
83private:
84 // static template methods for subelement access
85 template <class InterfaceType>
86 static InterfaceType* ExtractFilterContraints(CRectImageSmoothProcessorComp& component)
87 {
88 return &component.m_filterConstraints;
89 }
90
91 I_ATTR(int, m_unitModeAttrPtr);
92 I_ATTR(int, m_borderModeAttrPtr);
93 I_ATTR(QByteArray, m_filterParamsIdAttrPtr);
94 I_REF(imeas::INumericValue, m_defaultFilterParamsCompPtr);
95
96 imeas::CGeneralNumericConstraints m_filterConstraints;
97};
98
99
100} // namespace iipr
101
102
103#endif // !iipr_CRectImageSmoothProcessorComp_included
104
105
Definition of single plane bitmap.
Definition IBitmap.h:24
PixelFormat
Bitmap pixel format description.
Definition IBitmap.h:30
Basic implementation for a simple bitmap processor.
Implementation of image smooth operator with homogeneous rectangle kernel.
static bool DoRectFilterHorizontal(int filterWidth, iimg::IBitmap::PixelFormat outputPixelFormat, const iimg::IBitmap &inputBitmap, iimg::IBitmap &outputBitmap, BorderMode borderMode=BM_STRETCH_KERNEL)
virtual bool ProcessImage(const iprm::IParamsSet *paramsPtr, const iimg::IBitmap &inputImage, iimg::IBitmap &outputImage) const override
static bool DoRectFilter(int filterWidth, int filterHeight, iimg::IBitmap::PixelFormat outputPixelFormat, const iimg::IBitmap &inputBitmap, iimg::IBitmap &outputBitmap, BorderMode borderMode=BM_STRETCH_KERNEL)
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.
Describe additional meta information for set of numeric values.
General parameter set containing list of numeric values.
Set of general parameters.
Definition IParamsSet.h:29
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
Contains the image processing classes.

© Witold Gantzke and Kirill Lepskiy