CImageBinarizeProcessorComp.h
Go to the documentation of this file.
1 #ifndef iipr_CImageBinarizeProcessorComp_included
2 #define iipr_CImageBinarizeProcessorComp_included
3 
4 
5 // ACF includes
6 #include <iimg/IBitmap.h>
8 
9 // ACF-Solutions includes
10 #include <imeas/INumericValue.h>
11 
12 
13 namespace iipr
14 {
15 
16 
21 {
22 public:
24 
25  I_BEGIN_COMPONENT(CImageBinarizeProcessorComp);
26  I_ASSIGN(m_binarizationParamsIdAttrPtr, "BinarizationParameterId", "ID of binarization parameters in the parameter set", false, "BinarizationParameterId");
27  I_ASSIGN(m_defaultBinarizationThresholdCompPtr, "DefaultThreshold", "Default value of the binarization threshold", false, "DefaultThreshold");
28  I_ASSIGN(m_isInverseModeEnabledAttrPtr, "InverseMode", "If enabled, object color will be set to 0", true, false);
29  I_END_COMPONENT;
30 
31  // reimplemented (iproc::IProcessor)
32  virtual int DoProcessing(
33  const iprm::IParamsSet* paramsPtr,
34  const istd::IPolymorphic* inputPtr,
35  istd::IChangeable* outputPtr,
36  ibase::IProgressManager* progressManagerPtr = NULL);
37 
38 private:
39  bool ConvertImage(
40  const iimg::IBitmap& inputBitmap,
41  const imeas::INumericValue& thresholdParams,
42  iimg::IBitmap& outputBitmap) const;
43 
44 private:
45  I_ATTR(QByteArray, m_binarizationParamsIdAttrPtr);
46  I_REF(imeas::INumericValue, m_defaultBinarizationThresholdCompPtr);
47  I_ATTR(bool, m_isInverseModeEnabledAttrPtr);
48 };
49 
50 
51 } // namespace iipr
52 
53 
54 #endif // !iipr_CImageBinarizeProcessorComp_included
55 
Simple definition macro for a synchronous processor.
Processor for image binarization using static threshold.
virtual int DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, ibase::IProgressManager *progressManagerPtr=NULL)
iproc::CSyncProcessorCompBase BaseClass
General parameter set containing list of numeric values.
Definition: INumericValue.h:20

© 2007-2017 Witold Gantzke and Kirill Lepskiy