Dear ImGui port of Image Viewer (imiv) with Vulkan/Metal/OpenGL backends for Windowns/Linux/MacOS#5125
Dear ImGui port of Image Viewer (imiv) with Vulkan/Metal/OpenGL backends for Windowns/Linux/MacOS#5125ssh4net wants to merge 512 commits intoAcademySoftwareFoundation:mainfrom
Conversation
|
It looks like you have been working on this branch for a while and lots has diverged. Can you please rebase on top of the current main? |
…pace (AcademySoftwareFoundation#4967) If the colorspace exists and has an interop ID in an OCIO 2.5 config, use that. Otherwise check if the colorspace is equivalent to a known color interop ID. Tests were added. Signed-off-by: Brecht Van Lommel <brecht@blender.org> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…undation#4968) The JPEG XL color encoding metadata only supports a subset of CICP. So for example `srgb_p3d65_display` and `pq_rec2020_display` are supported, but `g26_xyzd65_display` is not. Custom primaries, custom white point and arbitrary gamma could be used to support more, but I didn't implement that. Tests for read and write were added. Signed-off-by: Brecht Van Lommel <brecht@blender.org> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…()` (AcademySoftwareFoundation#4987) Rearrangements in 3.1 dropped the list of recognized attributes from the visible online docs and failed to document the span varieties. We fix and also reword a lot of the descriptions for clarity and uniformity. The previous organization was that there were several varieties of attribute(). In the header, the first one had the overall long explanation, including the list of all the recognized attributes. The other ones had short explanations of how they differed. In the docs, each one was referenced explicitly, pulling in its attendant bit of documentation. What really happened is that in the header, I made the new span-based version the "flagship" one with the full explanation, but I neglected to reference it in the docs, so the long description disappeared. I could have fixed by just adding refs to the new functions to the docs, as I originally meant to. But while I was there, I took the opportunity to surround the whole collection with a group marker, and then include the lot of them with a single reference to the group, rather than need to refer to each function variant individually. And while I was at it, I also reworded (and hopefully improved) some of those explanations. Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…Foundation#4990) Implement RLE compression support for the SGI output plugin. Reading RLE encoded images was already supported, but writing was never done up until this point. The existing sgi test seems sufficient to catch issues and it covers input/output of both 1 byte-per-pixel and 2 byte-per-pixel files. The documentation for the image plugins are sometimes not very clear about which attributes are relevant for input vs. output. There's usually 3 sections: Attributes, Attributes for Input, and Attributes for Output. Before this PR, SGI mentioned the "compression" attribute in the "general" Attributes section (rather than say just the Input section), which caused a bit of grief as the only way to discover that RLE was not implemented for Output was to glance at the file size of the resulting file... I had assumed that compression was supported for output too but discovered that it was not. Now that this PR implements the attribute for output I've left the documentation as-is in the "general" Attributes section since it applies to both read/writing now. But I'm open for suggestions here. Signed-off-by: Jesse Yurkovich <jesse.y@gmail.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
Starting with 1.21, libheif seems to change behavior: When no CICP metadata is present, libheif now returns 2,2,2 (all unspecified) on read. OIIO convention, though, is to not set the attribute if valid CICP data is not in the file. --------- Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…wareFoundation#4993) For IBA::resample() when bilinear interpolation is used, almost all of the expense was due to its relying on ImageBuf::interppixel which is simple but constructs a new ImageBuf::ConstIterator EVERY TIME, which is very expensive. Reimplement in a way that reuses a single iterator. This speeds up IBA::resample by 20x or more typicaly. Also refactor resample to pull the handling of deep images into a separate helper function and out of the main inner loop. And add some benchmarking. Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
* CI test vs the latest freetype 2.14.1 * Bump the version of freetype that we auto-build to the latest (from 2.13.2) * Simplify BZip2 finding logic, switch to using targets Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…areFoundation#4998) The Intel MacOS 15 CI testing is getting dicier... lots of times, Homebrew doesn't have cached versions of updated packages, so it tries to build from source, which takes forever. The big culprit today is Qt. So, basically, just on this one CI job variant, don't ask it to install Qt. If it's there, it's there. If not, just skip it. It's tested plenty in other variants. Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…cademySoftwareFoundation#4997) Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
Fixes AcademySoftwareFoundation#5000 Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…wareFoundation#4995) Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
Due to typos in the option name in compiler.cmake (HARDENING vs OIIO_HARDENING, oops), I think we were never really setting the intended compiler flags. Fix that all up, and repair the other problems that it revealed -- some compiler version and option combinations weren't happy with each other, etc. One notable change is in encode_iptc_iim_one_tag: I think I made it safer by taking an early out for 0-sized data, and also it needed a warning suppression when certain gcc hardening levels were used. --------- Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
Needed for some systems after the changes of AcademySoftwareFoundation#4963. Ever so slightly different LSB somewhere makes the hashes not match, but it's a correct visual result. Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…eFoundation#5008) Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…ftwareFoundation#5010) Yay, I love how these things just break with no notice. Fixes CI that broke a couple days agi. --------- Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…areFoundation#5009) Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…SoftwareFoundation#5004) * ImageBuf internal buffer span lacked correct chansize. The internal `m_bufspan` is an `image_span<byte>`, and as such, it needs to remember the size of the original data type. Otherwise, there's a cascade of potential errors when it thinks that the individual values are byte sized. * In both ImageInput and ImageOutput, several sanity checks of image_span size versus expectations were incorrect. They were only checking if the total byte sizes matched expectations, but they are allowed to disagree when you consider type conversions (in which case, it's the total number of values that need to match, not the total byte sizes. Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…ation#5012) Needed to change the Libheif::Libheif target we set up ages ago to the "heif" name that the package's exported config uses. Also, need to give the warning about static libraries occur any time we are using static libheif, even if we didn't set LIBSTATIC to try to force all static libraries. --------- Signed-off-by: Larry Gritz <lg@larrygritz.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…ng (AcademySoftwareFoundation#5005) We previously merely *marked* tests as "broken" in this case, and depended on ctest being launched with `-E broken` to ensure those were skipped. Not everybody did. Let's just truly skip them. Fixes AcademySoftwareFoundation#4979 Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…emySoftwareFoundation#5013) Initializing the encoder to `heif_compression_HEVC` by default throws an exception when libheif was built without HEVC support, which prevents it from being used entirely even if there is AVIF support. So delay that initialization until we are sure which encoding we want. Not really any practical way to automatically test this. Signed-off-by: Brecht Van Lommel <brecht@blender.org> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…ySoftwareFoundation#5016) The WebP format is very limited in the maximum resolution it supports. We need to change the values we allow to be much smaller. Signed-off-by: Jesse Yurkovich <jesse.y@gmail.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…areFoundation#5014) Nearly all IBA functions take an optional parameter controlling the threading. But make_texture() did not, so there was no way to control its thread usage (it would always use the default number of threads). Without changing the call signature or ABI, this patch merely makes make_texture honor any "maketx:threads" hint passed in the config ImageSpec that it already takes to convey all sorts of controls over the texture creation process. Then this value is passed to any IBA functions, use of parallel_image, and anything else in the implementation of make_texture that would end up using the thread pool. Fixes AcademySoftwareFoundation#4254 --------- Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…SoftwareFoundation#5011) Utilities to ask the IB for the local pixels as an untyped span of bytes. This is a "safe" alternative to `localpixels()`, which just returned a single pointer, instead returning an image_span that understands the sizes and strides of the buffer. --------- Signed-off-by: Larry Gritz <lg@larrygritz.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…ademySoftwareFoundation#5018) This variable should not have been static. Signed-off-by: Brecht Van Lommel <brecht@blender.org> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
…on#5017) Add IOProxy support similar to other file formats. MyHeifWriter was renamed for consistency with other code. All input and output now goes through the proxy, so this is covered by existing tests. Signed-off-by: Brecht Van Lommel <brecht@blender.org> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
lgritz
left a comment
There was a problem hiding this comment.
This is just a first set of comments on a few organizational things. It's a lot to review, and I haven't really dug into the meat of the code yet. We'll do a little bit at a time.
| @@ -1,5 +1,4 @@ | |||
| Policy on AI Coding Assistants | |||
| ============================== | |||
There was a problem hiding this comment.
This is one of several spots where something unrelated to this PR seems to have changed for no reason.
| # Helper: record the final status of a dependency that is discovered outside | ||
| # checked_find_package(), so it still shows up in the dependency summary. | ||
| macro (record_build_dependency pkgname) | ||
| cmake_parse_arguments(_pkg | ||
| "FOUND;NOTFOUND;REQUIRED" | ||
| "VERSION;NOT_FOUND_EXPLANATION" | ||
| "" |
There was a problem hiding this comment.
What's with all the changes here?
| # Note: If this tag is empty the current directory is searched. | ||
|
|
||
| INPUT = ../../src | ||
| INPUT = ../../src/include/OpenImageIO |
There was a problem hiding this comment.
Where the contents of Doxyfile changed on purpose?
| imiv_user | ||
| imiv_dev | ||
| imiv_tests |
There was a problem hiding this comment.
I think only the user documentation should be in src/doc and appear in the ReadTheDocs page that explains how users should use OIIO. I believe the developer documentation (contents of imiv_dev and imiv_tests, I believe) should go in docs/dev with the rest of the developer documentation that explains how we develop the code.
| # dnd_glfw – GLFW Drag-and-Drop Helper | ||
|
|
||
| `dnd_glfw` is a very small helper around GLFW that exposes a simple, C‑style drag‑and‑drop callback interface. It is designed for applications that already use GLFW for their main window (e.g. Dear ImGui with the GLFW/OpenGL backend) and want better control over file drops and drag‑hover overlays. | ||
|
|
There was a problem hiding this comment.
Is dnd_glfw an existing external project? Oh, I see: https://github.com/ssh4net/dnd_glfw
You should definitely reference that here, and point out that the reason we're keeping this in a separate external/ directory is so that new versions of the external one can just be dropped in, so it's not too mixed with the rest of the code that might drift separately?
I think it would be helpful for the periodic license scanning, if the dnd_glfw file had at their top the same kind of // SPDX-License-Identifier: MIT identifier and copyright notice (though with your name, if you are the external author).
| /*.log | ||
|
|
||
|
|
||
| /build_* |
| add_subdirectory (src/igrep) | ||
| add_subdirectory (src/iinfo) | ||
| add_subdirectory (src/imiv) | ||
| add_subdirectory (src/maketx) |
There was a problem hiding this comment.
This line is fine, but about 10 lines higher up, you probably need an ENABLE_imiv switch for the SKBUILD case.
(GitHub reviews unfortunately do not line you add comments to code that didn't change, even if you are just trying to point a place that SHOULD have changed!)
| OpenImageIO | ||
| $<TARGET_NAME_IF_EXISTS:OpenColorIO::OpenColorIO> | ||
| $<TARGET_NAME_IF_EXISTS:OpenColorIO::OpenColorIOHeaders>) | ||
| find_package (glfw3 CONFIG QUIET) |
There was a problem hiding this comment.
Can all of the find_package file in this file just be changed to checked_find_package, gain all the extra features that provides, and then you don't need to add record_build_dependency or other changes to dependency_utils.cmake?
lgritz
left a comment
There was a problem hiding this comment.
imiv/CMakeLists.txt is absolutely enormous! Is there any way that it can be simplified?
|
I've never programmed for Dear Imgui before, so I don't know if what I'm asking is naive. Maybe I am misunderstanding how Imgui projects are typically structured. But the amount of code and even the number of added source code modules is absolutely humongous compared to the existing iv. Old iv using Qt:
New iv using Dear ImGUI:
Does this seem right? Does a fairly simple image viewer need so much boilerplate with Imgui that it's nearly 5x more implementation code than the equivalent app using Qt (plus an additional 1.5x for testing infrastructure)? That feels off to me, but that's just my intuition. If you had asked me beforehand what I expected the imgui version of iv to be like, I would have guessed that it would be similar size and complexity as the old Qt one (maybe I could even hoped for some kind of simplification?), but bringing the advantage of allowing us to drop Qt as a dependency (which is a small but concrete benefit to builders, because Qt is so huge and onerous to build). It's an entirely different set of tradeoffs to consider if the cost of dropping Qt is a 5x increase in OIIO-side implementation code size for the viewer app. |
|
@lgritz imgui for sure need more boilerplate, especially Vulkan backend or support multiply backends. But I will check if a code base can be reduced. |
Contrasting data point: https://github.com/wkjarosz/hdrview It has a total of 133 source files, 47,140 LOC. It doesn't use OIIO or a similar comprehensive format library, so it has a lot of code dedicated to reading the formats (37 source files, 12069 lines). Excluding that, then, the total is 96 files, 35k LOC.) With those high-level stats, it could be that it proves that it's roughly the same size as Vlad's imiv, and that's just what is to be expected for an ImGui-based viewer. Or it could be that only a small subset of those 35k LOC are directly related to ImGui, indicating that we're being much more repetitive and verbose than needed? Might be worth a look to see what they're doing. |
|
By the way, given the existence of hdrview and other very nice viewers, one might be tempted to ask, "Does OIIO need a viewer at all?" And also, "if so, how good does it need to be?" is important when evaluating tradeoffs like this PR. Here is my answer. The goals of iv are:
So, then, it's primarily a validation and debugging tool for OIIO itself (and therefore still necessary, IMHO). And secondarily, people may find it a good viewer in its own right, if their needs aren't too strenuous, but we are not trying to make it a comprehensive, production-quality studio viewer (and therefore, there is a point of diminishing returns on added complexity and ongoing maintenance cost). |
|
Yes, @lgritz, I also always was in thoughs is oiio should have a full-featured image viewer, when a proper GUI app required a lot of attention. And got carried away from the original idea, making only the OpenGL version, with all that multi-backend fun. |
|
Wait, are you being too hasty here? I was not necessarily implying that we shouldn't pursue this, and definitely wasn't prodding you to close this PR. I'm still trying to understand a basic question -- can iv switch to a lighter-weight dependency than Qt, without it somehow exploding the amount of code we have to maintain by a large factor? I think there's merit to dropping Qt for something simpler, as long as there is not too high a cost imposed somewhere else. There also is merit to improving iv. I'm definitely not against that, it's just a matter of cost for benefit, and what we mean by "improve." Two things to say about this:
|
|
For sure, something that should be a simple image viewer becomes overcomplicated. |
|
I'm curious what you think if you take a quick skim of hdrview. Do you look at that and think "yeah, looks roughly the same as imiv", or do you think "wow, they made the imgui parts much smaller"? I don't know enough about imgui to make the judgment myself, I don't know what to look for. I know that lots of projects really like imgui and I've heard great things about it. I don't recall anybody saying "but OMG it makes the code 5x bigger". But maybe everybody but me already understands that and it doesn't need to be said out loud? |
Could be. But if so, it's kinda coincidence. When I wrote iv in early 2008, I think the only toolkits that seemed capable and cross-platform at that time were Qt, WxWidgets, and Fltk. I'd used fltk before, but it seemed kind of old fashioned. I picked Qt somewhat arbitrarily, and because I knew that in vfx, it was becoming more common. Since then, it's just been inertia. Lots of other GUI toolkits have popped up (including ImGui), and I never stopped to directly compare them. We are not using Qt for any principled reason. |
|
I will review Imiv with HDRiview. Maybe i missing something in a logic. |
|
@lgritz looks like Hdrview is heavily related to the HelloImGui and ImPlot libraries, which are themselves layer libraries on top of ImGui. Personally, I slightly fear relating to the ImGui 3rd-party libraries as they are not maintained as well as ImGui itself. |
|
I'm going to re-open this. Let's just let it sit for a while and gather other people's opinions before deciding if this is a tradeoff that makes sense for us in the long run. |
Move large imiv source, shader and test lists out of src/imiv/CMakeLists.txt into dedicated cmake/imiv_sources.cmake and cmake/imiv_tests.cmake and include them from CMakeLists. This extracts shared_sources, platform/renderer source groups, shader embedding/custom-command helpers, font embedding logic and test registrations to improve CMake organization and readability. Also adds a number of new imiv source/header files (actions, developer tools, file actions, image library, persistence/parse, Vulkan helpers, preview shader text, probe overlay, workspace UI, etc.) referenced by the new cmake files. Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Pass the underlying C string to +[NSString stringWithUTF8String:] instead of the std::string object. This fixes an incorrect/ambiguous conversion when creating the Metal shader source NSString in the renderer. Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
Add SPDX headers. Reformat and tidy dnd_glfw.h (includes, spacing, inline function layout, and minor Windows DropTarget refactor) without changing public API. On macOS, stop registering NSFilenamesPboardType and adjust cocoaView bridging to use manual cast/release (fixes retain/release semantics). Small adjustment to GLFW drop-callback setup/assignment formatting. Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com> Signed-off-by: Vlad <shaamaan@gmail.com>
Introduce helper utilities and refactor duplicated Metal OCIO logic: add create_default_compile_options and create_ocio_compile_options; add begin_offscreen_render_pass and end_offscreen_render_pass to centralize command buffer/encoder lifecycle; introduce MetalOcioShaderSourceParts and helper builders (append_ocio_* / build_ocio_shader_call_params / append_texture_binding_source) to construct OCIO shader sources and call parameters; factor texture upload loops into upload_ocio_textures_for_dimension and upload_ocio_non_3d_textures; add bind_ocio_fragment_resources to bind fragment uniforms/textures. Update preview pipeline and OCIO preview program to use these helpers, reducing duplication and improving clarity and error handling. Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Move all image save/export functionality out of imiv_file_actions.cpp into a new imiv_image_save.cpp/.h pair to separate responsibilities and reduce file size. Update imiv_file_actions.cpp to include the new header and remove the duplicated save/build helpers. Add imgui_stdlib (imgui_stdlib.cpp/header) to CMake source lists and use ImGui::InputText(std::string) in imiv_ui.cpp (replace manual buffer handling). Also add /bld to .gitignore and register the new source file in imiv_sources.cmake/CMakeLists.txt. Signed-off-by: Vlad <shaamaan@gmail.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Add a new Image List UI (imiv_image_list_ui.*) and a dedicated Preferences window (imiv_preferences_window.cpp), and wire them into the build (imiv_sources.cmake). Replace the previous image_window_title function with an inline constexpr k_image_window_title and update call sites. Move large preference-related UI code out of imiv_aux_windows.cpp into the new preferences file and clean up related helper functions. Update persistence paths to use string literals for legacy filenames, and adjust includes across several modules (developer tools, frame, etc.) to reference the new headers. Also include minor adjustments to test-engine hooks to use the new image title constant and other housekeeping to integrate the new UI components. Signed-off-by: Vlad <shaamaan@gmail.com> Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Remove small per-backend wrapper functions and wire the vtables to the real ImGui functions and existing helpers. Added renderer_noop_wait_idle and a renderer_call_backend_new_frame template in the header to avoid duplicated no-op/new-frame wrappers. Updated Metal, OpenGL and Vulkan backends to use ImGui_Impl* Shutdown/NewFrame directly and to reference existing functions (e.g. platform_glfw_supports_vulkan, imiv_vulkan_screen_capture). This reduces boilerplate and keeps behavior unchanged. Signed-off-by: Vlad <shaamaan@gmail.com>
Refactor UI and build sources: remove legacy backend/workspace/image-list/save/vulkan-window modules and update CMake source lists accordingly. Move/centralize preferences UI into imiv_aux_windows.cpp (theme, pixel view, image rendering, OCIO config, backend selector, memory, slideshow and close behavior) and update documentation to reference imiv_vulkan_setup. Add image export/save and OCIO-aware processing routines to imiv_file_actions.cpp and adjust includes across several modules to use imiv_viewer/imiv_workspace_ui. Overall cleanup to consolidate preference, export, and backend selection logic and remove obsolete files. Signed-off-by: Vlad <shaamaan@gmail.com>
helper functions to obtain/validate backend state (ensure_opengl_backend_state, opengl_window_state, ensure_vulkan_backend_state, vulkan_backend_state) and consolidate repeated null/initialization checks. Replace many explicit backend setup/teardown functions with inline lambdas in the renderer vtables, reducing duplicated code for instance/device/window/surface setup, context backup/restore, frame present and cleanup. Also standardize framebuffer size handling (use renderer_set_framebuffer_size) and adjust texture/create/update flows to use the new helpers and clearer error messages. Overall this simplifies control flow and centralizes error handling for OpenGL and Vulkan backends. Signed-off-by: Vlad <shaamaan@gmail.com>
Introduce imiv_upload_corpus_smoke.py: a new Python driver that runs batched upload smoke tests by generating per-batch scenarios, invoking the GUI test runner, collecting screenshots and state JSON, validating results, and writing a summary CSV. Update imiv_upload_corpus_smoke_test.sh to call the new driver with batch/timeout options and sensible defaults. Refactor imiv_auto_subimage_regression.py to remove the old internal _run_case helper and add a "baseline" scenario step (and include it when collecting scenario states), so the baseline is produced via the scenario runner rather than a separate invocation. Overall this consolidates per-image logic into a batched workflow and simplifies test orchestration. Signed-off-by: Vlad <shaamaan@gmail.com>
Create_buffer_resource and create_buffer_with_memory_resource plus make_color_image_memory_barrier to centralize buffer creation, memory allocation/binding and common image memory barrier setup. Replace repeated vkCreateBuffer/allocate_and_bind_buffer_memory and manual VkImageMemoryBarrier constructions across OCIO, preview and texture code with the new helpers to reduce duplication, improve readability, and preserve existing error reporting and debug naming. Updated headers and call sites in imiv_vulkan_ocio.cpp, imiv_vulkan_preview.cpp, imiv_vulkan_texture.cpp and resource utils files accordingly. Signed-off-by: Vlad <shaamaan@gmail.com>
Include pixel probe info in test state output and make Vulkan resource management more robust. - imiv_developer_tools.cpp: Write probe fields (probe_valid, probe_pos, probe_channel_count) into the test-engine JSON output so runner tests can inspect probe state. - imiv_image_view.cpp: Use env_read_int_value to fetch forced probe coordinates and simplify validation logic. - imiv_vulkan_setup.cpp: Factor repeated destroy logic into small helper functions (shader module, pipeline, pipeline layout, descriptor set layout, descriptor pool, render pass) and use them across cleanup paths; change init_* functions to build resources in a linear, transactional manner (do-break cleanup) so partial failures clean up correctly; ensure shader modules are destroyed on failure and centralize descriptor pool destruction. - tools/imiv_area_probe_closeup_regression.py: Add _run_runner helper and a two-step test flow: run a pixel-closeup probe to capture probe state JSON (validate probe_valid and probe_pos), then run the area-probe closeup runner. Also add probe_state_path and related checks. These changes improve testability of the pixel probe feature and harden Vulkan resource lifecycle handling to avoid leaks on error paths. Signed-off-by: Vlad <shaamaan@gmail.com>
Description
This PR adds imiv to OpenImageIO as a full application, with its own build integration, documentation, and test coverage.
The goal here is to upstream the whole app in a usable state rather than split it into a long series of smaller PRs.
What is included:
A few implementation notes that are probably useful to reviewers:
This is meant to be the first upstreamable version of imiv, not the last word on its architecture. There is still room for follow-up work, especially around larger-image tiling/proxy paths and longer-term refinement, but the app is now in a shape where it can be reviewed and used as part of the tree.
Warning: This project heavily used Codex GPT5.4 in Extra High, but the Vulkan and OpenGL integration of the image viewer itself is based on my personal projects and prior experience in similar tools.
In a project, working time code multiply times was passed a code review using an alternative LLM like Opus 4.6 to avoid single model bias. The issues found at that time were fixed.
I have not polished the GUI layout, and some proper use of ImGui Table/Forms is still needed to make the GUI better respond to layouts.
Tests
This PR adds a dedicated imiv regression suite built around Dear ImGui Test Engine, plus backend-level verification tools.
Coverage includes focused GUI regressions for:
It also includes shared backend verifier coverage for:
Validation was done on the current development platforms:
New dependencies:
Required / core for imiv
Optional but imiv-specific
Vendored helper in imiv
Checklist:
and I have used AI coding assistants
Codex CLI/ Codex GPT5.4 Extra Highbehavior.
PR, by pushing the changes to my fork and seeing that the automated CI
passed there. (Exceptions: If most tests pass and you can't figure out why
the remaining ones fail, it's ok to submit the PR and ask for help. Or if
any failures seem entirely unrelated to your change; sometimes things break
on the GitHub runners.)
fixed any problems reported by the clang-format CI test.
corresponding Python bindings. If altering ImageBufAlgo functions, I also
exposed the new functionality as oiiotool options.