Fix Mingw compiling
[jpcrr.git] / streamtools / resizer-bilinear.cpp
blob293b7feaca8caf3f65f40b1ae27e012378958fc5
1 #include "resize-linear-separable.hpp"
2 #include <stdint.h>
3 #include <cmath>
4 #include <stdexcept>
6 namespace
8 void compute_coefficients_bilinear(float* coeffs, position_t num, position_t denum, position_t width,
9 unsigned& count, unsigned& base)
11 base = num / denum;
12 if(base < width - 1) {
13 float fpos = (num % denum) / denum;
14 coeffs[0] = 1 - fpos;
15 coeffs[1] = fpos;
16 count = 2;
17 } else {
18 coeffs[0] = 1;
19 count = 1;
23 simple_resizer_linear_separable r_bilinear("bilinear", compute_coefficients_bilinear);