Skip to content

Commit 944ffe0

Browse files
committed
Add view-oriented Export As/Selection and OCIO tests
Introduce view-recipe-based export paths and OCIO CPU display support. Adds Export As... and Export Selection As... UI actions/shortcuts, build/save helpers (build_view_export_rgba_image, build_window_export_rgba_image, save_window_image, save_export_selection_image), selection/image builders, and OCIO CPU processor construction. Wire up menu, actions, and default filenames; add CTest entries and regression scripts (imiv_export_selection_regression.py, imiv_save_window_regression.py, imiv_save_window_ocio_regression.py). Update docs, README and notes to document the new export flows and tests. Signed-off-by: Vlad <shaamaan@gmail.com>
1 parent 44624b7 commit 944ffe0

15 files changed

Lines changed: 1694 additions & 22 deletions

src/doc/imiv_dev.rst

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,30 @@ That mirror step is intentional. It keeps most existing Dear ImGui code
225225
procedural while establishing one durable place for future `Save View As...`
226226
or CPU-side export processing.
227227

228-
The first real CPU export path is now `Save Selection As...`. It does not yet
229-
consume the full `ViewRecipe`; instead, it is intentionally narrower:
228+
The first full view-recipe CPU export path is now `Export As...`.
229+
230+
It currently:
231+
232+
* reconstructs an oriented RGBA image from the loaded source pixels;
233+
* applies the current view recipe for exposure, gamma, offset, channel/color
234+
display, and OCIO display/view state;
235+
* writes the resulting oriented RGBA view image through OIIO.
236+
237+
That makes `ViewRecipe` an actual preview/export seam rather than only runtime
238+
UI state.
239+
240+
`Export Selection As...` is the matching cropped variant. It uses the current
241+
selection rectangle in source pixel space, builds a cropped source `ImageBuf`,
242+
then runs the same view-recipe export path on that cropped image.
243+
244+
`Save Selection As...` remains intentionally narrower:
230245

231246
* it reconstructs an `ImageBuf` from the loaded source pixels;
232247
* crops the selected ROI;
233248
* bakes source orientation with `ImageBufAlgo::reorient()`;
234249
* writes the result through OIIO.
235250

236-
That makes it a useful end-to-end test seam for GUI-driven CPU processing
237-
without prematurely locking `Save View As...` to the wrong recipe-baking
238-
semantics.
251+
That keeps one export path source-oriented and one export path view-oriented.
239252

240253
`ImageLibraryState` and `MultiViewWorkspace`
241254
--------------------------------------------

src/doc/imiv_tests.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,15 @@ Recent focused GUI regressions in `src/imiv/tools/` include:
235235
* `imiv_save_selection_regression.py`
236236
GUI-driven `Save Selection As...` crop export, including selected ROI and
237237
orientation-baked CPU output validation.
238+
* `imiv_export_selection_regression.py`
239+
GUI-driven `Export Selection As...` export, including selection crop and
240+
view-recipe baking for channel/color mode and exposure/gamma/offset.
241+
* `imiv_save_window_regression.py`
242+
GUI-driven `Export As...` export, including view-recipe baking for
243+
channel/color mode and exposure/gamma/offset.
244+
* `imiv_save_window_ocio_regression.py`
245+
GUI-driven `Export As...` OCIO export, including view-baked display/view
246+
validation against `oiiotool --ociodisplay`.
238247

239248

240249
Direct Dear ImGui Test Engine usage

src/doc/imiv_user.rst

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,31 @@ Exporting images
159159
================
160160

161161
The current export actions are still smaller than :program:`iv`, but
162-
:program:`imiv` now has one real GUI-driven CPU export path:
162+
:program:`imiv` now has three real GUI-driven CPU export paths:
163+
164+
* `File -> Export As...`
165+
writes the current image pane as an oriented RGBA view export;
166+
* `Ctrl+Shift+S`
167+
invokes the same action directly;
163168

164169
* `File -> Save Selection As...`
165170
writes the current pixel selection to a new file;
166171
* `Ctrl+Alt+S`
167172
invokes the same action directly.
173+
* `File -> Export Selection As...`
174+
writes the selected pixel region as an oriented RGBA view export;
175+
* `Ctrl+Shift+Alt+S`
176+
invokes the same action directly.
177+
178+
`Export As...` currently exports:
179+
180+
* the current image with orientation baked to the saved output;
181+
* the active view recipe for exposure, gamma, offset, channel/color display,
182+
and OCIO display/view if OCIO is enabled.
183+
184+
It is intentionally a view export, not a source-preserving rewrite. The saved
185+
image is written as an oriented RGBA result and may differ in channel count and
186+
numeric type from the original source image.
168187

169188
`Save Selection As...` currently exports:
170189

@@ -175,8 +194,12 @@ It does not yet bake the full per-view recipe. In particular, exposure, gamma,
175194
offset, channel/color display choices, and OCIO display/view state are still
176195
preview-only at export time.
177196

