diff options
author | jaseg <git@jaseg.de> | 2023-10-26 00:23:16 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-10-26 00:32:02 +0200 |
commit | 4d711a2fe85e5ebe814e4d12cd41badda1e7a046 (patch) | |
tree | 0712dcecfa003fa5f36dc8bc0c8219627c5cbca1 /svg-flatten/src | |
parent | 00eb9594d6089640cbdfe242da3a16c6bdf1f73f (diff) | |
download | gerbolyze-4d711a2fe85e5ebe814e4d12cd41badda1e7a046.tar.gz gerbolyze-4d711a2fe85e5ebe814e4d12cd41badda1e7a046.tar.bz2 gerbolyze-4d711a2fe85e5ebe814e4d12cd41badda1e7a046.zip |
Update all svg-flatten dependencies
Diffstat (limited to 'svg-flatten/src')
-rw-r--r-- | svg-flatten/src/nopencv.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/svg-flatten/src/nopencv.cpp b/svg-flatten/src/nopencv.cpp index e157ab5..e5317f5 100644 --- a/svg-flatten/src/nopencv.cpp +++ b/svg-flatten/src/nopencv.cpp @@ -9,7 +9,7 @@ #include <stb_image.h> #define STB_IMAGE_RESIZE_IMPLEMENTATION -#include <stb_image_resize.h> +#include <stb_image_resize2.h> #define IIR_GAUSS_BLUR_IMPLEMENTATION #include "iir_gauss_blur.h" @@ -574,22 +574,24 @@ template<> void gerbolyze::nopencv::Image<float>::resize(int new_w, int new_h) { float *old_data = m_data; m_data = new float[new_w * new_h]; - stbir_resize_float(old_data, m_cols, m_rows, 0, + stbir_resize_float_linear(old_data, m_cols, m_rows, 0, m_data, new_w, new_h, 0, - 1); + STBIR_1CHANNEL); m_cols = new_w; m_rows = new_h; + delete old_data; } template<> void gerbolyze::nopencv::Image<uint8_t>::resize(int new_w, int new_h) { uint8_t *old_data = m_data; m_data = new uint8_t[new_w * new_h]; - stbir_resize_uint8(old_data, m_cols, m_rows, 0, + stbir_resize_uint8_linear(old_data, m_cols, m_rows, 0, m_data, new_w, new_h, 0, - 1); + STBIR_1CHANNEL); m_cols = new_w; m_rows = new_h; + delete old_data; } template gerbolyze::nopencv::Image<int32_t>::Image(int size_x, int size_y, const int32_t *data); |