int x, y; | int x, y; | ||||
int displ; | int displ; | ||||
int n_points; | int n_points; | ||||
double yy; | |||||
char line_buf[128]; | char line_buf[128]; | ||||
float env_x[20]; | float env_x[20]; | ||||
float env_y[20]; | float env_y[20]; | ||||
ix2++; | ix2++; | ||||
if (env_lin[ix2] > 0) { | if (env_lin[ix2] > 0) { | ||||
yy = env_y[ix2] + (env_y[ix2+1] - env_y[ix2]) * ((float)x - env_x[ix2]) / (env_x[ix2+1] - env_x[ix2]); | |||||
y = (int)(yy * 2.55); | |||||
y = (env_y[ix2] + (env_y[ix2+1] - env_y[ix2]) * ((float)x - env_x[ix2]) / (env_x[ix2+1] - env_x[ix2])) * 2.55; | |||||
} else if (n_points > 3) | } else if (n_points > 3) | ||||
y = (int)(polint(&env_x[ix], &env_y[ix], 4, x) * 2.55); // convert to range 0-255 | y = (int)(polint(&env_x[ix], &env_y[ix], 4, x) * 2.55); // convert to range 0-255 | ||||
else | else |