• 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 * @file
18 * @kit ArkUI
19 */
20
21/*** if arkts 1.2 */
22import { LengthMetricsUnit } from '../Graphics';
23/*** endif */
24
25/**
26 * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
27 *
28 * @syscap SystemCapability.ArkUI.ArkUI.Full
29 * @since 8
30 */
31/**
32 * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
33 *
34 * @syscap SystemCapability.ArkUI.ArkUI.Full
35 * @form
36 * @since 9
37 */
38/**
39 * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
40 *
41 * @syscap SystemCapability.ArkUI.ArkUI.Full
42 * @crossplatform
43 * @form
44 * @since 10
45 */
46/**
47 * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
48 *
49 * @syscap SystemCapability.ArkUI.ArkUI.Full
50 * @crossplatform
51 * @form
52 * @atomicservice
53 * @since arkts {'1.1':'11','1.2':'20'}
54 * @arkts 1.1&1.2
55 */
56declare class Matrix2D {
57  /**
58   * Horizontal Zoom
59   *
60   * @type { ?number }
61   * @syscap SystemCapability.ArkUI.ArkUI.Full
62   * @since 8
63   */
64  /**
65   * Horizontal Zoom
66   *
67   * @type { ?number }
68   * @syscap SystemCapability.ArkUI.ArkUI.Full
69   * @form
70   * @since 9
71   */
72  /**
73   * Horizontal Zoom
74   *
75   * @type { ?number }
76   * @syscap SystemCapability.ArkUI.ArkUI.Full
77   * @crossplatform
78   * @form
79   * @since 10
80   */
81  /**
82   * Horizontal Zoom
83   *
84   * @type { ?number }
85   * @syscap SystemCapability.ArkUI.ArkUI.Full
86   * @crossplatform
87   * @form
88   * @atomicservice
89   * @since arkts {'1.1':'11','1.2':'20'}
90   * @arkts 1.1&1.2
91   */
92  scaleX?: number;
93
94  /**
95   * Vertical Tilt
96   *
97   * @type { ?number }
98   * @syscap SystemCapability.ArkUI.ArkUI.Full
99   * @since 8
100   */
101  /**
102   * Vertical Tilt
103   *
104   * @type { ?number }
105   * @syscap SystemCapability.ArkUI.ArkUI.Full
106   * @form
107   * @since 9
108   */
109  /**
110   * Vertical Tilt
111   *
112   * @type { ?number }
113   * @syscap SystemCapability.ArkUI.ArkUI.Full
114   * @crossplatform
115   * @form
116   * @since 10
117   */
118  /**
119   * Vertical Tilt
120   *
121   * @type { ?number }
122   * @syscap SystemCapability.ArkUI.ArkUI.Full
123   * @crossplatform
124   * @form
125   * @atomicservice
126   * @since arkts {'1.1':'11','1.2':'20'}
127   * @arkts 1.1&1.2
128   */
129  rotateY?: number;
130
131  /**
132   * Horizontal Tilt
133   *
134   * @type { ?number }
135   * @syscap SystemCapability.ArkUI.ArkUI.Full
136   * @since 8
137   */
138  /**
139   * Horizontal Tilt
140   *
141   * @type { ?number }
142   * @syscap SystemCapability.ArkUI.ArkUI.Full
143   * @form
144   * @since 9
145   */
146  /**
147   * Horizontal Tilt
148   *
149   * @type { ?number }
150   * @syscap SystemCapability.ArkUI.ArkUI.Full
151   * @crossplatform
152   * @form
153   * @since 10
154   */
155  /**
156   * Horizontal Tilt
157   *
158   * @type { ?number }
159   * @syscap SystemCapability.ArkUI.ArkUI.Full
160   * @crossplatform
161   * @form
162   * @atomicservice
163   * @since arkts {'1.1':'11','1.2':'20'}
164   * @arkts 1.1&1.2
165   */
166  rotateX?: number;
167
168  /**
169   * Vertical Zoom
170   *
171   * @type { ?number }
172   * @syscap SystemCapability.ArkUI.ArkUI.Full
173   * @since 8
174   */
175  /**
176   * Vertical Zoom
177   *
178   * @type { ?number }
179   * @syscap SystemCapability.ArkUI.ArkUI.Full
180   * @form
181   * @since 9
182   */
183  /**
184   * Vertical Zoom
185   *
186   * @type { ?number }
187   * @syscap SystemCapability.ArkUI.ArkUI.Full
188   * @crossplatform
189   * @form
190   * @since 10
191   */
192  /**
193   * Vertical Zoom
194   *
195   * @type { ?number }
196   * @syscap SystemCapability.ArkUI.ArkUI.Full
197   * @crossplatform
198   * @form
199   * @atomicservice
200   * @since arkts {'1.1':'11','1.2':'20'}
201   * @arkts 1.1&1.2
202   */
203  scaleY?: number;
204
205  /**
206   * Horizontal movement
207   *
208   * @type { ?number }
209   * @syscap SystemCapability.ArkUI.ArkUI.Full
210   * @since 8
211   */
212  /**
213   * Horizontal movement
214   *
215   * @type { ?number }
216   * @syscap SystemCapability.ArkUI.ArkUI.Full
217   * @form
218   * @since 9
219   */
220  /**
221   * Horizontal movement
222   *
223   * @type { ?number }
224   * @syscap SystemCapability.ArkUI.ArkUI.Full
225   * @crossplatform
226   * @form
227   * @since 10
228   */
229  /**
230   * Horizontal movement
231   *
232   * @type { ?number }
233   * @syscap SystemCapability.ArkUI.ArkUI.Full
234   * @crossplatform
235   * @form
236   * @atomicservice
237   * @since arkts {'1.1':'11','1.2':'20'}
238   * @arkts 1.1&1.2
239   */
240  translateX?: number;
241
242  /**
243   * Vertical movement
244   *
245   * @type { ?number }
246   * @syscap SystemCapability.ArkUI.ArkUI.Full
247   * @since 8
248   */
249  /**
250   * Vertical movement
251   *
252   * @type { ?number }
253   * @syscap SystemCapability.ArkUI.ArkUI.Full
254   * @form
255   * @since 9
256   */
257  /**
258   * Vertical movement
259   *
260   * @type { ?number }
261   * @syscap SystemCapability.ArkUI.ArkUI.Full
262   * @crossplatform
263   * @form
264   * @since 10
265   */
266  /**
267   * Vertical movement
268   *
269   * @type { ?number }
270   * @syscap SystemCapability.ArkUI.ArkUI.Full
271   * @crossplatform
272   * @form
273   * @atomicservice
274   * @since arkts {'1.1':'11','1.2':'20'}
275   * @arkts 1.1&1.2
276   */
277  translateY?: number;
278
279  /**
280   * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
281   * translation scaling effect)
282   *
283   * @returns { Matrix2D }
284   * @syscap SystemCapability.ArkUI.ArkUI.Full
285   * @since 8
286   */
287  /**
288   * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
289   * translation scaling effect)
290   *
291   * @returns { Matrix2D }
292   * @syscap SystemCapability.ArkUI.ArkUI.Full
293   * @form
294   * @since 9
295   */
296  /**
297   * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
298   * translation scaling effect)
299   *
300   * @returns { Matrix2D }
301   * @syscap SystemCapability.ArkUI.ArkUI.Full
302   * @crossplatform
303   * @form
304   * @since 10
305   */
306  /**
307   * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
308   * translation scaling effect)
309   *
310   * @returns { Matrix2D }
311   * @syscap SystemCapability.ArkUI.ArkUI.Full
312   * @crossplatform
313   * @form
314   * @atomicservice
315   * @since arkts {'1.1':'11','1.2':'20'}
316   * @arkts 1.1&1.2
317   */
318  identity(): Matrix2D;
319
320  /**
321   * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
322   * is the opposite effect of the original)
323   *
324   * @returns { Matrix2D }
325   * @syscap SystemCapability.ArkUI.ArkUI.Full
326   * @since 8
327   */
328  /**
329   * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
330   * is the opposite effect of the original)
331   *
332   * @returns { Matrix2D }
333   * @syscap SystemCapability.ArkUI.ArkUI.Full
334   * @form
335   * @since 9
336   */
337  /**
338   * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
339   * is the opposite effect of the original)
340   *
341   * @returns { Matrix2D }
342   * @syscap SystemCapability.ArkUI.ArkUI.Full
343   * @crossplatform
344   * @form
345   * @since 10
346   */
347  /**
348   * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
349   * is the opposite effect of the original)
350   *
351   * @returns { Matrix2D }
352   * @syscap SystemCapability.ArkUI.ArkUI.Full
353   * @crossplatform
354   * @form
355   * @atomicservice
356   * @since arkts {'1.1':'11','1.2':'20'}
357   * @arkts 1.1&1.2
358   */
359  invert(): Matrix2D;
360
361  /**
362   * The matrix is superimposed in right multiplication mode. When the input parameter is empty,
363   * the matrix is superimposed.
364   *
365   * @param { Matrix2D } other - Matrix to be superimposed
366   * @returns { Matrix2D }
367   * @syscap SystemCapability.ArkUI.ArkUI.Full
368   * @since 8
369   */
370  /**
371   * The matrix is superimposed in right multiplication mode. When the input parameter is empty,
372   * the matrix is superimposed.
373   *
374   * @param { Matrix2D } other - Matrix to be superimposed
375   * @returns { Matrix2D }
376   * @syscap SystemCapability.ArkUI.ArkUI.Full
377   * @form
378   * @since 9
379   * @deprecated since 10
380   */
381  multiply(other?: Matrix2D): Matrix2D;
382
383  /**
384   * Adds the rotation effect of the X and Y axes to the current matrix.
385   *
386   * @param { number } rx - Rotation effect of the X-axis
387   * @param { number } ry - Rotation effect of the Y-axis
388   * @returns { Matrix2D }
389   * @syscap SystemCapability.ArkUI.ArkUI.Full
390   * @since 8
391   */
392  /**
393   * Adds the rotation effect of the X and Y axes to the current matrix.
394   *
395   * @param { number } rx - Rotation effect of the X-axis
396   * @param { number } ry - Rotation effect of the Y-axis
397   * @returns { Matrix2D }
398   * @syscap SystemCapability.ArkUI.ArkUI.Full
399   * @form
400   * @since 9
401   * @deprecated since 10
402   * @useinstead rotate
403   */
404  rotate(rx?: number, ry?: number): Matrix2D;
405
406  /**
407   * Adds the rotation effect of the X and Y axes to the current matrix.
408   *
409   * @param { number } degree - The rotation angle, clockwise in radians.
410   * @param { number } rx - Rotation effect of the X-axis
411   * @param { number } ry - Rotation effect of the Y-axis
412   * @returns { Matrix2D }
413   * @syscap SystemCapability.ArkUI.ArkUI.Full
414   * @crossplatform
415   * @form
416   * @since 10
417   */
418  /**
419   * Adds the rotation effect of the X and Y axes to the current matrix.
420   *
421   * @param { number } degree - The rotation angle, clockwise in radians.
422   * @param { number } rx - Rotation effect of the X-axis
423   * @param { number } ry - Rotation effect of the Y-axis
424   * @returns { Matrix2D }
425   * @syscap SystemCapability.ArkUI.ArkUI.Full
426   * @crossplatform
427   * @form
428   * @atomicservice
429   * @since arkts {'1.1':'11','1.2':'20'}
430   * @arkts 1.1&1.2
431   */
432  rotate(degree: number, rx?: number, ry?: number): Matrix2D;
433
434  /**
435   * Adds the translation effect of the X and Y axes to the current matrix.
436   *
437   * @param { number } tx - X-axis translation effect
438   * @param { number } ty - Y-axis translation effect
439   * @returns { Matrix2D }
440   * @syscap SystemCapability.ArkUI.ArkUI.Full
441   * @since 8
442   */
443  /**
444   * Adds the translation effect of the X and Y axes to the current matrix.
445   *
446   * @param { number } tx - X-axis translation effect
447   * @param { number } ty - Y-axis translation effect
448   * @returns { Matrix2D }
449   * @syscap SystemCapability.ArkUI.ArkUI.Full
450   * @form
451   * @since 9
452   */
453  /**
454   * Adds the translation effect of the X and Y axes to the current matrix.
455   *
456   * @param { number } tx - X-axis translation effect
457   * @param { number } ty - Y-axis translation effect
458   * @returns { Matrix2D }
459   * @syscap SystemCapability.ArkUI.ArkUI.Full
460   * @crossplatform
461   * @form
462   * @since 10
463   */
464  /**
465   * Adds the translation effect of the X and Y axes to the current matrix.
466   *
467   * @param { number } tx - X-axis translation effect
468   * @param { number } ty - Y-axis translation effect
469   * @returns { Matrix2D }
470   * @syscap SystemCapability.ArkUI.ArkUI.Full
471   * @crossplatform
472   * @form
473   * @atomicservice
474   * @since arkts {'1.1':'11','1.2':'20'}
475   * @arkts 1.1&1.2
476   */
477  translate(tx?: number, ty?: number): Matrix2D;
478
479  /**
480   * Adds the scaling effect of the X and Y axes to the current matrix.
481   *
482   * @param { number } sx - X-axis scaling effect
483   * @param { number } sy - Y-axis scaling effect
484   * @returns { Matrix2D }
485   * @syscap SystemCapability.ArkUI.ArkUI.Full
486   * @since 8
487   */
488  /**
489   * Adds the scaling effect of the X and Y axes to the current matrix.
490   *
491   * @param { number } sx - X-axis scaling effect
492   * @param { number } sy - Y-axis scaling effect
493   * @returns { Matrix2D }
494   * @syscap SystemCapability.ArkUI.ArkUI.Full
495   * @form
496   * @since 9
497   */
498  /**
499   * Adds the scaling effect of the X and Y axes to the current matrix.
500   *
501   * @param { number } sx - X-axis scaling effect
502   * @param { number } sy - Y-axis scaling effect
503   * @returns { Matrix2D }
504   * @syscap SystemCapability.ArkUI.ArkUI.Full
505   * @crossplatform
506   * @form
507   * @since 10
508   */
509  /**
510   * Adds the scaling effect of the X and Y axes to the current matrix.
511   *
512   * @param { number } sx - X-axis scaling effect
513   * @param { number } sy - Y-axis scaling effect
514   * @returns { Matrix2D }
515   * @syscap SystemCapability.ArkUI.ArkUI.Full
516   * @crossplatform
517   * @form
518   * @atomicservice
519   * @since arkts {'1.1':'11','1.2':'20'}
520   * @arkts 1.1&1.2
521   */
522  scale(sx?: number, sy?: number): Matrix2D;
523
524  /**
525   * Constructs a 2D change matrix object. The default value is the unit matrix.
526   *
527   * @syscap SystemCapability.ArkUI.ArkUI.Full
528   * @crossplatform
529   * @form
530   * @since 10
531   */
532  /**
533   * Constructs a 2D change matrix object. The default value is the unit matrix.
534   *
535   * @syscap SystemCapability.ArkUI.ArkUI.Full
536   * @crossplatform
537   * @form
538   * @atomicservice
539   * @since arkts {'1.1':'11','1.2':'20'}
540   * @arkts 1.1&1.2
541   */
542  constructor();
543
544  /**
545   * Constructs a 2D change matrix object. The default value is the unit matrix.
546   *
547   * @param { LengthMetricsUnit } unit - the unit mode
548   * @syscap SystemCapability.ArkUI.ArkUI.Full
549   * @crossplatform
550   * @form
551   * @atomicservice
552   * @since arkts {'1.1':'12','1.2':'20'}
553   * @arkts 1.1&1.2
554   */
555  constructor(unit: LengthMetricsUnit);
556}
557