diff --git a/src/manual/core/mat/mat_.rs b/src/manual/core/mat/mat_.rs index e337b893..e9a15d70 100644 --- a/src/manual/core/mat/mat_.rs +++ b/src/manual/core/mat/mat_.rs @@ -95,6 +95,12 @@ impl Mat_ { self.at_2d(pt.y, pt.x) } + /// See [Mat::at_row] + #[inline] + pub fn at_row(&self, row: i32) -> Result<&[T]> { + match_indices(self, &[row, 0]).and_then(|_| unsafe { self.at_row_unchecked(row) }) + } + /// See [Mat::at_mut] #[inline] pub fn at_mut(&mut self, i0: i32) -> Result<&mut T> { @@ -129,6 +135,13 @@ impl Mat_ { self.at_2d_mut(pt.y, pt.x) } + /// See [Mat::at_row_mut] + #[inline] + pub fn at_row_mut(&mut self, row: i32) -> Result<&mut [T]> { + match_indices(self, &[row, 0])?; + unsafe { self.at_row_unchecked_mut(row) } + } + /// See [Mat::data_typed] #[inline] pub fn data_typed(&self) -> Result<&[T]> {