Ancestors

Written by Wojciech Jarosz on 2025-01-10 at 03:47

I released v2.1.0 of my #research oriented #HighDynamicRange image viewer HDRView yesterday. Worked on lots of changes and improvements over the holiday break. Get the deets and binary downloads at the link below.

[#]hdr, #graphics, #rendering, #openexr, #cgi, #webgl, #macos, #dearimgui,

https://github.com/wkjarosz/hdrview/releases/tag/v2.1.0

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Written by Wojciech Jarosz on 2025-01-10 at 03:58

And as before, you can also just use the web app by going to https://wkjarosz.github.io/hdrview/

It is magical to be able to load up and compare HDR images on any computer, iPhone, or iPad from a browser!

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Written by Aras Pranckevičius on 2025-01-10 at 04:46

@wjarosz I find myself using the web version quite a lot, thanks! Would it be possible to somehow add support for drag-file-into-it to open?

=> More informations about this toot | More toots from aras@mastodon.gamedev.place

Written by Ignacio Castaño 🍉 on 2025-01-10 at 05:48

@aras @wjarosz Seconded! For Spark View I use sokol_app, which makes this very easy:

https://github.com/floooh/sokol-samples/blob/master/sapp/droptest-sapp.c

=> More informations about this toot | More toots from castano@mastodon.gamedev.place

Written by Andre Weissflog on 2025-01-10 at 09:17

@castano @aras @wjarosz this might be a relevant example project (minimal QOI image format viewer):

https://github.com/floooh/qoiview

...hosted web version:

https://floooh.github.io/qoiview/qoiview.html

=> More informations about this toot | More toots from floooh@mastodon.gamedev.place

Written by Andre Weissflog on 2025-01-10 at 09:26

@castano @aras @wjarosz (tbf though drag-n-drop across web and native is quite a mess, since on the web loading the data is entangled with handling the drop event (that's why sokol_app.h has web-specific IO functions: https://github.com/floooh/sokol/blob/c1cc713a48669fb78c8fadc1a3cb9dd6c3bb97d3/sokol_app.h#L1946-L1949)

=> More informations about this toot | More toots from floooh@mastodon.gamedev.place

Written by Wojciech Jarosz on 2025-01-11 at 06:03

@floooh @castano @aras when switching to dear imgui last year I did look into sokol headers, but ultimately went with hello imgui. I assume these are mutually exclusive, or can I combine them?

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Written by Andre Weissflog on 2025-01-11 at 12:06

@wjarosz @castano @aras the core sokol headers are fairly standalone (e.g. sokol_app.h and sokol_gfx.h don't depend on each other), but the devil might be in the details of course. The imgui renderer sokol_imgui.h sits on top of sokol_gfx.h though.

The drag'n'drop stuff is implemented in sokol_app.h, this forces you into a specific 'application model' though, and from looking at hello imgui doesn't have some of its features (like 'power save mode).

=> More informations about this toot | More toots from floooh@mastodon.gamedev.place

Written by Wojciech Jarosz on 2025-01-12 at 04:30

@floooh @castano @aras Thanks for the tips. Having drag and drop in in the web version would be very nice, but I’m not going to switch away from hello imgui at this point. So it would more be a question of whether drag and drop is small and self contained enough in sokol_app for me to extract just the relevant bits. From a brief look at sokol_app, I expect its not quite that easy :-( That means I’ll likely be waiting until hello imgui (or SDL which it’s built upon for emscripten) expose such functionality directly.

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Written by Andre Weissflog on 2025-01-12 at 10:39

@wjarosz @castano @aras yeah, drag'n'drop is one of the uglier web APIs, you'll have to add a couple of JS event handlers, and the result is some sort of abstract JS file object which wraps the loading. Not sure if it's worth the hassle when you already have a loading dialog

(btw: not sure if a known issue, but when pressing Cancel in the load dialog the app 'crashes' (might be an unhandled JS exception which ends up in Emscripten's onerror hook?):

=> View attached media

=> More informations about this toot | More toots from floooh@mastodon.gamedev.place

Written by Andre Weissflog on 2025-01-12 at 10:45

@wjarosz @castano @aras btw I just remembered that I have some pre-sokol-app drag'n'drop code lying around which might be eaiser to integrate, the idea is basically that you do all the drag'n'drop handling code outside your application code in a JS file and only call a C callback with the loaded data on the WASM heap (in this case 'yakc_loadfile'), it's just about 70 lines of JS:

https://github.com/floooh/yakc/blob/0d00dac14a81bf8d92351ebe1397813385c82b3b/web/emsc.js#L106-L176

=> More informations about this toot | More toots from floooh@mastodon.gamedev.place

Written by Wojciech Jarosz on 2025-01-13 at 00:50

@floooh @castano @aras Awesome. Thanks for the tip. I’ll check it out.

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Toot

Written by Wojciech Jarosz on 2025-01-13 at 20:21

@floooh @castano @aras The development version now supports drag and drop to open images in the browser: https://wkjarosz.github.io/hdrview/dev/

Thanks @floooh for the tips, and @aras for the feature request

Side note: I don’t know if this is an issue with my setup, or if emscripten has updated how it operates since you did this @floooh , but I wasn’t able to get the “array” parameter type to work (even though emscripten’s documentation lists it). But once I switched it to just pass the buffer pointer as a “number” (like how emscripten_browser_file does it), it all worked fine (plus I’m passing it on the heap instead of the stack since the images may be quite big).

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Descendants

Written by Aras Pranckevičius on 2025-01-14 at 04:51

@wjarosz @floooh @castano Most excellent, thanks! Works perfectly here.

=> More informations about this toot | More toots from aras@mastodon.gamedev.place

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113822905897446112
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
350.56102 milliseconds
Gemini-to-HTML Time
3.12861 milliseconds

This content has been proxied by September (3851b).