1# display_vgu.h 2 3 4## 概述 5 6该文件定义2D矢量硬件加速模块相关驱动函数。 7 8**Since:** 9 103.0 11 12**相关模块:** 13 14[Display](_display.md) 15 16 17## 汇总 18 19 20### 类 21 22 | 名称 | 描述 | 23| -------- | -------- | 24| [VGUPoint](_v_g_u_point.md) | struct<br/>坐标点对象。 | 25| [VGURect](_v_g_u_rect.md) | struct<br/>矩形对象。 | 26| [VGUPath](_v_g_u_path.md) | struct<br/>路径对象,存放路径命令和坐标数据。 | 27| [VGUMatrix3](_v_g_u_matrix3.md) | struct<br/>变换矩阵。 | 28| [VGUBuffer](_v_g_u_buffer.md) | struct<br/>硬件加速渲染位图缓存。 | 29| [VGUMaskLayer](_v_g_u_mask_layer.md) | struct<br/>定义蒙版图层。 | 30| [VGUSurface](_v_g_u_surface.md) | struct<br/>2D硬件加速绘制目标表面。 | 31| [VGUColorStop](_v_g_u_color_stop.md) | struct<br/>渐变颜色分布位置。 | 32| [VGULinear](_v_g_u_linear.md) | struct<br/>线性渐变。 | 33| [VGURadial](_v_g_u_radial.md) | struct<br/>辐射渐变。 | 34| [VGUConic](_v_g_u_conic.md) | struct<br/>圆锥渐变。 | 35| [VGUImage](_v_g_u_image.md) | struct<br/>图像对象。 | 36| [VGUPattern](_v_g_u_pattern.md) | struct<br/>图片模式对象。 | 37| [VGUGradient](_v_g_u_gradient.md) | struct<br/>渐变对象。 | 38| [VGUSolid](_v_g_u_solid.md) | struct<br/>颜色对象 | 39| [VGUPaintStyle](_v_g_u_paint_style.md) | struct<br/>填充或描边路径的渲染风格。 | 40| [VGUFillAttr](_v_g_u_fill_attr.md) | struct<br/>填充路径的属性。 | 41| [VGUStrokeAttr](_v_g_u_stroke_attr.md) | struct<br/>描边路径的属性。 | 42| [VGUFuncs](_v_g_u_funcs.md) | struct<br/>定义2D硬件加速驱动函数。 | 43 44 45### 宏定义 46 47 | 名称 | 描述 | 48| -------- | -------- | 49| [HDI_VGU_SCALAR_IS_FLOAT](_display.md#hdi_vgu_scalar_is_float) 1 | VGU标量是否为浮点型。 | 50 51 52### 类型定义 53 54 | 名称 | 描述 | 55| -------- | -------- | 56| [VGUScalar](_display.md#vguscalar) | typedef float<br/>VGU标量 | 57| [VGUPixelFormat](_display.md#vgupixelformat) | typedef [PixelFormat](_display.md#pixelformat)<br/>像素格式 | 58| [VGUBlendType](_display.md#vgublendtype) | typedef [BlendType](_display.md#blendtype)<br/>混合操作类型 | 59 60 61### 枚举 62 63 | 名称 | 描述 | 64| -------- | -------- | 65| [VGUPathDataType](_display.md#vgupathdatatype) { VGU_DATA_TYPE_S16 = 0, VGU_DATA_TYPE_S32, VGU_DATA_TYPE_F32 } | 路径坐标数据类型。 | 66| [VGUCapability](_display.md#vgucapability) { VGU_CAP_BLIT = (1 << 0), VGU_CAP_BLIT_NUM = (1 << 1), VGU_CAP_PATH = (1 << 2), VGU_CAP_FILTER_BLUR = (1 << 3) } | 硬件加速能力。 | 67| [VGUResult](_display.md#vguresult) { VGU_SUCCESS = 0, VGU_NO_SUPPORT = -1, VGU_OPERATION_FAILED = -2, VGU_OUT_OF_MEMORY = -3, VGU_TIMEOUT = -4, VGU_INVALID_PARAMETER = -5, VGU_BUSY = -6, VGU_NO_CONTEXT = -7 } | 错误码定义。 | 68| [VGULineCap](_display.md#vgulinecap) { VGU_LINECAP_BUTT = 0, VGU_LINECAP_ROUND, VGU_LINECAP_SQUARE } | 线帽。 | 69| [VGUJointType](_display.md#vgujointtype) { VGU_LINE_JOIN_MITER = 0, VGU_LINE_JOIN_ROUND, VGU_LINE_JOIN_BEVEL, VGU_LINE_JOIN_BUTT } | 联接类型。 | 70| [VGUFilter](_display.md#vgufilter) { VGU_FILTER_BILINEAR = 0, VGU_FILTER_NEAREST, VGU_FILTER_LINEAR, VGU_FILTER_BUTT } | 图像滤波类型。 | 71| [VGUFillRule](_display.md#vgufillrule) { VGU_RULE_WINDING = 0, VGU_RULE_EVEN_ODD, VGU_RULE_BUTT } | 填充规则定义。 | 72| [VGUFillSpread](_display.md#vgufillspread) { VGU_SPREAD_PAD = 0, VGU_SPREAD_REFLECT, VGU_SPREAD_REPEAT, VGU_SPREAD_BUTT } | 渐变填充区域外的延展类型。 | 73| [VGUWrapType](_display.md#vguwraptype) { VGU_WRAP_REFLECT = 0, VGU_WRAP_REPEAT, VGU_WRAP_BUTT } | 图像模式填充延展类型。 | 74| [VGUPathCmd](_display.md#vgupathcmd) { VGU_PATH_CMD_CLOSE = 0, VGU_PATH_CMD_MOVE, VGU_PATH_CMD_LINE, VGU_PATH_CMD_HLINE, VGU_PATH_CMD_VLINE, VGU_PATH_CMD_QUAD, VGU_PATH_CMD_CUBIC, VGU_PATH_CMD_SQUAD, VGU_PATH_CMD_SCUBIC, VGU_PATH_CMD_BUTT } | 路径绘制指令类型。 | 75| [VGUTransformType](_display.md#vgutransformtype) { VGU_TRANSFORM_TRANSLATE = (1 << 0), VGU_TRANSFORM_SCALE = (1 << 1), VGU_TRANSFORM_ROTATE_90 = (1 << 2), VGU_TRANSFORM_ROTATE_180 = (1 << 3), VGU_TRANSFORM_ROTATE_270 = (1 << 4), VGU_TRANSFORM_OTHER = (1 << 16) } | 变换类型。 | 76| [VGUClipType](_display.md#vgucliptype) { VGU_CLIP_RECT = 0, VGU_CLIP_PATH, VGU_CLIP_BUTT } | 绘制表面剪切类型。 | 77| [VGUGradientType](_display.md#vgugradienttype) { VGU_GRADIENT_LINEAR = 0, VGU_GRADIENT_RADIAL, VGU_GRADIENT_CONIC, VGU_GRADIENT_BUTT } | 渐变类型。 | 78| [VGUPaintType](_display.md#vgupainttype) { VGU_PAINT_SOLID = 0, VGU_PAINT_GRADIENT, VGU_PAINT_PATTERN, VGU_PAINT_BUTT } | 渲染对象 | 79 80 81### 函数 82 83 | 名称 | 描述 | 84| -------- | -------- | 85| [VGUPathInit](_display.md#vgupathinit) ([VGUPath](_v_g_u_path.md) \*path, [VGUPathDataType](_display.md#vgupathdatatype) type, const uint8_t \*segments, int numSegments, const uint8_t \*data, bool enAlias, [VGURect](_v_g_u_rect.md) boundBox) | [VGUResult](_display.md#vguresult)<br/>初始化路径对象。 | 86| [VGUPathAppend](_display.md#vgupathappend) ([VGUPath](_v_g_u_path.md) \*path, const [VGUPath](_v_g_u_path.md) \*subpath) | [VGUResult](_display.md#vguresult)<br/>添加子路径到当前路径中。 | 87| [VGUPathClear](_display.md#vgupathclear) ([VGUPath](_v_g_u_path.md) \*path) | [VGUResult](_display.md#vguresult)<br/>清除路径对象内存。 | 88| [VGUMatrixIdentity](_display.md#vgumatrixidentity) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix) | [VGUResult](_display.md#vguresult)<br/>初始化矩阵对象为单位矩阵。 | 89| [VGUMatrixScale](_display.md#vgumatrixscale) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix, float xScale, float yScale) | [VGUResult](_display.md#vguresult)<br/>矩阵变换缩放。 | 90| [VGUMatrixRotate](_display.md#vgumatrixrotate) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix, float degree) | [VGUResult](_display.md#vguresult)<br/>矩阵变换旋转。 | 91| [VGUMatrixTranslate](_display.md#vgumatrixtranslate) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix, float x, float y) | [VGUResult](_display.md#vguresult)<br/>矩阵变换平移。 | 92| [VGUGradientColorStop](_display.md#vgugradientcolorstop) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUColorStop](_v_g_u_color_stop.md) \*colorStop, uint32_t count) | [VGUResult](_display.md#vguresult)<br/>对渐变添加ColorStop。 | 93| [VGUGradientClearStop](_display.md#vgugradientclearstop) ([VGUGradient](_v_g_u_gradient.md) \*gradient) | [VGUResult](_display.md#vguresult)<br/>清除ColorStop。 | 94| [VGUGradientMatrix](_display.md#vgugradientmatrix) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUMatrix3](_v_g_u_matrix3.md) \*matrix) | [VGUResult](_display.md#vguresult)<br/>设置渐变对象的变换矩阵。 | 95| [VGUGradientLinear](_display.md#vgugradientlinear) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUPoint](_v_g_u_point.md) \*p1, const [VGUPoint](_v_g_u_point.md) \*p2) | [VGUResult](_display.md#vguresult)<br/>创建线性渐变对象。 | 96| [VGUGradientRadial](_display.md#vgugradientradial) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUPoint](_v_g_u_point.md) \*p1, [VGUScalar](_display.md#vguscalar) r1, const [VGUPoint](_v_g_u_point.md) \*p2, [VGUScalar](_display.md#vguscalar) r2) | [VGUResult](_display.md#vguresult)<br/>创建辐射渐变对象 | 97| [VGUGradientConic](_display.md#vgugradientconic) ([VGUGradient](_v_g_u_gradient.md) \*gradient, [VGUScalar](_display.md#vguscalar) cx, [VGUScalar](_display.md#vguscalar) cy) | [VGUResult](_display.md#vguresult)<br/>创建圆锥渐变对象。 | 98| [VGUInitialize](_display.md#vguinitialize) ([VGUFuncs](_v_g_u_funcs.md) \*\*funcs) | [VGUResult](_display.md#vguresult)<br/>获取硬件加速相关的操作接口指针。 | 99| [VGUUninitialize](_display.md#vguuninitialize) ([VGUFuncs](_v_g_u_funcs.md) \*funcs) | [VGUResult](_display.md#vguresult)<br/>去初始化硬件加速模块,同时释放硬件加速模块操作函数指针。 | 100