Add ability to edit game name from UI
[jpcrr.git] / streamtools / rescalers / letterbox2.cpp
blob19c72581c46069a62d141e8b3d0e56ff93924fc7
1 #include "rescalers/linear-separable.hpp"
2 #include <stdint.h>
3 #include <cmath>
4 #include <stdexcept>
6 namespace
8 void compute_coefficients_letterbox(float* coeffs, position_t num, position_t denum, position_t width,
9 position_t twidth, unsigned& count, unsigned& base)
11 position_t header = (twidth - width) / 4 * 2;
12 position_t relpos = num / width - header;
13 *coeffs = 0;
14 count = 1;
15 base = 0;
16 if(relpos >= 0 && relpos < width) {
17 *coeffs = 1;
18 base = (unsigned)relpos;
22 simple_rescaler_linear_separable r_letterbox("letterbox2", make_bound_method(compute_coefficients_letterbox));