Traverse-Research / ispc-downsampler

Image downsampler using a Lanczos filter implemented in ISPC
Other
11 stars 1 forks source link

Fix alpha coverage for images of single width/height #45

Closed Athosvk closed 7 months ago

Athosvk commented 7 months ago

The previous coverage returned for 1x1 images was incorrect and should have checked its alpha instead, but I noticed that this was wrong for any single column or row case (i.e. size 1 x n or n x 1), due to the use of subsampling. This would make the alpha coverage accumulation always result in zero and trigger a division by zero right after.

This change makes it so that single row or column images simply don't use the subsampling pattern, as it's likely not sound to do the subsampling in only one dimension.