CImageProcessorCompBase.h
Go to the documentation of this file.
1 #ifndef iipr_CImageProcessorCompBase_included
2 #define iipr_CImageProcessorCompBase_included
3 
4 
5 // ACF includes
6 #include <istd/TSmartPtr.h>
7 #include <iprm/ISelectionParam.h>
8 #include <iimg/IBitmap.h>
9 
10 // ACF-Solutions includes
12 
13 
14 namespace iipr
15 {
16 
17 
22 {
23 public:
25 
30  enum AoiMode
31  {
40  };
41 
47  {
64  };
65 
66  I_BEGIN_BASE_COMPONENT(CImageProcessorCompBase);
67  I_ASSIGN(m_defaultAoiCompPtr, "DefaultAoi", "Area of interest used if not specified in parameters", false, "DefaultAoi");
68  I_ASSIGN(m_aoiParamIdAttrPtr, "AoiParamId", "ID of area of interest in parameter set", false, "AoiParams");
69  I_ASSIGN(m_aoiModeAttrPtr, "AoiMode", "Mode of interpretation of AOI:\n\t0 - AOI contains input pixels,\n\t1 - AOI contains output pixels", true, 0);
70  I_ASSIGN(m_backgroundModeAttrPtr, "BackgroundMode", "Mode of background filling:\n\t0 - ignored,\n\t1 - set to 0,\n\t3 - set to input bitmap", true, 1);
71  I_ASSIGN(m_outputPixelTypeAttrPtr, "OutputPixelType", "Type of output pixel if not defined over parameters:\n\t0 - As input\n\t1 - Mono\n\t2 - Grayscale\n\t3 - RGB\n\t4 - RGBA\n\t5 - RGB24\n\t6 - Grayscale 16\n\t7 - Grayscale 32\n\t8 - Float 32\n\t9 - Float 64", true, 0);
72  I_ASSIGN(m_outputPixelTypeIdAttrPtr, "OutputPixelTypeId", "ID of output pixel type in parameter set (type iprm::ISelectionParam)", false, "OutputPixelType");
73  I_ASSIGN(m_defaultOutputPixelTypeParamCompPtr, "DefaultOutputPixelType", "Default output pixel type if not defined in parameter set", false, "DefaultOutputPixelType");
74  I_END_COMPONENT;
75 
76  // reimplemented (iproc::IProcessor)
77  virtual int DoProcessing(
78  const iprm::IParamsSet* paramsPtr,
79  const istd::IPolymorphic* inputPtr,
80  istd::IChangeable* outputPtr,
81  ibase::IProgressManager* progressManagerPtr = NULL);
82 
83 protected:
85  iimg::IBitmap::PixelFormat GetOutputPixelFormat(const iprm::IParamsSet* paramsPtr) const;
86  AoiMode GetAoiMode(const iprm::IParamsSet* paramsPtr) const;
87 
88  // abstract methods
89  virtual bool ProcessImage(
90  const iprm::IParamsSet* paramsPtr,
91  const iimg::IBitmap& inputImage,
92  iimg::IBitmap& outputImage) const = 0;
93 
94  I_REF(i2d::IObject2d, m_defaultAoiCompPtr);
95  I_ATTR(QByteArray, m_aoiParamIdAttrPtr);
96 
97 private:
98  I_ATTR(int, m_aoiModeAttrPtr);
99  I_ATTR(int, m_backgroundModeAttrPtr);
100  I_ATTR(int, m_outputPixelTypeAttrPtr);
101  I_ATTR(QByteArray, m_outputPixelTypeIdAttrPtr);
102  I_REF(iprm::ISelectionParam, m_defaultOutputPixelTypeParamCompPtr);
103 };
104 
105 
106 } // namespace iipr
107 
108 
109 #endif // !iipr_CImageProcessorCompBase_included
110 
Simple definition macro for a synchronous processor.
The state of background pixels will be unknown.
AoiMode GetAoiMode(const iprm::IParamsSet *paramsPtr) const
AOI mask contains the output bitmap pixels.
AoiMode
Describes modes of AOI interpretation.
iimg::IBitmap::PixelFormat GetOutputPixelFormat(const iprm::IParamsSet *paramsPtr) const
The state of background pixels should be set to input bitmap values.
The state of background pixels should be unchanged to original bitmap.
AOI mask contains the input bitmap pixels.
BackgroundFillMode GetBackgroundMode(const iprm::IParamsSet *paramsPtr) const
Basic implementation for a simple bitmap processor.
The background pixels will be reset (typically set to 0).
iproc::CSyncProcessorCompBase BaseClass
virtual int DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, ibase::IProgressManager *progressManagerPtr=NULL)
virtual bool ProcessImage(const iprm::IParamsSet *paramsPtr, const iimg::IBitmap &inputImage, iimg::IBitmap &outputImage) const =0
BackgroundFillMode
Describes modes for out-of-AOI background fill.

© 2007-2017 Witold Gantzke and Kirill Lepskiy