(rows: i32, cols: i32, channels: u8)
| 16 | |
| 17 | impl 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 { |
nothing calls this directly
no outgoing calls
no test coverage detected