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

Method to_owned

rustcv-camera/src/frame.rs:165–174  ·  view source on GitHub ↗

Copy the raw data into an [`OwnedFrame`] that can outlive the camera borrow. 将原始数据拷贝到 [`OwnedFrame`],使其可以超出摄像头的借用生命周期。 Use this when you need to: - Send frame data to another thread - Keep frame data after calling `next_frame()` again - Store frames in a collection 在以下场景使用: - 将帧数据发送到另一个线程 - 在再次调用 `next_frame()` 后仍保留帧数据 - 将帧存储到集合中

(&self)

Source from the content-addressed store, hash-verified

163 /// - 在再次调用 `next_frame()` 后仍保留帧数据
164 /// - 将帧存储到集合中
165 pub fn to_owned(&self) -> OwnedFrame {
166 OwnedFrame {
167 data: self.data.to_vec(),
168 width: self.width,
169 height: self.height,
170 pixel_format: self.pixel_format,
171 sequence: self.sequence,
172 timestamp_us: self.timestamp_us,
173 }
174 }
175
176 /// Decode this frame into a BGR [`Mat`].
177 /// 将此帧解码为 BGR [`Mat`]。

Callers 1

get_attribute_stringFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected