fix(iv): 'save window' saves only the visible region - #5479
Conversation
|
|
8fee93f to
34ab58f
Compare
|
Need CLA and formatting fix. I built it on my side, and it did not behave quite like I expected. Maybe we should establish a common understanding of what this does. What do you think is the difference between
Trying them on my end, I could discern no difference at all. Now I'm a little confused about what we originally wanted and/or really should do. I have some ideas, but before I pollute the space with my notions, I'd like to hear what you and others think. What was your recipe for testing this? Do you have a sequence of actions that results in different saved results for the three menu choices? |
|
Wait! I take it back! I was testing the wrong branch. This does seem to work -- "save window as" does save the part of the image that's visible in the window as a separate image. So you can zoom, adjust window boundaries, etc., and it acts as a cropping tool. |
cba984e to
6a7a1d3
Compare
|
Seems to be failing CI. |
Signed-off-by: Aurele Boquet <aurele.boquet@gmail.com>
6a7a1d3 to
81a7656
Compare
|
I had to rebase, there was a refactoring of IvGL which removed the variable |
87530a8
into
AcademySoftwareFoundation:main
…Foundation#5479) Issue: "Save Window As..." called ImageBuf::write() on the whole image, which made it do exactly the same thing as "Save As...". Add IvGL::get_visible_image_roi(), which maps the two opposite corners, sorts out which is the min and which is the max, and intersects the result with the data window so only real pixels come back. saveWindowAs() then writes ImageBufAlgo::cut() of that region instead of the whole buffer, returns an error if nothing is visible. Closes AcademySoftwareFoundation#4716 Assisted-by: Claude Code / Claude Opus 5 Signed-off-by: Aurele Boquet <aurele.boquet@gmail.com>
Issue: "Save Window As..." called ImageBuf::write() on the whole image, which made it do exactly the same thing as "Save As...".
Add IvGL::get_visible_image_roi(), which maps the two opposite corners, sorts out which is the min and which is the max, and intersects the result with the data window so only real pixels come back.
saveWindowAs() then writes ImageBufAlgo::cut() of that region instead of the whole buffer, returns an error if nothing is visible.
Closes #4716
Assisted-by: Claude Code / Claude Opus 5