| 4 | /// Owns its data (Vec<u8>) and supports strided memory layout. |
| 5 | #[derive(Clone)] |
| 6 | pub struct Mat { |
| 7 | pub data: Vec<u8>, |
| 8 | pub rows: i32, |
| 9 | pub cols: i32, |
| 10 | /// 每一行占用的字节数 (Stride) |
| 11 | /// 对于 Packed 图像,step = cols * channels |
| 12 | /// 对于 Padded 图像,step > cols * channels |
| 13 | pub step: usize, |
| 14 | pub channels: u8, |
| 15 | } |
| 16 | |
| 17 | impl Mat { |
| 18 | pub fn new(rows: i32, cols: i32, channels: u8) -> Self { |
nothing calls this directly
no outgoing calls
no test coverage detected