Files
uefi-video/src/main.rs
2025-05-15 16:33:37 +09:00

43 lines
810 B
Rust

#![no_main]
#![no_std]
extern crate alloc;
use codec::{
image::{ImageDecoder, png::PngDecoder},
transform::scale::ScaleTransformer,
video::{VideoDecoder, gif::GifDecoder},
};
use graphic::GraphicLoader;
use log::info;
use uefi::{allocator::Allocator, prelude::*};
mod codec;
mod color;
mod error;
mod graphic;
mod util;
#[global_allocator]
static ALLOC: Allocator = Allocator;
static IMAGE: &[u8] = include_bytes!("../assets/pet.gif");
#[entry]
fn main() -> Status {
uefi::helpers::init().unwrap();
info!("Hello world!");
let gl = GraphicLoader::new();
let data = GifDecoder.decode(IMAGE);
if let Ok(data) = data {
let data = data.transform(&ScaleTransformer::new(4.0));
gl.render_video(&data);
}
boot::stall(10_000_000);
Status::SUCCESS
}