IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BorderPolicyAttributeHdrMacros.h
Go to the documentation of this file.
1 // BorderPolicyAttributeHdrMacros.h:
3 // ---------------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_BORDERPOLICYATTRIBUTEHDRMACROS_H__
17 #define __IPSDKIMAGEPROCESSING_BORDERPOLICYATTRIBUTEHDRMACROS_H__
18 
21 #include <IPSDKImageProcessing/Attribute/BorderPolicy/BaseBorder2dPolicyAttribute.h>
22 #include <IPSDKImageProcessing/Attribute/BorderPolicy/BaseBorder3dPolicyAttribute.h>
24 #include <boost/thread/lock_guard.hpp>
25 #include <boost/smart_ptr/make_shared_object.hpp>
26 
29 
32 #define IPSDK_DECLARE_BORDER_POLICY_ATTRIBUTE_BODY(libraryName, className, baseClassName, RuleString) \
33  IPSDK_DECLARE_SERIAL_WITHOUT_COPY(libraryName, className) \
34  IPSDK_DECLARE_TOOLTIP() \
35  IPSDK_DECLARE_ATTRIBUTE_BASE_BODY(libraryName, className, RuleString) \
36 public: \
37  typedef baseClassName BaseBorderPolicyAttributeClassType; \
38 protected: \
39  className(); \
40 public: \
41  ~className(); \
42 public: \
43  void init(const ValueType& borderPolicy); \
44  void init(const StorageType& pBorderPolicy);
45 
47 // Mandatory attributes
49 
52 #define IPSDK_DECLARE_INPUT_BORDER2D_POLICY_ATTRIBUTE(libraryName, className, RuleString) \
53 class IPSDK_LIB_API(libraryName) className : \
54  public ipsdk::imaproc::BaseBorder2dPolicyAttribute { \
55  IPSDK_DECLARE_BORDER_POLICY_ATTRIBUTE_BODY(libraryName, className, \
56  ipsdk::imaproc::BaseBorder2dPolicyAttribute, \
57  RuleString) \
58  IPSDK_DECLARE_MANDATORY_DATA(); \
59 };
60 
63 #define IPSDK_DECLARE_INPUT_BORDER3D_POLICY_ATTRIBUTE(libraryName, className, RuleString) \
64 class IPSDK_LIB_API(libraryName) className : \
65  public ipsdk::imaproc::BaseBorder3dPolicyAttribute { \
66  IPSDK_DECLARE_BORDER_POLICY_ATTRIBUTE_BODY(libraryName, className, \
67  ipsdk::imaproc::BaseBorder3dPolicyAttribute, \
68  RuleString) \
69  IPSDK_DECLARE_MANDATORY_DATA(); \
70 };
71 
73 // Optional attributes
75 
79 #define IPSDK_DECLARE_INPUT_OPTIONAL_BORDER2D_POLICY_ATTRIBUTE(libraryName, className, \
80  RuleString, defaultValue) \
81 class IPSDK_LIB_API(libraryName) className : \
82  public ipsdk::imaproc::BaseBorder2dPolicyAttribute { \
83  IPSDK_DECLARE_BORDER_POLICY_ATTRIBUTE_BODY(libraryName, className, \
84  ipsdk::imaproc::BaseBorder2dPolicyAttribute, \
85  RuleString) \
86  IPSDK_DECLARE_OPTIONAL_DATA(); \
87 public: \
88  inline const ValueType& getDefaultValue() const \
89  { \
90  return *retrieveDefaultValue(); \
91  } \
92 protected: \
93  static inline StorageType retrieveDefaultValue() \
94  { \
95  boost::lock_guard<boost::mutex> lock(getMutex()); \
96  static StorageType pDefaultValue = defaultValue; \
97  return pDefaultValue; \
98  } \
99 };
100 
104 #define IPSDK_DECLARE_INPUT_OPTIONAL_BORDER3D_POLICY_ATTRIBUTE(libraryName, className, \
105  RuleString, defaultValue) \
106 class IPSDK_LIB_API(libraryName) className : \
107  public ipsdk::imaproc::BaseBorder3dPolicyAttribute { \
108  IPSDK_DECLARE_BORDER_POLICY_ATTRIBUTE_BODY(libraryName, className, \
109  ipsdk::imaproc::BaseBorder3dPolicyAttribute, \
110  RuleString) \
111  IPSDK_DECLARE_OPTIONAL_DATA(); \
112 public: \
113  inline const ValueType& getDefaultValue() const \
114  { \
115  return *retrieveDefaultValue(); \
116  } \
117 protected: \
118  static inline StorageType retrieveDefaultValue() \
119  { \
120  boost::lock_guard<boost::mutex> lock(getMutex()); \
121  static StorageType pDefaultValue = defaultValue; \
122  return pDefaultValue; \
123  } \
124 };
125 
128 
129 #endif // __IPSDKIMAGEPROCESSING_BORDERPOLICYATTRIBUTEHDRMACROS_H__
Base operators used to combined rules.
Definition of import/export macro for library.
Header part of macros set for attribute class declaration.