(x: usize, y: usize, width: usize, buf_len: usize)
| 282 | #[cfg(target_os = "macos")] |
| 283 | #[inline] |
| 284 | fn pixel_idx(x: usize, y: usize, width: usize, buf_len: usize) -> Option<usize> { |
| 285 | let idx = y * width + x; |
| 286 | if idx < buf_len && x < width { |
| 287 | Some(idx) |
| 288 | } else { |
| 289 | None |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | /// 返回 ASCII 字符的 5×7 点阵位图。 |
| 294 | /// |