| 18 | /// 已解码的 BGR 图像。 |
| 19 | #[derive(Debug, Clone)] |
| 20 | pub struct Mat { |
| 21 | /// Raw BGR pixel data. Layout: `[B, G, R, B, G, R, ...]`. |
| 22 | /// 原始 BGR 像素数据。布局:`[B, G, R, B, G, R, ...]`。 |
| 23 | pub(crate) data: Vec<u8>, |
| 24 | |
| 25 | /// Number of rows (image height). |
| 26 | /// 行数(图像高度)。 |
| 27 | pub(crate) rows: u32, |
| 28 | |
| 29 | /// Number of columns (image width). |
| 30 | /// 列数(图像宽度)。 |
| 31 | pub(crate) cols: u32, |
| 32 | |
| 33 | /// Number of channels (always 3 for BGR). |
| 34 | /// 通道数(BGR 固定为 3)。 |
| 35 | pub(crate) channels: u32, |
| 36 | |
| 37 | /// Row step in bytes (cols * channels). |
| 38 | /// 行步长(字节)(cols * channels)。 |
| 39 | pub(crate) step: usize, |
| 40 | } |
| 41 | |
| 42 | impl Mat { |
| 43 | /// Create an empty Mat with no allocated data. |
nothing calls this directly
no outgoing calls
no test coverage detected