MCPcopy Create free account
hub / github.com/AryanpurTech/BlueEngine / output_image_native

Function output_image_native

examples/utils/headless.rs:20–36  ·  view source on GitHub ↗
(image_data: Vec<u8>, texture_dims: (usize, usize), path: &str)

Source from the content-addressed store, hash-verified

18};
19
20pub fn output_image_native(image_data: Vec<u8>, texture_dims: (usize, usize), path: &str) {
21 let writer = std::fs::File::create(path).unwrap();
22 let encoder = blue_engine::image::codecs::png::PngEncoder::new(writer);
23 encoder
24 .write_image(
25 &image_data,
26 texture_dims.0 as u32,
27 texture_dims.1 as u32,
28 blue_engine::image::ExtendedColorType::Rgba8,
29 )
30 .unwrap();
31
32 println!("generated a frame!");
33
34 // to be able to view the image. Remove it if you're testing it in other ways.
35 std::process::exit(0);
36}
37
38fn main() -> Result<(), blue_engine::error::Error> {
39 let mut engine = Engine::new_config(EngineSettings {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected