ICF 3.1.1.10
Technical documentation of ICF Libraries
CImageProcessorCompBase.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_CImageProcessorCompBase_included
7#define iipr_CImageProcessorCompBase_included
8
9
10// ICF includes
12#include <iimg/IBitmap.h>
14
15
16namespace iipr
17{
18
19
24{
25public:
27
43
67
68 I_BEGIN_BASE_COMPONENT(CImageProcessorCompBase);
69 I_ASSIGN(m_defaultAoiCompPtr, "DefaultAoi", "Area of interest used if not specified in parameters", false, "DefaultAoi");
70 I_ASSIGN(m_aoiParamIdAttrPtr, "AoiParamId", "ID of area of interest in parameter set", false, "AoiParams");
71 I_ASSIGN(m_aoiModeAttrPtr, "AoiMode", "Mode of interpretation of AOI:\n\t0 - AOI contains input pixels,\n\t1 - AOI contains output pixels", true, 0);
72 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);
73 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);
74 I_ASSIGN(m_outputPixelTypeIdAttrPtr, "OutputPixelTypeId", "ID of output pixel type in parameter set (type iprm::ISelectionParam)", false, "OutputPixelType");
75 I_ASSIGN(m_defaultOutputPixelTypeParamCompPtr, "DefaultOutputPixelType", "Default output pixel type if not defined in parameter set", false, "DefaultOutputPixelType");
76 I_END_COMPONENT;
77
78 // reimplemented (iproc::IProcessor)
80 const iprm::IParamsSet* paramsPtr,
81 const istd::IPolymorphic* inputPtr,
82 istd::IChangeable* outputPtr,
83 bool allowAsync = false,
84 iproc::IProgressManager* progressManagerPtr = nullptr) override;
85
86protected:
89 AoiMode GetAoiMode(const iprm::IParamsSet* paramsPtr) const;
90
91 // abstract methods
92 virtual bool ProcessImage(
93 const iprm::IParamsSet* paramsPtr,
94 const iimg::IBitmap& inputImage,
95 iimg::IBitmap& outputImage) const = 0;
96
97 I_REF(i2d::IObject2d, m_defaultAoiCompPtr);
98 I_ATTR(QByteArray, m_aoiParamIdAttrPtr);
99
100private:
101 I_ATTR(int, m_aoiModeAttrPtr);
102 I_ATTR(int, m_backgroundModeAttrPtr);
103 I_ATTR(int, m_outputPixelTypeAttrPtr);
104 I_ATTR(QByteArray, m_outputPixelTypeIdAttrPtr);
105 I_REF(iprm::ISelectionParam, m_defaultOutputPixelTypeParamCompPtr);
106};
107
108
109} // namespace iipr
110
111
112#endif // !iipr_CImageProcessorCompBase_included
113
Common interface for describing the 2D-objects.
Definition IObject2d.h:30
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.
AoiMode
Describes modes of AOI interpretation.
@ AM_INPUT_PIXELS
AOI mask contains the input bitmap pixels.
@ AM_OUTPUT_PIXELS
AOI mask contains the output bitmap pixels.
AoiMode GetAoiMode(const iprm::IParamsSet *paramsPtr) const
BackgroundFillMode GetBackgroundMode(const iprm::IParamsSet *paramsPtr) const
BackgroundFillMode
Describes modes for out-of-AOI background fill.
@ BFM_RESET
The background pixels will be reset (typically set to 0).
@ BFM_INPUT
The state of background pixels should be set to input bitmap values.
@ BFM_UNCHANGED
The state of background pixels should be unchanged to original bitmap.
@ BFM_NONE
The state of background pixels will be unknown.
virtual iproc::CTaskState DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, bool allowAsync=false, iproc::IProgressManager *progressManagerPtr=nullptr) override
virtual bool ProcessImage(const iprm::IParamsSet *paramsPtr, const iimg::IBitmap &inputImage, iimg::IBitmap &outputImage) const =0
iimg::IBitmap::PixelFormat GetOutputPixelFormat(const iprm::IParamsSet *paramsPtr) const
iproc::CSyncProcessorCompBase BaseClass
Set of general parameters.
Definition IParamsSet.h:29
Interface allowing to select single option from list of options.
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