178-
`Save Window As...` is also not yet a full per-view export. It still behaves
179-
like a regular `Save As...` path rather than baking the active view recipe.
197+
`Export Selection As...` currently exports:
198+
199+
* the selected pixel rectangle from the current image;
200+
* the image with its stored orientation baked to the saved output; and
201+
* the active view recipe for exposure, gamma, offset, channel/color display,
202+
and OCIO display/view if OCIO is enabled.
180203

181204

182205
Viewing, navigation, and inspection

src/doc/notes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ x Open ^O
77
Open Recent
88
Save ^S
99
Save As...
10-
Save Window As...
10+
Export As...
1111
Save Selection As...
1212
x Reload
1313
x Close ^W

src/imiv/CMakeLists.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,57 @@ if (TARGET imiv
14311431
LABELS "imiv;gui;imiv_export"
14321432
TIMEOUT 180)
14331433

1434+
add_test (
1435+
NAME imiv_export_selection_regression
1436+
COMMAND
1437+
"${Python3_EXECUTABLE}"
1438+
"${CMAKE_CURRENT_SOURCE_DIR}/tools/imiv_export_selection_regression.py"
1439+
--bin "$<TARGET_FILE:imiv>"
1440+
--cwd "$<TARGET_FILE_DIR:imiv>"
1441+
${_imiv_ctest_stable_ui_backend_args}
1442+
--oiiotool "$<TARGET_FILE:oiiotool>"
1443+
--idiff "$<TARGET_FILE:idiff>"
1444+
--env-script "${CMAKE_BINARY_DIR}/imiv_env.sh"
1445+
--out-dir "${CMAKE_BINARY_DIR}/imiv_captures/export_selection_regression")
1446+
set_tests_properties (
1447+
imiv_export_selection_regression PROPERTIES
1448+
LABELS "imiv;gui;imiv_export"
1449+
TIMEOUT 180)
1450+
1451+
add_test (
1452+
NAME imiv_save_window_regression
1453+
COMMAND
1454+
"${Python3_EXECUTABLE}"
1455+
"${CMAKE_CURRENT_SOURCE_DIR}/tools/imiv_save_window_regression.py"
1456+
--bin "$<TARGET_FILE:imiv>"
1457+
--cwd "$<TARGET_FILE_DIR:imiv>"
1458+
${_imiv_ctest_stable_ui_backend_args}
1459+
--oiiotool "$<TARGET_FILE:oiiotool>"
1460+
--idiff "$<TARGET_FILE:idiff>"
1461+
--env-script "${CMAKE_BINARY_DIR}/imiv_env.sh"
1462+
--out-dir "${CMAKE_BINARY_DIR}/imiv_captures/save_window_regression")
1463+
set_tests_properties (
1464+
imiv_save_window_regression PROPERTIES
1465+
LABELS "imiv;gui;imiv_export"
1466+
TIMEOUT 180)
1467+
1468+
add_test (
1469+
NAME imiv_save_window_ocio_regression
1470+
COMMAND
1471+
"${Python3_EXECUTABLE}"
1472+
"${CMAKE_CURRENT_SOURCE_DIR}/tools/imiv_save_window_ocio_regression.py"
1473+
--bin "$<TARGET_FILE:imiv>"
1474+
--cwd "$<TARGET_FILE_DIR:imiv>"
1475+
${_imiv_ctest_stable_ui_backend_args}
1476+
--oiiotool "$<TARGET_FILE:oiiotool>"
1477+
--idiff "$<TARGET_FILE:idiff>"
1478+
--env-script "${CMAKE_BINARY_DIR}/imiv_env.sh"
1479+
--out-dir "${CMAKE_BINARY_DIR}/imiv_captures/save_window_ocio_regression")
1480+
set_tests_properties (
1481+
imiv_save_window_ocio_regression PROPERTIES
1482+
LABELS "imiv;gui;imiv_export;imiv_ocio"
1483+
TIMEOUT 180)
1484+
14341485
add_test (
14351486
NAME imiv_rgb_input_regression
14361487
COMMAND

src/imiv/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,24 @@ Focused Save Selection export regression:
163163
ctest --test-dir build_u -V -R '^imiv_save_selection_regression$'
164164
```
165165

166+
Focused Export Selection As regression:
167+
168+
```bash
169+
ctest --test-dir build_u -V -R '^imiv_export_selection_regression$'
170+
```
171+
172+
Focused Export As regression:
173+
174+
```bash
175+
ctest --test-dir build_u -V -R '^imiv_save_window_regression$'
176+
```
177+
178+
Focused Export As OCIO regression:
179+
180+
```bash
181+
ctest --test-dir build_u -V -R '^imiv_save_window_ocio_regression$'
182+
```
183+
166184
Focused developer-menu regression:
167185

168186
```bash

0 commit comments

Comments
 (0)