Go to the documentation of this file. 1 int resize_2d(
float *in_arr,
int inpix,
int inlin,
2 int outpix,
int outlin,
float *out_arr)
30 float ratio_l, ratio_p;
31 int op, oln, iln, ipx, ip, opx;
35 if (inpix <= 0 || inlin <= 0 || outpix <= 0 || outlin <= 0) {
42 ratio_l = (
float) (inlin - 1) / (
float) (outlin - 1);
43 ratio_p = (
float) (inpix - 1) / (
float) (outpix - 1);
51 for (oln = 0; oln < outlin; oln++) {
52 iln = (
int) ((
float) oln * ratio_l + .5);
54 for (opx = 0; opx < outpix; opx++) {
55 ipx = (
int) ((
float) opx * ratio_p + .5);
56 ip = ipx + iln * inpix;
60 *(out_arr + op++) = *(in_arr + ip);
int resize_2d(float *in_arr, int inpix, int inlin, int outpix, int outlin, float *out_arr)