Crates.io | image-to-oled |
lib.rs | image-to-oled |
version | 0.5.0 |
source | src |
created_at | 2022-11-25 08:38:14.233088 |
updated_at | 2023-02-24 14:35:45.843807 |
description | Converts an ImageBuffer to a 128x64 SSD1306 OLED byte vector |
homepage | |
repository | https://github.com/mdegraw/image-to-oled |
max_upload_size | |
id | 722618 |
size | 19,573 |
Converts an ImageBuffer to a 128x64 SSD1306 OLED byte vector
let image_buffer: ImageBuffer<Rgb<u8>, Vec<u8>> =
ImageBuffer::from_vec(640, 480, vec![155; (1024 * 1024 * 3) as usize]).unwrap();
// get bytes vec, specifying the brightness threshold
// as a number between 0 and 255
let bytes = to_oled_bytes(&image_buffer, 100);