ParamCurve.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _ParamCurve_h_
  2. #define _ParamCurve_h_
  3. /* ParamCurve.h
  4. *
  5. * Copyright (C) 1992-2011,2012,2015,2017 Paul Boersma
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /*
  21. Parametrized curve (x (t), y (t)):
  22. two functions (x and y) of one variable (the parameter t).
  23. Sampled parametrized curve (x [i], y [j]):
  24. x [i] = x (tx [i]) = x (tx1 + (i - 1) * dtx);
  25. y [i] = y (ty [i]) = y (ty1 + (i - 1) * dty);
  26. */
  27. #include "Sound.h"
  28. #include "Graphics.h"
  29. #include "ParamCurve_def.h"
  30. void ParamCurve_init (ParamCurve me, Sound x, Sound y);
  31. autoParamCurve ParamCurve_create (Sound x, Sound y);
  32. /*
  33. Return value:
  34. a newly created ParamCurve object.
  35. Failures:
  36. Out of memory.
  37. Domains do not overlap:
  38. x -> xmax <= y -> xmin || x -> xmin >= y -> xmax.
  39. Postconditions:
  40. (Result's domain is intersection of both domains:)
  41. result -> xmin = max (x -> xmin, y -> xmin);
  42. result -> xmax = min (x -> xmax, y -> xmax);
  43. */
  44. void ParamCurve_draw (ParamCurve me, Graphics g, double t1, double t2, double dt,
  45. double x1, double x2, double y1, double y2, bool garnish);
  46. /*
  47. Function:
  48. draw the points of the curve between parameter values t1 and t2,
  49. in time steps dt starting at t1 and including t2,
  50. along the axes [x1, x2] x [y1, y2].
  51. Defaults:
  52. t2 <= t1: draw all (overlapping) points.
  53. dt <= 0.0: time step is the smaller of my x -> dx and my y -> dx.
  54. x2 <= x1: autoscaling along horizontal axis.
  55. y2 <= y1: autoscaling along vertical axis.
  56. */
  57. void ParamCurve_swapXY (ParamCurve me);
  58. /*
  59. Reflect around y = x.
  60. Postconditions:
  61. x == old y;
  62. y == old x;
  63. */
  64. /* End of file ParamCurve.h */
  65. #endif