paste.org.ru Thu Jan 21 11:15:53 2021 : wd : diff : 2554 wide : parent ]
cookies:
name:

scheme:

custom css:


tools:
custom css sample
paste bash script
more coming soon
or not soon...
last:

- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Olymp Umzuge
- Anonymous
- Anonymous
- 210.86.2.169
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- 210.86.2.169
- Lehmann Umzuge
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Palestine
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous
- Anonymous

  1. --- xinput_calibrator.orig/src/calibrator.cpp 2021-01-21 05:52:42.096387477 +0300
  2. +++ xinput_calibrator/src/calibrator.cpp 2021-01-21 11:11:20.368336089 +0300
  3. @@ -144,6 +144,58 @@
  4. return false;
  5. }
  6. +// Transformation matrix
  7. +// from http://support.fccps.cz/download/adv/frr/matrix_calibrator/matrix_calibrator.htm
  8. +
  9. + // get the average left/right X and upper/lower Y
  10. + float x0x = ( clicked.x[UL] + clicked.x[LL] ) / 2.0 / width;
  11. + float x0y = ( clicked.y[UL] + clicked.y[LL] ) / 2.0 / height;
  12. + float x1x = ( clicked.x[UR] + clicked.x[LR] ) / 2.0 / width;
  13. + float x1y = ( clicked.y[UR] + clicked.y[LR] ) / 2.0 / height;
  14. + float y0x = ( clicked.x[UL] + clicked.x[UR] ) / 2.0 / width;
  15. + float y0y = ( clicked.y[UL] + clicked.y[UR] ) / 2.0 / height;
  16. + float y1x = ( clicked.x[LL] + clicked.x[LR] ) / 2.0 / width;
  17. + float y1y = ( clicked.y[LL] + clicked.y[LR] ) / 2.0 / height;
  18. +//printf ("ZZ: %f %f %f %f %f %f %f %f\n", x0x,x0y, x1x,x1y, y0x,y0y, y1x,y1y);
  19. +
  20. + //get the difference right-left X and lower-upper Y
  21. + float dxx=x1x-x0x;
  22. + float dxy=x1y-x0y;
  23. + float dyx=y1x-y0x;
  24. + float dyy=y1y-y0y;
  25. +//printf ("ZZ: Ds %f %f %f %f\n",dxx,dxy,dyx,dyy);
  26. +
  27. +/* Calculation equations:
  28. + 1. x0x * a + x0y * b + c = 1/8 (the left point equation)
  29. + 2. x1x * a + x1y * b + c = 7/8 (the right point equation)
  30. + 3. a / b = dxx / dxy (tg alfa)
  31. + Subtract 1. from 2.:
  32. + 4. (x1x - x0x) * a + (x1y - x0y) * b = 6/8
  33. + 5. dxx * a + dxy * b = 6/8
  34. + Isolate (b) from 3.:
  35. + 6. b = a * dxy / dxx
  36. + Substitute (b) in 5.:
  37. + 7. dxx * a + dxy * a * dxy / dxx = 6/8
  38. + Isolate (a) from 7.:
  39. + 8. a * (dxx + dxy^2 / dxx) = 6/8
  40. + 9. a * (dxx^2 + dxy^2) / dxx = 6/8
  41. + 10. a = 6/8 * dxx / (dxx^2 + dxy^2) !RESULT!
  42. + Analogically for (b):
  43. + 11. b = 6/8 * dxy / (dxx^2 + dxy^2) !RESULT!
  44. + We will get (c) substituting (a) and (b) in 1.
  45. + For (d), (e) and (f) we use the same solution analogically.
  46. +*/
  47. +
  48. + //calculate the special sauce coefficients
  49. + float a = 6.0/8 * (dxx / (dxx*dxx + dxy*dxy));
  50. + float b = 6.0/8 * (dxy / (dxx*dxx + dxy*dxy));
  51. + float c = 1.0/8 - a*x0x - b*x0y;
  52. + float d = 6.0/8 * (dyx / (dyx*dyx + dyy*dyy));
  53. + float e = 6.0/8 * (dyy / (dyx*dyx + dyy*dyy));
  54. + float f = 1.0/8 - d*y0x - e*y0y;
  55. +
  56. + printf ("ZZ: TransformationMatrix %f %f %f %f %f %f 0 0 1\n", a, b, c, d, e, f);
  57. +
  58. // new axis origin and scaling
  59. // based on old_axys: inversion/swapping is relative to the old axis
  60. XYinfo new_axis(old_axys);