opencv/cond_macros.rs
1#[cfg(ocvrs_opencv_branch_34)]
2#[doc(hidden)]
3#[macro_export]
4macro_rules! opencv_branch_34 {
5 ($($tt:tt)*) => { $($tt)* }
6}
7
8/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
9/// # Examples
10///
11/// Alternative import:
12/// ```
13/// opencv::not_opencv_branch_34! {
14/// use opencv::imgproc::LINE_8;
15/// }
16/// opencv::opencv_branch_34! {
17/// use opencv::core::LINE_8;
18/// }
19/// ```
20///
21/// Alternative function call:
22/// ```
23/// opencv::opencv_branch_34! {
24/// let mut cam = opencv::videoio::VideoCapture::new_default(0)?;
25/// }
26/// opencv::not_opencv_branch_34! {
27/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
28/// }
29/// ```
30#[cfg(not(ocvrs_opencv_branch_34))]
31#[macro_export]
32macro_rules! opencv_branch_34 {
33 ($($tt:tt)*) => {};
34}
35
36/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
37/// # Examples
38///
39/// Alternative import:
40/// ```
41/// opencv::not_opencv_branch_34! {
42/// use opencv::imgproc::LINE_8;
43/// }
44/// opencv::opencv_branch_34! {
45/// use opencv::core::LINE_8;
46/// }
47/// ```
48///
49/// Alternative function call:
50/// ```
51/// opencv::opencv_branch_34! {
52/// let mut cam = opencv::videoio::VideoCapture::new_default(0)?;
53/// }
54/// opencv::not_opencv_branch_34! {
55/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
56/// }
57/// ```
58#[cfg(not(ocvrs_opencv_branch_34))]
59#[macro_export]
60macro_rules! not_opencv_branch_34 {
61 ($($tt:tt)*) => { $($tt)* }
62}
63
64#[cfg(ocvrs_opencv_branch_34)]
65#[doc(hidden)]
66#[macro_export]
67macro_rules! not_opencv_branch_34 {
68 ($($tt:tt)*) => {};
69}
70
71/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
72/// # Examples
73///
74/// Alternative import:
75/// ```
76/// opencv::not_opencv_branch_34! {
77/// use opencv::imgproc::LINE_8;
78/// }
79/// opencv::opencv_branch_34! {
80/// use opencv::core::LINE_8;
81/// }
82/// ```
83///
84/// Alternative function call:
85/// ```
86/// opencv::opencv_branch_34! {
87/// let mut cam = opencv::videoio::VideoCapture::new_default(0)?;
88/// }
89/// opencv::not_opencv_branch_34! {
90/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
91/// }
92/// ```
93#[cfg(ocvrs_opencv_branch_4)]
94#[macro_export]
95macro_rules! opencv_branch_4 {
96 ($($tt:tt)*) => { $($tt)* }
97}
98
99#[cfg(not(ocvrs_opencv_branch_4))]
100#[doc(hidden)]
101#[macro_export]
102macro_rules! opencv_branch_4 {
103 ($($tt:tt)*) => {};
104}
105
106#[cfg(not(ocvrs_opencv_branch_4))]
107#[doc(hidden)]
108#[macro_export]
109macro_rules! not_opencv_branch_4 {
110 ($($tt:tt)*) => { $($tt)* }
111}
112
113/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
114/// # Examples
115///
116/// Alternative import:
117/// ```
118/// opencv::not_opencv_branch_34! {
119/// use opencv::imgproc::LINE_8;
120/// }
121/// opencv::opencv_branch_34! {
122/// use opencv::core::LINE_8;
123/// }
124/// ```
125///
126/// Alternative function call:
127/// ```
128/// opencv::opencv_branch_34! {
129/// let mut cam = opencv::videoio::VideoCapture::new_default(0)?;
130/// }
131/// opencv::not_opencv_branch_34! {
132/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
133/// }
134/// ```
135#[cfg(ocvrs_opencv_branch_4)]
136#[macro_export]
137macro_rules! not_opencv_branch_4 {
138 ($($tt:tt)*) => {};
139}
140
141/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
142/// # Examples
143///
144/// Alternative import:
145/// ```
146/// opencv::opencv_branch_4! {
147/// use opencv::imgproc::LINE_8;
148/// }
149/// opencv::not_opencv_branch_4! {
150/// use opencv::core::LINE_8;
151/// }
152/// ```
153///
154/// Alternative function call:
155/// ```
156/// opencv::opencv_branch_34! {
157/// let mut cam = opencv::videoio::VideoCapture::new_default(0)?;
158/// }
159/// opencv::not_opencv_branch_34! {
160/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
161/// }
162/// ```
163#[cfg(ocvrs_opencv_branch_5)]
164#[macro_export]
165macro_rules! opencv_branch_5 {
166 ($($tt:tt)*) => { $($tt)* }
167}
168
169#[cfg(not(ocvrs_opencv_branch_5))]
170#[doc(hidden)]
171#[macro_export]
172macro_rules! opencv_branch_5 {
173 ($($tt:tt)*) => {};
174}
175
176#[cfg(not(ocvrs_opencv_branch_5))]
177#[doc(hidden)]
178#[macro_export]
179macro_rules! not_opencv_branch_5 {
180 ($($tt:tt)*) => { $($tt)* }
181}
182
183/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
184/// # Examples
185///
186/// Alternative import:
187/// ```
188/// opencv::not_opencv_branch_34! {
189/// use opencv::imgproc::LINE_8;
190/// }
191/// opencv::opencv_branch_34! {
192/// use opencv::core::LINE_8;
193/// }
194/// ```
195///
196/// Alternative function call:
197/// ```
198/// opencv::opencv_branch_34! {
199/// let mut cam = opencv::videoio::VideoCapture::new_default(0)?;
200/// }
201/// opencv::not_opencv_branch_34! {
202/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
203/// }
204/// ```
205#[cfg(ocvrs_opencv_branch_5)]
206#[macro_export]
207macro_rules! not_opencv_branch_5 {
208 ($($tt:tt)*) => {};
209}