Matrix.hx 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright (C)2005-2018 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. /**
  33. A float representing the a component of the matrix.
  34. **/
  35. var a : Float;
  36. /**
  37. A float representing the b component of the matrix.
  38. **/
  39. var b : Float;
  40. /**
  41. A float representing the c component of the matrix.
  42. **/
  43. var c : Float;
  44. /**
  45. A float representing the d component of the matrix.
  46. **/
  47. var d : Float;
  48. /**
  49. A float representing the e component of the matrix.
  50. **/
  51. var e : Float;
  52. /**
  53. A float representing the f component of the matrix.
  54. **/
  55. var f : Float;
  56. /**
  57. Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting new matrix as `SVGMatrix`.
  58. **/
  59. function multiply( secondMatrix : Matrix ) : Matrix;
  60. /**
  61. Returns the inverse matrix as `SVGMatrix`.
  62. @throws DOMError
  63. **/
  64. function inverse() : Matrix;
  65. /**
  66. Post-multiplies a translation transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  67. **/
  68. function translate( x : Float, y : Float ) : Matrix;
  69. /**
  70. Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  71. **/
  72. function scale( scaleFactor : Float ) : Matrix;
  73. /**
  74. Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  75. **/
  76. function scaleNonUniform( scaleFactorX : Float, scaleFactorY : Float ) : Matrix;
  77. /**
  78. Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  79. **/
  80. function rotate( angle : Float ) : Matrix;
  81. /**
  82. 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.
  83. @throws DOMError
  84. **/
  85. function rotateFromVector( x : Float, y : Float ) : Matrix;
  86. /**
  87. Post-multiplies the transformation [-1 0 0 1 0 0] and returns the resulting matrix as `SVGMatrix`.
  88. **/
  89. function flipX() : Matrix;
  90. /**
  91. Post-multiplies the transformation [1 0 0 -1 0 0] and returns the resulting matrix as `SVGMatrix`.
  92. **/
  93. function flipY() : Matrix;
  94. /**
  95. Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  96. @throws DOMError
  97. **/
  98. function skewX( angle : Float ) : Matrix;
  99. /**
  100. Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix as `SVGMatrix`.
  101. @throws DOMError
  102. **/
  103. function skewY( angle : Float ) : Matrix;
  104. }