| 91 | } |
| 92 | |
| 93 | fn load_icon() -> Result<egui::IconData> { |
| 94 | let decoder = png::Decoder::new(Cursor::new(include_bytes!("../assets/icon_64.png").as_ref())); |
| 95 | let mut reader = decoder.read_info()?; |
| 96 | let mut buf = vec![0; reader.output_buffer_size().context("Buffer too large")?]; |
| 97 | let info = reader.next_frame(&mut buf)?; |
| 98 | ensure!(info.bit_depth == png::BitDepth::Eight); |
| 99 | ensure!(info.color_type == png::ColorType::Rgba); |
| 100 | buf.truncate(info.buffer_size()); |
| 101 | Ok(egui::IconData { rgba: buf, width: info.width, height: info.height }) |
| 102 | } |
| 103 | |
| 104 | const APP_NAME: &str = "objdiff"; |
| 105 | |