21 double focus = _focus;
22 double concavity = _concavity;
23 int maxrez_x = _maxrez_x;
24 int tail_mode_start = _tail_mode_start;
25 int tail_mode_end = _tail_mode_end;
29 if (max > 255) max = 255;
34 if (concavity > 1.0) concavity = 1;
35 if (concavity < -1.0) concavity = -1;
36 if (query > maxrez_x) query = maxrez_x;
37 if (query < 0) query = 0;
38 if (focus < .2) focus = .2;
39 if (focus > .8) focus = .8;
44 int half =
int(maxrez_x*focus);
46 if (query > half) _t = double(query-half)/double(maxrez_x-half);
47 else _t = double(query)/double(half);
48 int center_y =
int( ( (
double(max-min)/
double(maxrez_x) )*(half) )+min );
50 if (concavity < 0) delta = max-center_y;
51 else delta = center_y-
min;
58 double y1 = center_y-(concavity*delta);
61 if (y1 > max) y1 =
max;
62 if (y1 < min) y1 =
min;
67 double vy0 = double(y1-y0);
69 if (concavity < 0) concavity *= double(-1.0);
70 double vy1 = ( double(y2-y0)/double(2) )*(
double(1.0)-concavity);
72 double vy2 = double(y2-y1);
73 if ( !(tail_mode_start < 0) ) vy0 = tail_mode_start;
74 if ( !(tail_mode_end < 0) ) vy2 = tail_mode_end;
86 yt =
int( y0+(vy0*_t0)
87 +( ( ( 3*(y1-y0) )-( (2*vy0)+vy1 ) )*pow( _t0, 2 ) )
88 +( ( ( 2*(y0-y1) )+(vy0+vy1) )*pow( _t0, 3 ) ) );
94 yt =
int( y1+(vy1*_t1)
95 +( ( ( 3*(y2-y1) )-( (2*vy1)+vy2 ) )*pow( _t1, 2 ) )
96 +( ( ( 2*(y1-y2) )+(vy1+vy2) )*pow( _t1, 3 ) ) );
98 int return_alpha = yt;
99 if (return_alpha < min) return_alpha =
min;
100 if (return_alpha > max) return_alpha =
max;