Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
twistedfall committed Jul 14, 2024
1 parent 3d1dc47 commit 7cb8dcb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Documentation](https://docs.rs/opencv/badge.svg)](https://docs.rs/opencv)
[![Package](https://img.shields.io/crates/v/opencv.svg)](https://crates.io/crates/opencv)

Experimental Rust bindings for OpenCV 3 and 4.
Rust bindings for the popular [OpenCV](https://opencv.org/) computer vision library.

The API is usable, but unstable and not very battle-tested; use at your own risk.

Expand Down
4 changes: 2 additions & 2 deletions build/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl Library {
let mut cargo_metadata = Vec::with_capacity(64);
let include_paths: Vec<_> = include_paths.iter().map(PathBuf::from).collect();

let version = Self::version_from_include_paths(&include_paths).ok_or("could not get versions from header files")?;
let version = Self::version_from_include_paths(&include_paths).ok_or("Could not OpenCV version from include_paths")?;

cargo_metadata.extend(Self::process_link_paths(Some(link_paths), vec![], None));
cargo_metadata.extend(Self::process_link_libs(Some(link_libs), vec![], None));
Expand Down Expand Up @@ -425,7 +425,7 @@ impl Library {
|| env::var_os("OPENCV_CMAKE_BIN").is_some();
let explicit_vcpkg = env::var_os("VCPKG_ROOT").is_some();
eprintln!(
"=== Detected probe priority based on environment vars: pkg_config: {explicit_pkg_config}, cmake: {explicit_cmake}, vcpkg: {explicit_vcpkg}"
"=== Detected probe priority boost based on environment vars: pkg_config: {explicit_pkg_config}, cmake: {explicit_cmake}, vcpkg: {explicit_vcpkg}"
);

let disabled_probes = env::var("OPENCV_DISABLE_PROBES");
Expand Down
1 change: 0 additions & 1 deletion src/boxed_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::traits::{Boxed, OpenCVFromExtern, OpenCVIntoExternContainer, OpenCVTy
#[repr(transparent)]
pub struct BoxedRef<'r, T: Boxed> {
pub(crate) reference: T,
// can make it &'r T, but then it will just take up unnecessary space
referenced_object: PhantomData<&'r T>,
}

Expand Down
7 changes: 4 additions & 3 deletions src/manual/core/inplace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ use crate::traits::Boxed;
pub trait ModifyInplace {
/// Helper function to call OpenCV functions that allow in-place modification of a `Mat` or another similar object. By passing
/// a mutable reference to the `Mat` to this function your closure will get called with the read reference and a write references
/// to the same `Mat`. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
/// sensitive operations. One example of an OpenCV function that allows such in-place modification is `imgproc::threshold`.
/// to the same `Mat`. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
/// but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
/// modification is `imgproc::threshold`.
///
/// # Safety
/// Caller must make sure that any functions called inside the closure can act on a `Mat` in-place.
Expand All @@ -23,7 +24,7 @@ impl<Mat: Boxed> ModifyInplace for Mat {
}
}

impl<'b, Mat: Boxed> ModifyInplace for BoxedRefMut<'b, Mat> {
impl<Mat: Boxed> ModifyInplace for BoxedRefMut<'_, Mat> {
#[inline(always)]
unsafe fn modify_inplace<Res>(&mut self, f: impl FnOnce(&Self, &mut Self) -> Res) -> Res {
let mut m_alias = BoxedRefMut::from(Mat::from_raw(self.reference.as_raw_mut()));
Expand Down
1 change: 1 addition & 0 deletions tests/marshalling_only_latest_opencv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/// Setting and getting fields through Ptr
#[test]
#[cfg(all(ocvrs_has_module_aruco, any(ocvrs_opencv_branch_34, ocvrs_opencv_branch_4)))]
#[allow(deprecated)]
fn field_access_on_ptr() -> opencv::Result<()> {
use opencv::aruco::EstimateParameters;
use opencv::prelude::*;
Expand Down
1 change: 0 additions & 1 deletion tools/generate-bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ all_modules_34="aruco
ml
objdetect
optflow
ovis
phase_unwrapping
photo
plot
Expand Down

0 comments on commit 7cb8dcb

Please sign in to comment.