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 ArkGraphics2D 19 */ 20/** 21 * The date structure that provides the basis for graphics. 22 * 23 * @namespace common2D 24 * @syscap SystemCapability.Graphics.Drawing 25 * @since 11 26 */ 27namespace common2D { 28 /** 29 * Provide a description in the form of color ARGB. 30 * @typedef Color 31 * @syscap SystemCapability.Graphics.Drawing 32 * @since 11 33 */ 34 export interface Color { 35 /** 36 * Alpha component of color, from 0 to 255. 37 * @type { number } 38 * @syscap SystemCapability.Graphics.Drawing 39 * @since 11 40 */ 41 alpha: number; 42 /** 43 * Red component of color, from 0 to 255. 44 * @type { number } 45 * @syscap SystemCapability.Graphics.Drawing 46 * @since 11 47 */ 48 red: number; 49 /** 50 * Green component of color, from 0 to 255. 51 * @type { number } 52 * @syscap SystemCapability.Graphics.Drawing 53 * @since 11 54 */ 55 green: number; 56 /** 57 * Blue component of color, from 0 to 255. 58 * @type { number } 59 * @syscap SystemCapability.Graphics.Drawing 60 * @since 11 61 */ 62 blue: number; 63 } 64 65 /** 66 * Provides the definition of the rectangle. 67 * @typedef Rect 68 * @syscap SystemCapability.Graphics.Drawing 69 * @since 11 70 */ 71 export interface Rect { 72 /** 73 * Left Position of Rectangle. 74 * @type { number } 75 * @syscap SystemCapability.Graphics.Drawing 76 * @since 11 77 */ 78 left: number; 79 /** 80 * Top side position of the rectangle 81 * @type { number } 82 * @syscap SystemCapability.Graphics.Drawing 83 * @since 11 84 */ 85 top: number; 86 /** 87 * Right Position of Rectangle. 88 * @type { number } 89 * @syscap SystemCapability.Graphics.Drawing 90 * @since 11 91 */ 92 right: number; 93 /** 94 * Position of the bottom side of the rectangle. 95 * @type { number } 96 * @syscap SystemCapability.Graphics.Drawing 97 * @since 11 98 */ 99 bottom: number; 100 } 101 102 /** 103 * Coordinates in the font layout. 104 * @typedef Point 105 * @syscap SystemCapability.Graphics.Drawing 106 * @since 12 107 */ 108 export interface Point { 109 /** 110 * X-axis coordinate. 111 * @type { number } 112 * @syscap SystemCapability.Graphics.Drawing 113 * @since 12 114 */ 115 x: number; 116 117 /** 118 * Y-axis coordinate. 119 * @type { number } 120 * @syscap SystemCapability.Graphics.Drawing 121 * @since 12 122 */ 123 y: number; 124 } 125 126 /** 127 * Provides the definition of the point in 3D. 128 * 129 * @typedef Point3d 130 * @extends Point 131 * @syscap SystemCapability.Graphics.Drawing 132 * @since 12 133 */ 134 export interface Point3d extends Point { 135 /** 136 * Z-axis coordinate. 137 * @type { number } 138 * @syscap SystemCapability.Graphics.Drawing 139 * @since 12 140 */ 141 z: number; 142 } 143 144} 145 146export default common2D;