Matrix.hx 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*
  2. * Copyright (C)2005-2019 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\SVGMatrix.webidl. Do not edit!
  23. package js.html.svg;
  24. /**
  25. Many of SVG's graphics operations utilize 2x3 matrices of the form:
  26. Documentation [SVGMatrix](https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix>
  28. **/
  29. @:native("SVGMatrix")
  30. extern class Matrix {
  31. /**
  32. A float representing the a component of the matrix.
  33. **/
  34. var a : Float;
  35. /**
  36. A float representing the b component of the matrix.
  37. **/
  38. var b : Float;
  39. /**
  40. A float representing the c component of the matrix.
  41. **/
  42. var c : Float;
  43. /**
  44. A float representing the d component of the matrix.
  45. **/
  46. var d : Float;
  47. /**
  48. A float representing the e component of the matrix.
  49. **/
  50. var e : Float;
  51. /**
  52. A float representing the f component of the matrix.
  53. **/
  54. var f : Float;
  55. /**
  56. Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting new matrix as `SVGMatrix`.
  57. **/
  58. function multiply( secondMatrix : Matrix ) : Matrix;
  59. /**
  60. Returns the inverse matrix as `SVGMatrix`.
  61. @throws DOMError
  62. **/
  63. function inverse() : Matrix;
  64. /**
  65. Post-multiplies a translation transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  66. **/
  67. function translate( x : Float, y : Float ) : Matrix;
  68. /**
  69. Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  70. **/
  71. function scale( scaleFactor : Float ) : Matrix;
  72. /**
  73. Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  74. **/
  75. function scaleNonUniform( scaleFactorX : Float, scaleFactorY : Float ) : Matrix;
  76. /**
  77. Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  78. **/
  79. function rotate( angle : Float ) : Matrix;
  80. /**
  81. Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix as `SVGMatrix`. The rotation angle is determined by taking (+/-) atan(y/x). The direction of the vector (x, y) determines whether the positive or negative angle value is used.
  82. @throws DOMError
  83. **/
  84. function rotateFromVector( x : Float, y : Float ) : Matrix;
  85. /**
  86. Post-multiplies the transformation [-1 0 0 1 0 0] and returns the resulting matrix as `SVGMatrix`.
  87. **/
  88. function flipX() : Matrix;
  89. /**
  90. Post-multiplies the transformation [1 0 0 -1 0 0] and returns the resulting matrix as `SVGMatrix`.
  91. **/
  92. function flipY() : Matrix;
  93. /**
  94. Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  95. @throws DOMError
  96. **/
  97. function skewX( angle : Float ) : Matrix;
  98. /**
  99. Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  100. @throws DOMError
  101. **/
  102. function skewY( angle : Float ) : Matrix;
  103. }