Commit 1ffde5d
committed
fix(IBA): Handle offset data windows in fillholes_pushpull
Fixes 4942
IBA::fillholes_pushpull() produced incorrect result when the source
image had a non-zero data window origin (such as exr files with
overscan).
Two interrelated bugs:
1. The paste() call double-applied the data window offset. paste()
maps source pixel (0,0) to destination (xbegin,ybegin), but since
the source data starts at (x,y), passing (x,y) as the offset
shifted every pixel by an extra (x,y). Pixels in the
negative-coordinate region landed outside the destination buffer
and were silently lost.
2. The top pyramid level preserved the original display/full window
while all smaller levels had full=data at (0,0). Since resize()
uses the full window for coordinate mapping, it only sampled the
display window portion of the top level, losing all overscan data.
Fix by shifting the top pyramid level to origin (0,0) with full=data,
making all levels coordinate-consistent. The initial paste translates
source pixels into the origin-based pyramid, and the final paste
(which was already using src origin offsets) correctly translates
back.
Add test cases in testsuite/oiiotool for fillholes with an offset data
window, and an offset display window, to ensure that both cases work.
Also, for the existing fillholes related test, move the source image
from ref (never should have been there) to src.
Assisted-by: Claude Code / claude-opus-4-6
Signed-off-by: Larry Gritz <lg@larrygritz.com>1 parent d21d027 commit 1ffde5d
7 files changed
Lines changed: 22 additions & 4 deletions
File tree
- src/libOpenImageIO
- testsuite
- oiiotool
- ref
- src
- python-imagebufalgo/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1614 | 1614 | | |
1615 | 1615 | | |
1616 | 1616 | | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
1617 | 1620 | | |
1618 | 1621 | | |
1619 | | - | |
1620 | | - | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
1621 | 1631 | | |
1622 | 1632 | | |
1623 | 1633 | | |
| |||
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
129 | 133 | | |
130 | 134 | | |
131 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| |||
285 | 288 | | |
286 | 289 | | |
287 | 290 | | |
| 291 | + | |
288 | 292 | | |
289 | 293 | | |
290 | 294 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
535 | | - | |
| 535 | + | |
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
| |||
0 commit comments