DOMMatrixReadOnly.idl 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #import <Geometry/DOMMatrix.idl>
  2. #import <Geometry/DOMPoint.idl>
  3. // https://drafts.fxtf.org/geometry/#dommatrixreadonly
  4. [Exposed=(Window,Worker), Serializable]
  5. interface DOMMatrixReadOnly {
  6. constructor(optional (DOMString or sequence<unrestricted double>) init);
  7. [NewObject] static DOMMatrixReadOnly fromMatrix(optional DOMMatrixInit other = {});
  8. // FIXME: [NewObject] static DOMMatrixReadOnly fromFloat32Array(Float32Array array32);
  9. // FIXME: [NewObject] static DOMMatrixReadOnly fromFloat64Array(Float64Array array64);
  10. // These attributes are simple aliases for certain elements of the 4x4 matrix
  11. readonly attribute unrestricted double a;
  12. readonly attribute unrestricted double b;
  13. readonly attribute unrestricted double c;
  14. readonly attribute unrestricted double d;
  15. readonly attribute unrestricted double e;
  16. readonly attribute unrestricted double f;
  17. readonly attribute unrestricted double m11;
  18. readonly attribute unrestricted double m12;
  19. readonly attribute unrestricted double m13;
  20. readonly attribute unrestricted double m14;
  21. readonly attribute unrestricted double m21;
  22. readonly attribute unrestricted double m22;
  23. readonly attribute unrestricted double m23;
  24. readonly attribute unrestricted double m24;
  25. readonly attribute unrestricted double m31;
  26. readonly attribute unrestricted double m32;
  27. readonly attribute unrestricted double m33;
  28. readonly attribute unrestricted double m34;
  29. readonly attribute unrestricted double m41;
  30. readonly attribute unrestricted double m42;
  31. readonly attribute unrestricted double m43;
  32. readonly attribute unrestricted double m44;
  33. readonly attribute boolean is2D;
  34. readonly attribute boolean isIdentity;
  35. // Immutable transform methods
  36. [NewObject] DOMMatrix translate(optional unrestricted double tx = 0, optional unrestricted double ty = 0, optional unrestricted double tz = 0);
  37. [NewObject] DOMMatrix scale(optional unrestricted double scaleX = 1, optional unrestricted double scaleY, optional unrestricted double scaleZ = 1, optional unrestricted double originX = 0, optional unrestricted double originY = 0, optional unrestricted double originZ = 0);
  38. [NewObject] DOMMatrix scaleNonUniform(optional unrestricted double scaleX = 1, optional unrestricted double scaleY = 1);
  39. [NewObject] DOMMatrix scale3d(optional unrestricted double scale = 1, optional unrestricted double originX = 0, optional unrestricted double originY = 0, optional unrestricted double originZ = 0);
  40. [NewObject] DOMMatrix rotate(optional unrestricted double rotX = 0, optional unrestricted double rotY, optional unrestricted double rotZ);
  41. [NewObject] DOMMatrix rotateFromVector(optional unrestricted double x = 0, optional unrestricted double y = 0);
  42. [NewObject] DOMMatrix rotateAxisAngle(optional unrestricted double x = 0, optional unrestricted double y = 0, optional unrestricted double z = 0, optional unrestricted double angle = 0);
  43. [NewObject] DOMMatrix skewX(optional unrestricted double sx = 0);
  44. [NewObject] DOMMatrix skewY(optional unrestricted double sy = 0);
  45. [NewObject] DOMMatrix multiply(optional DOMMatrixInit other = {});
  46. [NewObject] DOMMatrix flipX();
  47. [NewObject] DOMMatrix flipY();
  48. [NewObject] DOMMatrix inverse();
  49. [NewObject] DOMPoint transformPoint(optional DOMPointInit point = {});
  50. [NewObject] Float32Array toFloat32Array();
  51. [NewObject] Float64Array toFloat64Array();
  52. [Exposed=Window] stringifier;
  53. [Default] object toJSON();
  54. };
  55. dictionary DOMMatrix2DInit {
  56. unrestricted double a;
  57. unrestricted double b;
  58. unrestricted double c;
  59. unrestricted double d;
  60. unrestricted double e;
  61. unrestricted double f;
  62. unrestricted double m11;
  63. unrestricted double m12;
  64. unrestricted double m21;
  65. unrestricted double m22;
  66. unrestricted double m41;
  67. unrestricted double m42;
  68. };
  69. dictionary DOMMatrixInit : DOMMatrix2DInit {
  70. unrestricted double m13 = 0;
  71. unrestricted double m14 = 0;
  72. unrestricted double m23 = 0;
  73. unrestricted double m24 = 0;
  74. unrestricted double m31 = 0;
  75. unrestricted double m32 = 0;
  76. unrestricted double m33 = 1;
  77. unrestricted double m34 = 0;
  78. unrestricted double m43 = 0;
  79. unrestricted double m44 = 1;
  80. boolean is2D;
  81. };