ICF 3.1.1.10
Technical documentation of ICF Libraries
CImageBinarizeProcessorComp.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_CImageBinarizeProcessorComp_included
7#define iipr_CImageBinarizeProcessorComp_included
8
9
10// ICF includes
11#include <iimg/IBitmap.h>
13#include <imeas/INumericValue.h>
14
15
16namespace iipr
17{
18
19
24{
25public:
27
28 I_BEGIN_COMPONENT(CImageBinarizeProcessorComp);
29 I_ASSIGN(m_binarizationParamsIdAttrPtr, "BinarizationParameterId", "ID of binarization parameters in the parameter set", false, "BinarizationParameterId");
30 I_ASSIGN(m_defaultBinarizationThresholdCompPtr, "DefaultThreshold", "Default value of the binarization threshold", false, "DefaultThreshold");
31 I_ASSIGN(m_isInverseModeEnabledAttrPtr, "InverseMode", "If enabled, object color will be set to 0", true, false);
32 I_END_COMPONENT;
33
34 // reimplemented (iproc::IProcessor)
36 const iprm::IParamsSet* paramsPtr,
37 const istd::IPolymorphic* inputPtr,
38 istd::IChangeable* outputPtr,
39 bool allowAsync = false,
40 iproc::IProgressManager* progressManagerPtr = nullptr) override;
41
42protected:
44 const iimg::IBitmap& inputBitmap,
45 const imeas::INumericValue& thresholdParams,
46 iimg::IBitmap& outputBitmap) const;
47
48private:
49 I_ATTR(QByteArray, m_binarizationParamsIdAttrPtr);
50 I_REF(imeas::INumericValue, m_defaultBinarizationThresholdCompPtr);
51 I_ATTR(bool, m_isInverseModeEnabledAttrPtr);
52};
53
54
55} // namespace iipr
56
57
58#endif // !iipr_CImageBinarizeProcessorComp_included
59
Definition of single plane bitmap.
Definition IBitmap.h:24
Processor for image binarization using static threshold.
virtual iproc::CTaskState DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, bool allowAsync=false, iproc::IProgressManager *progressManagerPtr=nullptr) override
bool ConvertImage(const iimg::IBitmap &inputBitmap, const imeas::INumericValue &thresholdParams, iimg::IBitmap &outputBitmap) const
General parameter set containing list of numeric values.
Set of general parameters.
Definition IParamsSet.h:29
Represent state of asynchronous operation.
Definition CTaskState.h:28
Consume information about progress of some process.
Simple definition macro for a synchronous processor.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
Contains the image processing classes.

© Witold Gantzke and Kirill Lepskiy