IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ImageBinaryMixedRuleOperators.h
Go to the documentation of this file.
1 // ImageBinaryMixedRuleOperators.h:
3 // --------------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_IMAGEBINARYMIXEDRULEOPERATORS_H__
17 #define __IPSDKIMAGEPROCESSING_IMAGEBINARYMIXEDRULEOPERATORS_H__
18 
19 #include <IPSDKImageProcessing/Rule/Image/ImageBinaryMixed/RuleMatchLeafToImageRange.h>
20 #include <IPSDKImageProcessing/Rule/Image/ImageBinaryMixed/RuleMatchLeafToImageSize.h>
21 #include <IPSDKImageProcessing/Rule/Image/ImageBinaryMixed/RuleMatchValueToImageRange.h>
22 #include <IPSDKImageProcessing/Rule/Image/ImageBinaryMixed/RuleMatchValueToImageSize.h>
24 
25 namespace ipsdk {
26 namespace imaproc {
27 
30 
34 matchBufferSize(const ImageAttributeConstWeakPtr& pImageAttribute,
35  const IBTAttributeConstWeakPtr& pIBTAttribute);
36 
39 template <typename LeafType, typename LeafAttributeType>
41 matchSize(const eMatchImageSizeType& matchImageSizeType,
42  const eMatchImageSizeScale& matchImageSizeScale,
43  const ImageAttributeConstWeakPtr& pImageAttribute,
44  const boost::shared_ptr<LeafAttributeType>& pLeafAttribute)
45 {
46  return matchSize<LeafType>(
47  matchImageSizeType,
48  matchImageSizeScale,
49  ImageAttributeConstWeakPtr(pImageAttribute),
50  boost::weak_ptr<LeafAttributeType>(pLeafAttribute));
51 }
52 template <typename LeafType, typename LeafAttributeType>
54 matchSize(const eMatchImageSizeType& matchImageSizeType,
55  const eMatchImageSizeScale& matchImageSizeScale,
56  const ImageAttributeConstWeakPtr& pImageAttribute,
57  const boost::weak_ptr<LeafAttributeType>& pLeafAttribute)
58 {
59  typedef RuleMatchLeafToImageSize<LeafAttributeType, LeafType> RuleType;
60  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
61  pOutputRule->init(matchImageSizeType, matchImageSizeScale, pImageAttribute, pLeafAttribute);
62 
63  return pOutputRule;
64 }
65 
68 template <typename ValueAttributeType>
70 matchSize(const eMatchImageSizeType& matchImageSizeType,
71  const eMatchImageSizeScale& matchImageSizeScale,
72  const ImageAttributeConstWeakPtr& pImageAttribute,
73  const boost::shared_ptr<ValueAttributeType>& pValueAttribute)
74 {
75  return matchSize(
76  matchImageSizeType,
77  matchImageSizeScale,
78  ImageAttributeConstWeakPtr(pImageAttribute),
79  boost::weak_ptr<ValueAttributeType>(pValueAttribute));
80 }
81 template <typename ValueAttributeType>
83 matchSize(const eMatchImageSizeType& matchImageSizeType,
84  const eMatchImageSizeScale& matchImageSizeScale,
85  const ImageAttributeConstWeakPtr& pImageAttribute,
86  const boost::weak_ptr<ValueAttributeType>& pValueAttribute)
87 {
88  typedef RuleMatchValueToImageSize<ValueAttributeType> RuleType;
89  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
90  pOutputRule->init(matchImageSizeType, matchImageSizeScale, pImageAttribute, pValueAttribute);
91 
92  return pOutputRule;
93 }
94 
98 bufferType(const ImageAttributeConstWeakPtr& pImageAttribute,
99  const IBTAttributeConstWeakPtr& pIBTAttribute);
100 
104 compatibleBufferType(const ImageAttributeConstWeakPtr& pImageAttribute,
105  const IBTAttributeConstWeakPtr& pIBTAttribute);
106 
110 template <typename LeafType, typename LeafAttributeType>
113  const boost::shared_ptr<LeafAttributeType>& pLeafAttribute)
114 {
115  return matchImageRange<LeafType>(ImageAttributeConstWeakPtr(pImageAttribute),
116  boost::weak_ptr<LeafAttributeType>(pLeafAttribute));
117 }
118 template <typename LeafType, typename LeafAttributeType>
121  const boost::weak_ptr<LeafAttributeType>& pLeafAttribute)
122 {
124  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
125  pOutputRule->init(pImageAttribute, pLeafAttribute);
126 
127  return pOutputRule;
128 }
130 
134 template <typename ValueAttributeType>
137  const boost::shared_ptr<ValueAttributeType>& pValueAttribute)
138 {
139  return matchImageRange(ImageAttributeConstWeakPtr(pImageAttribute),
140  boost::weak_ptr<ValueAttributeType>(pValueAttribute));
141 }
142 template <typename ValueAttributeType>
145  const boost::weak_ptr<ValueAttributeType>& pValueAttribute)
146 {
148  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
149  pOutputRule->init(pImageAttribute, pValueAttribute);
150 
151  return pOutputRule;
152 }
154 
157 
158 } // end of namespace imaproc
159 } // end of namespace ipsdk
160 
161 #endif // __IPSDKIMAGEPROCESSING_IMAGEBINARYMIXEDRULEOPERATORS_H__
eMatchImageSizeScale
enumerate used in comparison between scalar and image size, to determine whether scalar is compared t...
Definition: ImageBinaryMixedRuleTypes.h:59
processor::RulePtr matchImageRange(const ImageAttributeConstPtr &pImageAttribute, const boost::shared_ptr< LeafAttributeType > &pLeafAttribute)
functions allowing to check that a DataItem leaf value is inside an image buffer type value range ...
Definition: ImageBinaryMixedRuleOperators.h:112
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Base operators used to combined rules.
boost::weak_ptr< const BaseImageAttribute > ImageAttributeConstWeakPtr
Definition: ImageAttributeTypes.h:38
void init(const ImageAttributeConstWeakPtr &pImageAttribute, const boost::weak_ptr< const AttributeType > &pValueAttribute)
initialization of object
Definition: RuleMatchLeafToImageRange.h:80
boost::shared_ptr< BaseRule > RulePtr
shared pointer to rule
Definition: RuleTypes.h:104
IPSDKIMAGEPROCESSING_API processor::RulePtr compatibleBufferType(const ImageAttributeConstWeakPtr &pImageAttribute, const IBTAttributeConstWeakPtr &pIBTAttribute)
function allowing to check that an image buffer type size is compatible with a given image buffer typ...
boost::shared_ptr< const BaseImageAttribute > ImageAttributeConstPtr
Definition: ImageAttributeTypes.h:32
Rule class allowing to check that a value is inside an image buffer type value range.
Definition: RuleMatchValueToImageRange.h:29
void init(const ImageAttributeConstWeakPtr &pImageAttribute, const boost::weak_ptr< const AttributeType > &pValueAttribute)
initialization of object
Definition: RuleMatchValueToImageRange.h:70
boost::weak_ptr< const BaseImageBufferTypeAttribute > IBTAttributeConstWeakPtr
Definition: ImageBufferTypeAttributeTypes.h:43
#define IPSDKIMAGEPROCESSING_API
Import/Export macro for library IPSDKImageProcessing.
Definition: IPSDKImageProcessingExports.h:25
IPSDKIMAGEPROCESSING_API processor::RulePtr bufferType(const ImageAttributeConstWeakPtr &pImageAttribute, const IBTAttributeConstWeakPtr &pIBTAttribute)
function allowing to check that an image correspond to a given image buffer types attribute ...
IPSDKIMAGEPROCESSING_API processor::RulePtr matchBufferSize(const ImageAttributeConstWeakPtr &pImageAttribute, const IBTAttributeConstWeakPtr &pIBTAttribute)
function allowing to check that an image buffer type and a given image buffer types attribute have sa...
eMatchImageSizeType
enumerate describing image comparison on image size rule operation type
Definition: ImageRuleTypes.h:50
processor::RulePtr matchSize(const eMatchImageSizeType &matchImageSizeType, const eMatchImageSizeScale &matchImageSizeScale, const ImageAttributeConstWeakPtr &pImageAttribute, const boost::shared_ptr< LeafAttributeType > &pLeafAttribute)
function allowing to check that a DataItem leaf value is lower than or equals to image size on consid...
Definition: ImageBinaryMixedRuleOperators.h:41
Rule class allowing to check that a DataItem leaf value is inside an image buffer type value range...
Definition: RuleMatchLeafToImageRange.h:29