1# GfxFuncs 2 3 4## 概述 5 6显示硬件加速驱动接口结构体,定义硬件加速驱动接口函数指针。 7 8**相关模块:** 9 10[Display](_display.md) 11 12 13## 汇总 14 15 16### Public 属性 17 18 | 名称 | 描述 | 19| -------- | -------- | 20| (\* [InitGfx](#initgfx) )(void) | int32_t<br/>初始化硬件加速。 | 21| (\* [DeinitGfx](#deinitgfx) )(void) | int32_t<br/>去初始化硬件加速。 | 22| (\* [FillRect](#fillrect) )([ISurface](_i_surface.md) \*surface, [IRect](_i_rect.md) \*rect, uint32_t color, [GfxOpt](_gfx_opt.md) \*opt) | int32_t<br/>填充矩形,用一种颜色填充画布上指定矩形区域的矩形框。 | 23| (\* [DrawRectangle](#drawrectangle) )([ISurface](_i_surface.md) \*surface, [Rectangle](_rectangle.md) \*rect, uint32_t color, [GfxOpt](_gfx_opt.md) \*opt) | int32_t<br/>绘制矩形框,用一种颜色在画布上绘制指定区域的矩形框。 | 24| (\* [DrawLine](#drawline) )([ISurface](_i_surface.md) \*surface, [ILine](_i_line.md) \*line, [GfxOpt](_gfx_opt.md) \*opt) | int32_t<br/>绘制直线,使用一种颜色在画布上绘制一条直线。 | 25| (\* [DrawCircle](#drawcircle) )([ISurface](_i_surface.md) \*surface, [ICircle](_i_circle.md) \*circle, [GfxOpt](_gfx_opt.md) \*opt) | int32_t<br/>绘制圆形,使用一种颜色在画布上绘制指定圆心和半径的圆。 | 26| (\* [Blit](#blit) )([ISurface](_i_surface.md) \*srcSurface, [IRect](_i_rect.md) \*srcRect, [ISurface](_i_surface.md) \*dstSurface, [IRect](_i_rect.md) \*dstRect, [GfxOpt](_gfx_opt.md) \*opt) | int32_t<br/>位图搬移 | 27| (\* [Sync](#sync) )(int32_t timeOut) | int32_t<br/>硬件加速同步。 | 28 29 30## 类成员变量说明 31 32 33### Blit 34 35 36``` 37int32_t(* GfxFuncs::Blit) (ISurface *srcSurface, IRect *srcRect, ISurface *dstSurface, IRect *dstRect, GfxOpt *opt) 38``` 39 40**描述:** 41 42位图搬移 43 44在位图搬移过程中,可以实现色彩空间转换、缩放、旋转等功能。 45 46**参数:** 47 48 | 名称 | 描述 | 49| -------- | -------- | 50| srcSurface | 输入参数,源位图信息。 | 51| srcRect | 输入参数,源位图搬移区域。 | 52| dstSurface | 输出参数,目标位图信息。 | 53| dstRect | 输出参数,目标位图区域。 | 54| opt | 输入参数,硬件加速选项。 | 55 56**返回:** 57 58DISPLAY_SUCCESS 表示执行成功。 59 60其他值表示执行失败,具体错误码查看[DispErrCode](_display.md#disperrcode)。 61 62 63### DeinitGfx 64 65 66``` 67int32_t(* GfxFuncs::DeinitGfx) (void) 68``` 69 70**描述:** 71 72去初始化硬件加速。 73 74**返回:** 75 76DISPLAY_SUCCESS 表示执行成功。 77 78其他值表示执行失败,具体错误码查看[DispErrCode](_display.md#disperrcode)。 79 80**参见:** 81 82[InitGfx](#initgfx) 83 84 85### DrawCircle 86 87 88``` 89int32_t(* GfxFuncs::DrawCircle) (ISurface *surface, ICircle *circle, GfxOpt *opt) 90``` 91 92**描述:** 93 94绘制圆形,使用一种颜色在画布上绘制指定圆心和半径的圆。 95 96**参数:** 97 98 | 名称 | 描述 | 99| -------- | -------- | 100| surface | 输入参数,画布。 | 101| circle | 输入参数,圆形结构。 | 102| opt | 输入参数,硬件加速选项。 | 103 104**返回:** 105 106DISPLAY_SUCCESS 表示执行成功。 107 108其他值表示执行失败,具体错误码查看[DispErrCode](_display.md#disperrcode)。 109 110 111### DrawLine 112 113 114``` 115int32_t(* GfxFuncs::DrawLine) (ISurface *surface, ILine *line, GfxOpt *opt) 116``` 117 118**描述:** 119 120绘制直线,使用一种颜色在画布上绘制一条直线。 121 122**参数:** 123 124 | 名称 | 描述 | 125| -------- | -------- | 126| surface | 输入参数,画布。 | 127| line | 输入参数,直线结构。 | 128| opt | 输入参数,硬件加速选项。 | 129 130**返回:** 131 132DISPLAY_SUCCESS 表示执行成功。 133 134其他值表示执行失败,具体错误码查看[DispErrCode](_display.md#disperrcode)。 135 136 137### DrawRectangle 138 139 140``` 141int32_t(* GfxFuncs::DrawRectangle) (ISurface *surface, Rectangle *rect, uint32_t color, GfxOpt *opt) 142``` 143 144**描述:** 145 146绘制矩形框,用一种颜色在画布上绘制指定区域的矩形框。 147 148**参数:** 149 150 | 名称 | 描述 | 151| -------- | -------- | 152| surface | 输入参数,画布。 | 153| rect | 输入参数,矩形框结构。 | 154| color | 输入参数,绘制的颜色。 | 155| opt | 输入参数,硬件加速选项。 | 156 157**返回:** 158 159DISPLAY_SUCCESS 表示执行成功。 160 161其他值表示执行失败,具体错误码查看[DispErrCode](_display.md#disperrcode)。 162 163 164### FillRect 165 166 167``` 168int32_t(* GfxFuncs::FillRect) (ISurface *surface, IRect *rect, uint32_t color, GfxOpt *opt) 169``` 170 171**描述:** 172 173填充矩形,用一种颜色填充画布上指定矩形区域的矩形框。 174 175**参数:** 176 177 | 名称 | 描述 | 178| -------- | -------- | 179| surface | 输入参数,画布。 | 180| rect | 输入参数,填充的矩形区域。 | 181| color | 输入参数,填充的颜色。 | 182| opt | 输入参数,硬件加速选项。 | 183 184**返回:** 185 186DISPLAY_SUCCESS 表示执行成功。 187 188其他值表示执行失败,具体错误码查看[DispErrCode](_display.md#disperrcode)。 189 190 191### InitGfx 192 193 194``` 195int32_t(* GfxFuncs::InitGfx) (void) 196``` 197 198**描述:** 199 200初始化硬件加速。 201 202**返回:** 203 204DISPLAY_SUCCESS 表示执行成功。 205 206其他值表示执行失败,具体错误码查看[DispErrCode](_display.md#disperrcode)。 207 208**参见:** 209 210[DeinitGfx](#deinitgfx) 211 212 213### Sync 214 215 216``` 217int32_t(* GfxFuncs::Sync) (int32_t timeOut) 218``` 219 220**描述:** 221 222硬件加速同步。 223 224在使用硬件加速模块进行图像绘制、图像叠加、图像搬移时,通过调用该接口进行硬件同步,该接口会等待硬件加速完成。 225 226**参数:** 227 228 | 名称 | 描述 | 229| -------- | -------- | 230| timeOut | 输入参数,硬件加速同步超时设置,设置为0表示无超时,等待直到硬件加速完成。 | 231 232**返回:** 233 234DISPLAY_SUCCESS 表示执行成功。 235 236其他值表示执行失败,具体错误码查看[DispErrCode](_display.md#disperrcode)。 237