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

Method new

rustcv/src/core/mat.rs:18–28  ·  view source on GitHub ↗
(rows: i32, cols: i32, channels: u8)

Source from the content-addressed store, hash-verified

16
17impl Mat {
18 pub fn new(rows: i32, cols: i32, channels: u8) -> Self {
19 let step = (cols * channels as i32) as usize;
20 let size = (rows as usize) * step;
21 Self {
22 data: vec![0; size],
23 rows,
24 cols,
25 step,
26 channels,
27 }
28 }
29
30 /// 创建一个空的 Mat (通常用于作为输出 buffer)
31 pub fn empty() -> Self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected