CDifferenceBitmapSupplierComp.h
Go to the documentation of this file.
1 #ifndef iipr_CDifferenceBitmapSupplierComp_included
2 #define iipr_CDifferenceBitmapSupplierComp_included
3 
4 
5 // ACF includes
7 #include "iproc/IProcessor.h"
9 
10 // ACF-Solutions includes
11 #include "iimg/IBitmapProvider.h"
12 
13 
14 namespace iipr
15 {
16 
17 
22  public iproc::TSupplierCompWrap< QPair<i2d::ICalibration2d*, istd::TDelPtr<iimg::IBitmap> > >,
23  virtual public iimg::IBitmapProvider,
24  virtual public i2d::ICalibrationProvider
25 {
26 public:
28 
29  I_BEGIN_COMPONENT(CDifferenceBitmapSupplierComp);
30  I_REGISTER_INTERFACE(iimg::IBitmapProvider);
31  I_REGISTER_INTERFACE(i2d::ICalibrationProvider);
32  I_ASSIGN(m_bitmapCompFact, "BitmapFactory", "Use to create bitmap object", true, "BitmapFactory");
33  I_ASSIGN(m_firstBitmapProviderCompPtr, "FirstBitmapSupplier", "Provide fist input image", true, "FirstBitmapSupplier");
34  I_ASSIGN_TO(m_firstBitmapSupplierCompPtr, m_firstBitmapProviderCompPtr, false);
35  I_ASSIGN_TO(m_firstBitmapProviderModelCompPtr, m_firstBitmapProviderCompPtr, false);
36  I_ASSIGN(m_secondBitmapProviderCompPtr, "SecondBitmapSupplier", "Provide second input image", true, "SecondBitmapSupplier");
37  I_ASSIGN_TO(m_secondBitmapSupplierCompPtr, m_secondBitmapProviderCompPtr, false);
38  I_ASSIGN_TO(m_secondBitmapProviderModelCompPtr, m_secondBitmapProviderCompPtr, false);
39  I_END_COMPONENT;
40 
41 protected:
42  bool EnsureBitmapCreated(ProductType& result) const;
43 
44  // reimplemented (iimg::IBitmapProvider)
45  virtual const iimg::IBitmap* GetBitmap() const;
46 
47  // reimplemented (i2d::ICalibrationProvider)
48  virtual const i2d::ICalibration2d* GetCalibration() const;
49 
50  // reimplemented (iproc::TSupplierCompWrap)
51  virtual int ProduceObject(ProductType& result) const;
52 
53  // reimplemented (icomp::CComponentBase)
54  virtual void OnComponentCreated();
55 
56 private:
57  int CalculateDifferenceBitmap(
58  const iimg::IBitmap& firstInputBitmap,
59  const iimg::IBitmap& secondInputBitmap,
60  ProductType& result) const;
61 private:
62  I_FACT(iimg::IBitmap, m_bitmapCompFact);
63 
64  I_REF(iimg::IBitmapProvider, m_firstBitmapProviderCompPtr);
65  I_REF(iproc::ISupplier, m_firstBitmapSupplierCompPtr);
66  I_REF(imod::IModel, m_firstBitmapProviderModelCompPtr);
67 
68  I_REF(iimg::IBitmapProvider, m_secondBitmapProviderCompPtr);
69  I_REF(iproc::ISupplier, m_secondBitmapSupplierCompPtr);
70  I_REF(imod::IModel, m_secondBitmapProviderModelCompPtr);
71 };
72 
73 
74 } // namespace iipr
75 
76 
77 #endif // !iipr_CDifferenceBitmapSupplierComp_included
78 
79 
I_ASSIGN_TO(m_firstBitmapSupplierCompPtr, m_firstBitmapProviderCompPtr, false)
Supplier of bitmap built on difference of two images.
virtual const i2d::ICalibration2d * GetCalibration() const
QPair< i2d::ICalibration2d *, istd::TDelPtr< iimg::IBitmap > > ProductType
bool EnsureBitmapCreated(ProductType &result) const
Base interface for suppliers providing synchrone processing of single object with "pull data" model...
Definition: ISupplier.h:22
virtual const iimg::IBitmap * GetBitmap() const
virtual int ProduceObject(ProductType &result) const
Produce single object.
iproc::TSupplierCompWrap< QPair< i2d::ICalibration2d *, istd::TDelPtr< iimg::IBitmap > > > BaseClass
Standard implementation of interface iproc::ISupplier with preparation for component implementation...

© 2007-2011 Witold Gantzke and Kirill Lepskiy