Fix macros in documentation
MODIFY
examples/video_capture.rs
examples/video_capture.rs
@@ -3,12 +3,7 @@ use opencv::{highgui, prelude::*, videoio, Result};
fn main() -> Result<()> {
let window = "video capture";
highgui::named_window(window, highgui::WINDOW_AUTOSIZE)?;
- opencv::opencv_branch_32! {
- let mut cam = videoio::VideoCapture::new_default(0)?; // 0 is the default camera
- }
- opencv::not_opencv_branch_32! {
let mut cam = videoio::VideoCapture::new(0, videoio::CAP_ANY)?; // 0 is the default camera
- }
let opened = videoio::VideoCapture::is_opened(&cam)?;
if !opened {
panic!("Unable to open default camera!");

MODIFY
examples/video_facedetect.rs
examples/video_facedetect.rs
@@ -5,22 +5,12 @@ use opencv::{core, highgui, imgproc, objdetect, prelude::*, types, videoio, Resu
fn main() -> Result<()> {
let window = "video capture";
highgui::named_window(window, 1)?;
- opencv::opencv_branch_32! {
- let (xml, mut cam) = {
- (
- "/usr/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml".to_owned(),
- videoio::VideoCapture::new_default(0)?, // 0 is the default camera
- )
- };
- }
- opencv::not_opencv_branch_32! {
let (xml, mut cam) = {
(
core::find_file("haarcascades/haarcascade_frontalface_alt.xml", true, false)?,
videoio::VideoCapture::new(0, videoio::CAP_ANY)?, // 0 is the default camera
)
};
- }
let opened = videoio::VideoCapture::is_opened(&cam)?;
if !opened {
panic!("Unable to open default camera!");

MODIFY
examples/video_features.rs
examples/video_features.rs
@@ -3,12 +3,7 @@ use opencv::{core, features2d, highgui, imgproc, prelude::*, videoio, Result};
fn main() -> Result<()> {
let window = "video capture";
highgui::named_window(window, 1)?;
- opencv::opencv_branch_32! {
- let mut cam = videoio::VideoCapture::new_default(0)?; // 0 is the default camera
- }
- opencv::not_opencv_branch_32! {
let mut cam = videoio::VideoCapture::new(0, videoio::CAP_ANY)?; // 0 is the default camera
- }
let opened = videoio::VideoCapture::is_opened(&cam)?;
if !opened {
panic!("Unable to open default camera!");

MODIFY
examples/video_to_gray.rs
examples/video_to_gray.rs
@@ -3,12 +3,7 @@ use opencv::{highgui, imgproc, prelude::*, videoio, Result};
fn main() -> Result<()> {
let window = "video capture";
highgui::named_window(window, 1)?;
- opencv::opencv_branch_32! {
- let mut cam = videoio::VideoCapture::new_default(0)?; // 0 is the default camera
- }
- opencv::not_opencv_branch_32! {
let mut cam = videoio::VideoCapture::new(0, videoio::CAP_ANY)?; // 0 is the default camera
- }
let opened = videoio::VideoCapture::is_opened(&cam)?;
if !opened {
panic!("Unable to open default camera!");

MODIFY
examples/warp_perspective_demo.rs
examples/warp_perspective_demo.rs
@@ -54,9 +54,7 @@ fn main() -> Result<(), Box<dyn Error>> {
help();
let filename = env::args().nth(1).unwrap_or_else(|| "data/right.jpg".to_string());
- opencv::not_opencv_branch_32! {
let filename = core::find_file(&filename, true, false)?;
- }
let original_image = imgcodecs::imread(&filename, imgcodecs::IMREAD_COLOR)?;
let mut image;
let original_image_cols = original_image.cols() as f32;

MODIFY
src/cond_macros.rs
src/cond_macros.rs
+#[cfg(ocvrs_opencv_branch_32)]
+#[doc(hidden)]
+#[deprecated(note = "OpenCV 3.2 is no longer supported")]
+#[macro_export]
+macro_rules! opencv_branch_32 {
+ ($($tt:tt)*) => { $($tt)* }
+}
+
/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
/// # Examples
///
/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
/// }
/// ```
-#[cfg(ocvrs_opencv_branch_32)]
-#[macro_export]
-macro_rules! opencv_branch_32 {
- ($($tt:tt)*) => { $($tt)* }
-}
-
#[cfg(not(ocvrs_opencv_branch_32))]
-#[doc(hidden)]
+#[deprecated(note = "OpenCV 3.2 is no longer supported")]
#[macro_export]
macro_rules! opencv_branch_32 {
($($tt:tt)*) => {};
@@ -56,6 +58,7 @@ macro_rules! opencv_branch_32 {
/// }
/// ```
#[cfg(not(ocvrs_opencv_branch_32))]
+#[deprecated(note = "OpenCV 3.2 is no longer supported")]
#[macro_export]
macro_rules! not_opencv_branch_32 {
($($tt:tt)*) => { $($tt)* }
@@ -63,11 +66,19 @@ macro_rules! not_opencv_branch_32 {
#[cfg(ocvrs_opencv_branch_32)]
#[doc(hidden)]
+#[deprecated(note = "OpenCV 3.2 is no longer supported")]
#[macro_export]
macro_rules! not_opencv_branch_32 {
($($tt:tt)*) => {};
}
+#[cfg(ocvrs_opencv_branch_34)]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! opencv_branch_34 {
+ ($($tt:tt)*) => { $($tt)* }
+}
+
/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
/// # Examples
///
@@ -90,14 +101,7 @@ macro_rules! not_opencv_branch_32 {
/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
/// }
/// ```
-#[cfg(ocvrs_opencv_branch_34)]
-#[macro_export]
-macro_rules! opencv_branch_34 {
- ($($tt:tt)*) => { $($tt)* }
-}
-
#[cfg(not(ocvrs_opencv_branch_34))]
-#[doc(hidden)]
#[macro_export]
macro_rules! opencv_branch_34 {
($($tt:tt)*) => {};
@@ -173,6 +177,13 @@ macro_rules! opencv_branch_4 {
($($tt:tt)*) => {};
}
+#[cfg(not(ocvrs_opencv_branch_4))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! not_opencv_branch_4 {
+ ($($tt:tt)*) => { $($tt)* }
+}
+
/// Conditional compilation macro based on OpenCV branch version for usage in external crates.
/// # Examples
///
@@ -195,14 +206,7 @@ macro_rules! opencv_branch_4 {
/// let mut cam = opencv::videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
/// }
/// ```
-#[cfg(not(ocvrs_opencv_branch_4))]
-#[macro_export]
-macro_rules! not_opencv_branch_4 {
- ($($tt:tt)*) => { $($tt)* }
-}
-
#[cfg(ocvrs_opencv_branch_4)]
-#[doc(hidden)]
#[macro_export]
macro_rules! not_opencv_branch_4 {
($($tt:tt)*) => {};

MODIFY
src/manual/core/input_output_array.rs
src/manual/core/input_output_array.rs
@@ -78,6 +78,7 @@ impl<T: _InputOutputArrayTrait> ToInputOutputArray for T {
}
}
+#[doc(hidden)]
#[macro_export]
macro_rules! input_output_array {
($type: ty, $const_cons: ident) => {
@@ -112,6 +113,7 @@ macro_rules! input_output_array {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! input_array_ref_forward {
($type: ty) => {
@@ -124,6 +126,7 @@ macro_rules! input_array_ref_forward {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! output_array_ref_forward {
($type: ty) => {
@@ -143,6 +146,7 @@ macro_rules! output_array_ref_forward {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! input_output_array_ref_forward {
($type: ty) => {

MODIFY
src/manual/core/ptr/ptr_extern.rs
src/manual/core/ptr/ptr_extern.rs
@@ -21,6 +21,7 @@ pub trait PtrExternCtor<T: OpenCVTypeExternContainerMove> {
Self: OpenCVType<'a>;
}
+#[doc(hidden)]
#[macro_export]
macro_rules! ptr_extern {
($type: ty, $extern_delete: ident, $extern_inner_as_ptr: ident, $extern_inner_as_ptr_mut: ident $(,)?) => {
@@ -49,6 +50,7 @@ macro_rules! ptr_extern {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! ptr_extern_ctor {
($type: ty, $extern_new: ident) => {
@@ -65,6 +67,7 @@ macro_rules! ptr_extern_ctor {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! ptr_cast_base {
($type: ty, $base: ty, $extern_convert: ident) => {

MODIFY
src/manual/core/tuple.rs
src/manual/core/tuple.rs
@@ -103,6 +103,7 @@ pub trait TupleExtern {
unsafe fn extern_delete(&mut self);
}
+#[doc(hidden)]
#[macro_export]
macro_rules! tuple_extern {
(

MODIFY
src/manual/core/vector/vector_extern.rs
src/manual/core/vector/vector_extern.rs
@@ -51,6 +51,7 @@ pub trait VectorExtern<T: for<'a> OpenCVType<'a>> {
unsafe fn extern_set<'a>(&mut self, index: size_t, val: extern_arg_send!(T: 'a));
}
+#[doc(hidden)]
#[macro_export]
macro_rules! vector_extern {
(
@@ -182,6 +183,7 @@ where
unsafe fn extern_from_slice<'a>(data: *const T, len: size_t) -> extern_receive!(Vector<T>: 'a);
}
+#[doc(hidden)]
#[macro_export]
macro_rules! vector_copy_non_bool {
(
@@ -252,6 +254,7 @@ macro_rules! vector_copy_non_bool {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! vector_non_copy_or_bool {
(clone $type: ty) => {

MODIFY
src/traits/boxed.rs
src/traits/boxed.rs
@@ -25,6 +25,7 @@ pub trait Boxed: Sized {
fn as_raw_mut(&mut self) -> *mut c_void;
}
+#[doc(hidden)]
#[macro_export]
macro_rules! opencv_type_boxed {
($type: ty) => {
@@ -93,6 +94,7 @@ macro_rules! opencv_type_boxed {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! boxed_cast_base {
($type: ty, $base: ty, $extern_convert: ident $(,)?) => {
@@ -109,6 +111,7 @@ macro_rules! boxed_cast_base {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! boxed_cast_descendant {
($type: ty, $descendant: ty, $extern_convert: ident $(,)?) => {

MODIFY
src/traits/opencv_type.rs
src/traits/opencv_type.rs
@@ -69,6 +69,7 @@ pub trait OpenCVTypeExternContainerMove: OpenCVTypeExternContainer {
}
/// Extern type to receive the OpenCVType over FFI boundary, used to improve readability
+#[doc(hidden)]
#[macro_export]
macro_rules! extern_receive {
($typ: ty) => {
@@ -80,6 +81,7 @@ macro_rules! extern_receive {
}
/// Extern type to send the OpenCVTypeExternContainer over FFI boundary, used to improve readability
+#[doc(hidden)]
#[macro_export]
macro_rules! extern_send {
(mut $typ: ty) => {
@@ -91,6 +93,7 @@ macro_rules! extern_send {
}
/// Extern type to send the owned OpenCVType over FFI boundary, used to improve readability
+#[doc(hidden)]
#[macro_export]
macro_rules! extern_container_send {
(mut $typ: ty: $lt: lifetime) => {
@@ -108,6 +111,7 @@ macro_rules! extern_container_send {
}
/// Extern type to send the ::Arg of a OpenCVType over FFI boundary, used to improve readability
+#[doc(hidden)]
#[macro_export]
macro_rules! extern_arg_send {
(mut $typ: ty: $lt: lifetime) => {
@@ -118,6 +122,7 @@ macro_rules! extern_arg_send {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! opencv_type_copy {
($($type: ty),+ $(,)?) => {
@@ -150,6 +155,7 @@ macro_rules! opencv_type_copy {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! opencv_type_enum {
($type: ty) => {
@@ -157,6 +163,7 @@ macro_rules! opencv_type_enum {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! opencv_type_simple {
($type: ty) => {
@@ -195,6 +202,7 @@ macro_rules! opencv_type_simple {
};
}
+#[doc(hidden)]
#[macro_export]
macro_rules! opencv_type_simple_generic {
($type: ident<$trait: ident $( + $more: ident)*>) => {

Fix macros in documentation