gled 2.28.4

gled is an application for creating animations and effects on artnet or dmx installations
use egui::{IconData, ImageSource};

static LOGO: &[u8; 38897] = include_bytes!("../../logo/logo.png");

pub fn icon() -> IconData {
    let (icon_rgba, icon_width, icon_height) = {
        let image = image::load_from_memory(LOGO)
            .expect("Failed to parse logo.png")
            .into_rgba8();
        let (width, height) = image.dimensions();
        let rgba = image.into_raw();
        (rgba, width, height)
    };

    IconData {
        rgba: icon_rgba,
        width: icon_width,
        height: icon_height,
    }
}

pub fn logo_image() -> ImageSource<'static> {
    const IMAGE_SOURCE: ImageSource = ImageSource::Bytes {
        uri: std::borrow::Cow::Borrowed("../../logo/logo.png"),
        bytes: egui::load::Bytes::Static(LOGO),
    };
    IMAGE_SOURCE
}