From b7f78b4896cbfcf9a7392696e5dfad7d58de32ce Mon Sep 17 00:00:00 2001 From: Axel Kappel <69117984+Kl4rry@users.noreply.github.com> Date: Sun, 12 May 2024 21:32:24 +0200 Subject: [PATCH] add hdr loading and saving --- README.md | 1 + src/app/save_image.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 26fc3bd..7e6675f 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Simp is a fast and simple GPU-accelerated image manipulation program. | JPEG XL | ✅ (5) | ❌ | | OpenEXR | ✅ | ✅ | | qoi | ✅ | ✅ | +| hdr | ✅ | ✅ | 1. Building with AVIF support requires the C library dav1d and is therefore not enabled by default. 2. SVGs are rastarized because Simp is primarily a bitmap image editor. diff --git a/src/app/save_image.rs b/src/app/save_image.rs index ce49f69..73e9b2c 100644 --- a/src/app/save_image.rs +++ b/src/app/save_image.rs @@ -35,6 +35,7 @@ pub fn open(name: String, proxy: EventLoopProxy, wgpu: &WgpuState) { .add_filter("farbfeld", &["ff", "farbfeld"]) .add_filter("TGA", &["tga"]) .add_filter("QOI", &["qoi"]) + .add_filter("HDR", &["hdr"]) .add_filter("EXR", &["exr"]); thread::spawn(move || { @@ -86,6 +87,7 @@ pub fn save( } let res = match ext.as_str() { + "hdr" => save_with_format(path, &frames[0], ImageFormat::Hdr), "png" => save_with_format(path, &frames[0], ImageFormat::Png), "qoi" => save_with_format(path, &frames[0], ImageFormat::Qoi), "jpg" | "jpeg" | "jpe" | "jif" | "jfif" => {