I also templated the function for 32bpp support. This scaler is unique in that it uses the products of interpolation to then compare to other pixels (in other scalers, the products of interpolation are only written to the final image). The existing interpolation functions mangled the alpha channel (in the case of rgba and argb) and padding bits (in rgb888). This caused quirky image defects to happen that were trickier to track down, since the different alpha channels caused the comparisons to be different without changing the color of the pixels.
In the past, I had debugged these problems by simply returning the color red from an interpolation function. Then I would see if the broken pixels turned red. Since this scaler compared the results of the interpolation, whenever I followed a similar technique, the scaler would choose a different path, and the image would change in more chaotic ways (e.g. lines ceasing to anti-alias, black pixels appearing (but not red)). Everything at least appears to be fixed now.
Here are some sample images scaled with the 32bpp scaler.
Edge2x
Edge3x
sorry in case I missed it, but is this scaler available somewhere as a stand-alone version, so i can have a look at the code without any ScummVM dependencies? THX
ReplyDeleteI don't think it is available anywhere as a stand-alone version. However, it doesn't have too many dependencies. It doesn't call any ScummVM code (it is only called by other code) so you could probably change the class inheritance and typedef some simple types (uint32, byte, etc.) and it would compile by itself with minimal changes.
Delete