kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Don't use variants of M_PI that aren't guaranteed to be present
rodzic
a694002364
commit
59e356ac13
|
@ -203,7 +203,7 @@ void genesys_deskew(Genesys_Scanner *s, const Genesys_Sensor& sensor)
|
||||||
sensor.optical_res, sensor.optical_res,
|
sensor.optical_res, sensor.optical_res,
|
||||||
&x, &y, &slope));
|
&x, &y, &slope));
|
||||||
|
|
||||||
DBG(DBG_info, "%s: slope=%f => %f\n",__func__,slope, (slope/M_PI_2)*90);
|
DBG(DBG_info, "%s: slope=%f => %f\n", __func__, slope, slope * 180 / M_PI);
|
||||||
|
|
||||||
// rotate image slope is in [-PI/2,PI/2]. Positive values rotate trigonometric direction wise
|
// rotate image slope is in [-PI/2,PI/2]. Positive values rotate trigonometric direction wise
|
||||||
TIE(sanei_magic_rotate(&s->params, dev->img_buffer.data(),
|
TIE(sanei_magic_rotate(&s->params, dev->img_buffer.data(),
|
||||||
|
|
|
@ -2421,7 +2421,8 @@ void sanei_genesys_load_lut(unsigned char* lut,
|
||||||
* then take the tangent (T.O.A)
|
* then take the tangent (T.O.A)
|
||||||
* then multiply by the normal linear slope
|
* then multiply by the normal linear slope
|
||||||
* because the table may not be square, i.e. 1024x256*/
|
* because the table may not be square, i.e. 1024x256*/
|
||||||
rise = std::tan(static_cast<double>(slope) / 128 * M_PI_4 + M_PI_4) * max_out_val / max_in_val;
|
auto pi_4 = M_PI / 4.0;
|
||||||
|
rise = std::tan(static_cast<double>(slope) / 128 * pi_4 + pi_4) * max_out_val / max_in_val;
|
||||||
|
|
||||||
/* line must stay vertically centered, so figure
|
/* line must stay vertically centered, so figure
|
||||||
* out vertical offset at central input value */
|
* out vertical offset at central input value */
|
||||||
|
|
Ładowanie…
Reference in New Issue