Skip to content

Fix color channel contamination when resizing small images - #2414

Open
Hanabi9248 wants to merge 5 commits into
cinder:masterfrom
Hanabi9248:codex/resize-channel-cache
Open

Fix color channel contamination when resizing small images#2414
Hanabi9248 wants to merge 5 commits into
cinder:masterfrom
Hanabi9248:codex/resize-channel-cache

Conversation

@Hanabi9248

Copy link
Copy Markdown

Resizing a 2×1 RGBA surface filled with (20, 80, 160, 200) to 4×2 produces (20, 20, 20, 20). The scanline cache is shared across channels and keyed only by source row, so a short image can reuse the previous channel's filtered samples.

Invalidate the cached row indices before processing each channel, while retaining the allocated buffers. Add uint8 RGB/RGBA and floating-point regressions, and include them in the CMake, Visual Studio, and Xcode unit-test projects.

Both new test cases fail before the fix and pass afterward (592 assertions). Tested on Windows with MinGW GCC 16.2, compiling the repository's Catch runner and actual image-processing sources with C++20 and LTO. A separate comparison against independently resized channels also passes for 16 combinations of pixel type, alpha, and image height. Full Cinder builds and MSVC/macOS/Linux runs were not performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant