• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
18 *
19 * @syscap SystemCapability.ArkUI.ArkUI.Full
20 * @since 8
21 */
22/**
23 * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
24 *
25 * @syscap SystemCapability.ArkUI.ArkUI.Full
26 * @since 9
27 * @form
28 */
29/**
30 * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
31 *
32 * @syscap SystemCapability.ArkUI.ArkUI.Full
33 * @crossplatform
34 * @since 10
35 * @form
36 */
37declare class Matrix2D {
38  /**
39   * Horizontal Zoom
40   *
41   * @type { ?number }
42   * @syscap SystemCapability.ArkUI.ArkUI.Full
43   * @since 8
44   */
45  /**
46   * Horizontal Zoom
47   *
48   * @type { ?number }
49   * @syscap SystemCapability.ArkUI.ArkUI.Full
50   * @since 9
51   * @form
52   */
53  /**
54   * Horizontal Zoom
55   *
56   * @type { ?number }
57   * @syscap SystemCapability.ArkUI.ArkUI.Full
58   * @crossplatform
59   * @since 10
60   * @form
61   */
62  scaleX?: number;
63
64  /**
65   * Vertical Tilt
66   *
67   * @type { ?number }
68   * @syscap SystemCapability.ArkUI.ArkUI.Full
69   * @since 8
70   */
71  /**
72   * Vertical Tilt
73   *
74   * @type { ?number }
75   * @syscap SystemCapability.ArkUI.ArkUI.Full
76   * @since 9
77   * @form
78   */
79  /**
80   * Vertical Tilt
81   *
82   * @type { ?number }
83   * @syscap SystemCapability.ArkUI.ArkUI.Full
84   * @crossplatform
85   * @since 10
86   * @form
87   */
88  rotateY?: number;
89
90  /**
91   * Horizontal Tilt
92   *
93   * @type { ?number }
94   * @syscap SystemCapability.ArkUI.ArkUI.Full
95   * @since 8
96   */
97  /**
98   * Horizontal Tilt
99   *
100   * @type { ?number }
101   * @syscap SystemCapability.ArkUI.ArkUI.Full
102   * @since 9
103   * @form
104   */
105  /**
106   * Horizontal Tilt
107   *
108   * @type { ?number }
109   * @syscap SystemCapability.ArkUI.ArkUI.Full
110   * @crossplatform
111   * @since 10
112   * @form
113   */
114  rotateX?: number;
115
116  /**
117   * Vertical Zoom
118   *
119   * @type { ?number }
120   * @syscap SystemCapability.ArkUI.ArkUI.Full
121   * @since 8
122   */
123  /**
124   * Vertical Zoom
125   *
126   * @type { ?number }
127   * @syscap SystemCapability.ArkUI.ArkUI.Full
128   * @since 9
129   * @form
130   */
131  /**
132   * Vertical Zoom
133   *
134   * @type { ?number }
135   * @syscap SystemCapability.ArkUI.ArkUI.Full
136   * @crossplatform
137   * @since 10
138   * @form
139   */
140  scaleY?: number;
141
142  /**
143   * Horizontal movement
144   *
145   * @type { ?number }
146   * @syscap SystemCapability.ArkUI.ArkUI.Full
147   * @since 8
148   */
149  /**
150   * Horizontal movement
151   *
152   * @type { ?number }
153   * @syscap SystemCapability.ArkUI.ArkUI.Full
154   * @since 9
155   * @form
156   */
157  /**
158   * Horizontal movement
159   *
160   * @type { ?number }
161   * @syscap SystemCapability.ArkUI.ArkUI.Full
162   * @crossplatform
163   * @since 10
164   * @form
165   */
166  translateX?: number;
167
168  /**
169   * Vertical movement
170   *
171   * @type { ?number }
172   * @syscap SystemCapability.ArkUI.ArkUI.Full
173   * @since 8
174   */
175  /**
176   * Vertical movement
177   *
178   * @type { ?number }
179   * @syscap SystemCapability.ArkUI.ArkUI.Full
180   * @since 9
181   * @form
182   */
183  /**
184   * Vertical movement
185   *
186   * @type { ?number }
187   * @syscap SystemCapability.ArkUI.ArkUI.Full
188   * @crossplatform
189   * @since 10
190   * @form
191   */
192  translateY?: number;
193
194  /**
195   * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
196   * translation scaling effect)
197   *
198   * @returns { Matrix2D }
199   * @syscap SystemCapability.ArkUI.ArkUI.Full
200   * @since 8
201   */
202  /**
203   * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
204   * translation scaling effect)
205   *
206   * @returns { Matrix2D }
207   * @syscap SystemCapability.ArkUI.ArkUI.Full
208   * @since 9
209   * @form
210   */
211  /**
212   * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
213   * translation scaling effect)
214   *
215   * @returns { Matrix2D }
216   * @syscap SystemCapability.ArkUI.ArkUI.Full
217   * @crossplatform
218   * @since 10
219   * @form
220   */
221  identity(): Matrix2D;
222
223  /**
224   * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
225   * is the opposite effect of the original)
226   *
227   * @returns { Matrix2D }
228   * @syscap SystemCapability.ArkUI.ArkUI.Full
229   * @since 8
230   */
231  /**
232   * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
233   * is the opposite effect of the original)
234   *
235   * @returns { Matrix2D }
236   * @syscap SystemCapability.ArkUI.ArkUI.Full
237   * @since 9
238   * @form
239   */
240  /**
241   * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
242   * is the opposite effect of the original)
243   *
244   * @returns { Matrix2D }
245   * @syscap SystemCapability.ArkUI.ArkUI.Full
246   * @crossplatform
247   * @since 10
248   * @form
249   */
250  invert(): Matrix2D;
251
252  /**
253   * The matrix is superimposed in right multiplication mode. When the input parameter is empty,
254   * the matrix is superimposed.
255   *
256   * @param { Matrix2D } other - Matrix to be superimposed
257   * @returns { Matrix2D }
258   * @syscap SystemCapability.ArkUI.ArkUI.Full
259   * @since 8
260   */
261  /**
262   * The matrix is superimposed in right multiplication mode. When the input parameter is empty,
263   * the matrix is superimposed.
264   *
265   * @param { Matrix2D } other - Matrix to be superimposed
266   * @returns { Matrix2D }
267   * @syscap SystemCapability.ArkUI.ArkUI.Full
268   * @since 9
269   * @deprecated since 10
270   * @form
271   */
272  multiply(other?: Matrix2D): Matrix2D;
273
274  /**
275   * Adds the rotation effect of the X and Y axes to the current matrix.
276   *
277   * @param { number } rx - Rotation effect of the X-axis
278   * @param { number } ry - Rotation effect of the Y-axis
279   * @returns { Matrix2D }
280   * @syscap SystemCapability.ArkUI.ArkUI.Full
281   * @since 8
282   */
283  /**
284   * Adds the rotation effect of the X and Y axes to the current matrix.
285   *
286   * @param { number } rx - Rotation effect of the X-axis
287   * @param { number } ry - Rotation effect of the Y-axis
288   * @returns { Matrix2D }
289   * @syscap SystemCapability.ArkUI.ArkUI.Full
290   * @since 9
291   * @deprecated since 10
292   * @useinstead rotate
293   * @form
294   */
295  rotate(rx?: number, ry?: number): Matrix2D;
296
297  /**
298   * Adds the rotation effect of the X and Y axes to the current matrix.
299   *
300   * @param { number } degree - The rotation angle, clockwise in radians.
301   * @param { number } rx - Rotation effect of the X-axis
302   * @param { number } ry - Rotation effect of the Y-axis
303   * @returns { Matrix2D }
304   * @syscap SystemCapability.ArkUI.ArkUI.Full
305   * @crossplatform
306   * @since 10
307   * @form
308   */
309  rotate(degree: number, rx?: number, ry?: number): Matrix2D;
310
311  /**
312   * Adds the translation effect of the X and Y axes to the current matrix.
313   *
314   * @param { number } tx - X-axis translation effect
315   * @param { number } ty - Y-axis translation effect
316   * @returns { Matrix2D }
317   * @syscap SystemCapability.ArkUI.ArkUI.Full
318   * @since 8
319   */
320  /**
321   * Adds the translation effect of the X and Y axes to the current matrix.
322   *
323   * @param { number } tx - X-axis translation effect
324   * @param { number } ty - Y-axis translation effect
325   * @returns { Matrix2D }
326   * @syscap SystemCapability.ArkUI.ArkUI.Full
327   * @since 9
328   * @form
329   */
330  /**
331   * Adds the translation effect of the X and Y axes to the current matrix.
332   *
333   * @param { number } tx - X-axis translation effect
334   * @param { number } ty - Y-axis translation effect
335   * @returns { Matrix2D }
336   * @syscap SystemCapability.ArkUI.ArkUI.Full
337   * @crossplatform
338   * @since 10
339   * @form
340   */
341  translate(tx?: number, ty?: number): Matrix2D;
342
343  /**
344   * Adds the scaling effect of the X and Y axes to the current matrix.
345   *
346   * @param { number } sx - X-axis scaling effect
347   * @param { number } sy - Y-axis scaling effect
348   * @returns { Matrix2D }
349   * @syscap SystemCapability.ArkUI.ArkUI.Full
350   * @since 8
351   */
352  /**
353   * Adds the scaling effect of the X and Y axes to the current matrix.
354   *
355   * @param { number } sx - X-axis scaling effect
356   * @param { number } sy - Y-axis scaling effect
357   * @returns { Matrix2D }
358   * @syscap SystemCapability.ArkUI.ArkUI.Full
359   * @since 9
360   * @form
361   */
362  /**
363   * Adds the scaling effect of the X and Y axes to the current matrix.
364   *
365   * @param { number } sx - X-axis scaling effect
366   * @param { number } sy - Y-axis scaling effect
367   * @returns { Matrix2D }
368   * @syscap SystemCapability.ArkUI.ArkUI.Full
369   * @crossplatform
370   * @since 10
371   * @form
372   */
373  scale(sx?: number, sy?: number): Matrix2D;
374
375  /**
376   * Constructs a 2D change matrix object. The default value is the unit matrix.
377   *
378   * @syscap SystemCapability.ArkUI.ArkUI.Full
379   * @crossplatform
380   * @since 10
381   * @form
382   */
383  constructor();
384}
385