|
1 | 1 | use std::convert::TryInto;
|
2 | 2 | use std::ffi::c_void;
|
3 | 3 | use std::marker::PhantomData;
|
4 |
| -use std::ops::Deref; |
| 4 | +use std::ops::{Deref, DerefMut}; |
5 | 5 | use std::{fmt, mem, ptr, slice};
|
6 | 6 |
|
7 | 7 | pub use mat_::*;
|
8 | 8 |
|
9 | 9 | use crate::boxed_ref::{BoxedRef, BoxedRefMut};
|
10 |
| -use crate::core::{MatConstIterator, MatExpr, MatSize, Point, Rect, Scalar, Size, UMat}; |
| 10 | +use crate::core::{MatConstIterator, MatExpr, MatSize, MatStep, Point, Rect, Scalar, Size, UMat}; |
11 | 11 | use crate::manual::core::DataType;
|
12 | 12 | use crate::prelude::*;
|
13 | 13 | use crate::{core, input_output_array, input_output_array_vector, Error, Result};
|
@@ -850,6 +850,23 @@ impl fmt::Debug for MatSize<'_> {
|
850 | 850 | }
|
851 | 851 | }
|
852 | 852 |
|
| 853 | +impl Deref for MatStep { |
| 854 | + #[cfg(not(ocvrs_opencv_branch_5))] |
| 855 | + type Target = [usize; 2]; |
| 856 | + #[cfg(ocvrs_opencv_branch_5)] |
| 857 | + type Target = [usize; 3]; |
| 858 | + |
| 859 | + fn deref(&self) -> &Self::Target { |
| 860 | + self.buf() |
| 861 | + } |
| 862 | +} |
| 863 | + |
| 864 | +impl DerefMut for MatStep { |
| 865 | + fn deref_mut(&mut self) -> &mut Self::Target { |
| 866 | + self.buf_mut() |
| 867 | + } |
| 868 | +} |
| 869 | + |
853 | 870 | pub trait MatConstIteratorTraitManual: MatConstIteratorTrait {
|
854 | 871 | #[inline]
|
855 | 872 | fn has_elements(&self) -> bool {
|
|
0 commit comments