MCPcopy Create free account
hub / github.com/RustCV/RustCV / read

Method read

rustcv-camera/src/videocapture.rs:72–74  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 /// 检查摄像头是否已成功打开。

Callers 5

OnReadSampleMethod · 0.45
bench_videocapture_readFunction · 0.45
bench_resolutionsFunction · 0.45
mainFunction · 0.45
run_resolution_testFunction · 0.45

Calls 1

read_decodedMethod · 0.80

Tested by

no test coverage detected