Conversation
2de9b5b to
4cffa27
Compare
|
Thanks a lot 🎉 |
This is small patch to fix quality issues when scaling images down. It'll create a number of mipmap/half-scaled versions of a given source as required and use the next largest version as the source for bilinear or bicubic scaling. This uses the same downsampling functions as Skia, but similarly doesn't run SIMD versions of these. As they are integer-based, these should be reasonably quick.
4cffa27 to
a79233a
Compare
waywardmonkeys
left a comment
There was a problem hiding this comment.
Looking pretty good!
Any thoughts on adding a couple of tests?
|
@waywardmonkeys any idea of what sort of tests would be useful in this case? I'm imagining just integration tests, but if there are sensible unit tests I could add those? (I think Integration tests would involve some source and expected PNGs so might be a little tricky to keep the size down, but I'm guessing would include:
|
There was a problem hiding this comment.
I agree that this needs tests. One note: for mipmaps, you can cleanly pack all the "expected" results into a single file with the same dimensions as the original image, which I think is worth doing.
(That is, I think it's potentially worth having "unit tests" of the actual downscaling)
| @@ -0,0 +1,283 @@ | |||
| // Copyright 2006 The Android Open Source Project | |||
| // Copyright 2020 Yevhenii Reizner | |||
| // Copyright 2024 Jeremy James | |||
There was a problem hiding this comment.
We should remove this. It's not actually meaningful if it's not in the license, and so can only add extra confusion
This is small patch to fix quality issues when scaling images down. It'll create a number of mipmap/half-scaled versions of a given source as required and use the next largest version as the source for bilinear or bicubic scaling.
This uses the same downsampling functions as Skia, but similarly doesn't run SIMD versions of these. As they are integer-based, these should be reasonably quick.
This addresses issue #13, but probably wants some work and tests before merging.