Cleanup: simplify code in IMB_transform #117182

Merged
Aras Pranckevicius merged 1 commits from aras_p/blender:imbuf_transform_cleanup into main 2024-01-16 20:39:19 +01:00

1 Commits

Author SHA1 Message Date
Aras Pranckevicius 4a6fdd3a25 Cleanup: simplify code in ImBuf IMB_transform
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
There were some abstractions inside IMB_transform implementation that
were kinda getting in the way. I want to speed up Subsampled3x3
filtering by reformulating the math being done, but that needs to sample
byte images while storing intermediate result as a float -- but the
whole Pixel, PixelPointer et al. machinery was not quite prepared to
deal with that. Feels like those helper classes do not achieve much,
just make the code longer.

So remove them (Pixel, PixelPointer, ChannelConverter etc.) and use
simple functions where needed. Now the code is more straightforward and
270 lines shorter (40% of the whole file!), and allows me to do the
followup optimization easier.
2024-01-16 20:59:22 +02:00