Read the next frame, decoded as BGR, into the provided [`Mat`]. 读取下一帧,解码为 BGR,写入提供的 [`Mat`]。 The `Mat` is reused across calls — its internal buffer is only reallocated if the resolution changes. This makes the hot loop allocation-free after the first frame. `Mat` 跨调用复用 —— 仅在分辨率变化时重新分配内部缓冲区。 这使得在第一帧之后的热循环完全无分配。 Returns `true` if a frame was successfully captured. 成功采集到帧时返回 `true`。
(&mut self, mat: &mut Mat)
| 70 | /// Returns `true` if a frame was successfully captured. |
| 71 | /// 成功采集到帧时返回 `true`。 |
| 72 | pub fn read(&mut self, mat: &mut Mat) -> Result<bool> { |
| 73 | self.camera.read_decoded(mat) |
| 74 | } |
| 75 | |
| 76 | /// Check if the camera is successfully opened. |
| 77 | /// 检查摄像头是否已成功打开。 |
no test coverage detected