IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
SobelGradient2dImgLvl1.h
1 // SobelGradient2dImgLvl1.h:
3 // ----------------------------
4 //
14 
15 #ifndef __IPSDKIPLFILTERING_SOBELGRADIENT2DIMGLVL1_H__
16 #define __IPSDKIPLFILTERING_SOBELGRADIENT2DIMGLVL1_H__
17 
23 
24 // Attributes headers
25 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Enumerate/InOptSobelKernelType.h>
26 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/InImg.h>
27 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Optional/OutOptGradXImg.h>
28 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Optional/OutOptGradYImg.h>
29 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InOptNormalizeSobelKernel.h>
30 
31 namespace ipsdk {
32 namespace imaproc {
33 namespace filter {
34 
37 
38 // declare processor class
39 IPSDK_DECLARE_LVL1_PROCESSOR(REP_ASYNC1, IPSDKIPLFiltering, SobelGradient2dImg,
40  ((ipsdk::processor::isSet(_pOutOptGradXImg) || ipsdk::processor::isSet(_pOutOptGradYImg)) &&
41  (ipsdk::processor::ifIsSet(_pOutOptGradXImg,
42  ipsdk::imaproc::matchSize(_pInImg, _pOutOptGradXImg))) &&
43  (ipsdk::processor::ifIsSet(_pOutOptGradYImg,
44  ipsdk::imaproc::matchSize(_pInImg, _pOutOptGradYImg)))),
45  (((ipsdk)(imaproc)(attr))(InImg))
46  (((ipsdk)(imaproc)(attr))(InOptSobelKernelType))
47  (((ipsdk)(imaproc)(attr))(InOptNormalizeSobelKernel))
48  (((ipsdk)(imaproc)(attr))(OutOptGradXImg)(promoteUnary)(_pInImg)(ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned))
49  (((ipsdk)(imaproc)(attr))(OutOptGradYImg)(promoteUnary)(_pInImg)(ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperSigned)))
50 
51 // methods
52 public:
53 
54 protected:
58 
60  ipsdk::processor::RetrievalResult retrieveXGradXDerivationProvider(const ipsdk::core::BasePriority& priority,
62 
64  ipsdk::processor::RetrievalResult retrieveXGradYSmoothingProvider(const ipsdk::core::BasePriority& priority,
66 
68  ipsdk::processor::RetrievalResult retrieveYGradXSmoothingProvider(const ipsdk::core::BasePriority& priority,
70 
72  ipsdk::processor::RetrievalResult retrieveYGradYDerivationProvider(const ipsdk::core::BasePriority& priority,
74 
76  void clearIntermediateData();
77 
78 // attributes
79 protected:
82  KernelXYPtr _pXSmoothingKernel;
83  KernelXYPtr _pYSmoothingKernel;
84  KernelXYPtr _pXGradientKernel;
85  KernelXYPtr _pYGradientKernel;
87 
88  // border policy used for convolution
89  image::Border2dPolicyPtr _pBorder2dPolicy;
90 };
91 
94 
95 } // end of namespace filter
96 } // end of namespace imaproc
97 } // end of namespace ipsdk
98 
99 #endif // __IPSDKIPLFILTERING_SOBELGRADIENT2DIMGLVL1_H__
#define IPSDK_DECLARE_LVL1_PROCESSOR(ProcType, libraryName, algoName, RuleString, attributeSeq)
processor::OutputInitializerPtr promoteUnary(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType > &pInputAttribute, const ePromoteUnaryType &promoteUnaryType)
ePUT_UpperSigned
ipsdk::core::ExecResult preProcess()
method called before processing
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type ifIsSet(const boost::shared_ptr< AttributeType > &pAttribute, const RulePtr &pRuleTrue)
boost::shared_ptr< Border2dPolicy > Border2dPolicyPtr
boost::shared_ptr< KernelXY > KernelXYPtr
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type isSet(const boost::shared_ptr< AttributeType > &pAttribute)
boost::shared_ptr< BaseActionProvider > ActionProviderPtr
IPSDK_DECLARE_GPU_PROCESSING_ALGORITHM(IPSDKIPLFiltering, Convolution2dImg, ipsdk::imaproc::matchSize(_pInSubGpuImg, _pOutImg),(((ipsdk)(imaproc)(attr))(InSubGpuImg))(((ipsdk)(imaproc)(attr))(InKnlXY))(((ipsdk)(imaproc)(attr))(InNormalize))(((ipsdk)(imaproc)(attr))(InConvolBorder2d))(((ipsdk)(imaproc)(attr))(OutImg))) IPSDKCUDA_DECLARE_ALGORITHM_FUNCTION_SELECTOR((InSubGpuImg)(OutImg)) public void clearIntermediateData()
method called before processing
Definition of import/export macro for library.