How do I do high quality scaling of a image?

后端 未结 11 1024
温柔的废话
温柔的废话 2021-01-30 15:19

I\'m writing some code to scale a 32 bit RGBA image in C/C++. I have written a few attempts that have been somewhat successful, but they\'re slow and most importantly the qualit

11条回答
  •  时光取名叫无心
    2021-01-30 15:38

    I've found the wxWidgets implementation fairly straightforward to modify as required. It is all C++ so no problems with portability there. The only difference is that their implementation works with unsigned char arrays (which I find to be the easiest way to deal with images anyhow) with a byte order of RGB and the alpha component in a separate array.

    If you refer to the "src/common/image.cpp" file in the wxWidgets source tree there is a down-sampler function which uses a box sampling method "wxImage::ResampleBox" and an up-scaler function called "wxImage::ResampleBicubic".

提交回复
热议问题