MCPcopy Index your code
hub / github.com/encounter/objdiff / load_icon

Function load_icon

objdiff-gui/src/main.rs:93–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91}
92
93fn 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
104const APP_NAME: &str = "objdiff";
105

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected