加入收藏
举报
02-14 20:02
#0
文件名称:
Display.md
所在目录:
Openharmony v1.0 / docs / api / api-SmartVision-Devices
文件大小:
123.08 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# Display
## **Overview**
Defines driver functions of the display module.
The driver functions provided for the GUI include the layer, hardware acceleration, memory, and callback functions.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Files


















File Name


Description


display_gfx.h


Declares the driver functions for implementing hardware acceleration.


display_gralloc.h


Declares the driver functions for memory.


display_layer.h


Declares the driver functions for implementing layer operations.


display_type.h


Declares the types used by the display driver functions.



## Data Structures






















































Data Structure Name


Description


GfxFuncs


Defines pointers to the hardware acceleration driver functions.


GrallocFuncs


Defines pointers to the memory driver functions.


LayerFuncs


Defines pointers to the layer driver functions.


DisplayInfo


Defines display information.


LayerInfo


Defines layer information.


LayerAlpha


Defines alpha operations on a layer.


BufferHandle


Defines the buffer handle type. The virtual address of a handle maps to its physical address.


GrallocBuffer


Defines the memory buffer, including the buffer handle, memory type, memory size, and virtual memory address.


BufferData


Defines buffer data of a layer, including the virtual and physical memory addresses.


LayerBuffer


Defines the buffer, which is used to store layer data.


IRect


Defines the coordinates of the upper left corner of a rectangle as well as its width and height to describe a rectangular area for an image.


ISurface


Stores surface information for hardware acceleration, such as draw image, and bit blit.


ILine


Describes a line to help draw lines in hardware acceleration.


ICircle


Describes a circle to help draw circles in hardware acceleration.


Rectangle


Describes a rectangle to help draw rectangles in hardware acceleration.


GfxOpt


Defines hardware acceleration options.



## Enumerations




































Enumeration Name


Description


DispErrCode { DISPLAY_SUCCESS = 0, DISPLAY_FAILURE = -1, DISPLAY_FD_ERR = -2, DISPLAY_PARAM_ERR = -3, DISPLAY_NULL_PTR = -4, DISPLAY_NOT_SUPPORT = -5, DISPLAY_NOMEM = -6, DISPLAY_SYS_BUSY = -7, DISPLAY_NOT_PERM = -8 }


Enumerates return values of the functions.


LayerType { LAYER_TYPE_GRAPHIC, LAYER_TYPE_OVERLAY, LAYER_TYPE_SDIEBAND, LAYER_TYPE_BUTT }


Enumerates layer types.


PixelFormat { PIXEL_FMT_RGB_565, PIXEL_FMT_RGBA_5658, PIXEL_FMT_RGBX_4444, PIXEL_FMT_RGBA_4444, PIXEL_FMT_RGB_444, PIXEL_FMT_RGBX_5551, PIXEL_FMT_RGBA_5551, PIXEL_FMT_RGB_555, PIXEL_FMT_RGBX_8888, PIXEL_FMT_RGBA_8888, PIXEL_FMT_RGB_888, PIXEL_FMT_BGR_565, PIXEL_FMT_BGRX_4444, PIXEL_FMT_BGRA_4444, PIXEL_FMT_BGRX_5551, PIXEL_FMT_BGRA_5551, PIXEL_FMT_BGRX_8888, PIXEL_FMT_BGRA_8888, PIXEL_FMT_YUV_422_I, PIXEL_FMT_YCBCR_422_SP, PIXEL_FMT_YCRCB_422_SP, PIXEL_FMT_YCBCR_420_SP, PIXEL_FMT_YCRCB_420_SP, PIXEL_FMT_YCBCR_422_P, PIXEL_FMT_YCRCB_422_P, PIXEL_FMT_YCBCR_420_P, PIXEL_FMT_YCRCB_420_P, PIXEL_FMT_YUYV_422_PKG, PIXEL_FMT_UYVY_422_PKG, PIXEL_FMT_YVYU_422_PKG, PIXEL_FMT_VYUY_422_PKG, PIXEL_FMT_BUTT }


Enumerates pixel formats.


TransformType { ROTATE_NONE = 0, ROTATE_90, ROTATE_180, ROTATE_270, ROTATE_BUTT }


Enumerates transform types of images.


MemType { NORMAL_MEM = 0, CACHE_MEM, SHM_MEM }


Enumerates memory types.


BlendType { BLEND_NONE = 0, BLEND_CLEAR, BLEND_SRC, BLEND_SRCOVER, BLEND_DSTOVER, BLEND_SRCIN, BLEND_DSTIN, BLEND_SRCOUT, BLEND_DSTOUT, BLEND_SRCATOP, BLEND_DSTATOP, BLEND_ADD, BLEND_XOR, BLEND_DST, BLEND_AKS, BLEND_AKD, BLEND_BUTT }


Enumerates image blending types.


RopType { ROP_BLACK = 0, ROP_NOTMERGEPEN, ROP_MASKNOTPEN, ROP_NOTCOPYPEN, ROP_MASKPENNOT, ROP_NOT, ROP_XORPEN, ROP_NOTMASKPEN, ROP_MASKPEN, ROP_NOTXORPEN, ROP_NOP, ROP_MERGENOTPEN, ROP_COPYPE, ROP_MERGEPENNOT, ROP_MERGEPEN, ROP_WHITE, ROP_BUTT }


Enumerates ROP types supported by hardware acceleration.


ColorKey { CKEY_NONE = 0, CKEY_SRC, CKEY_DST, CKEY_BUTT }


Enumerates color key types supported by hardware acceleration.


MirrorType { MIRROR_NONE = 0, MIRROR_LR, MIRROR_TB, MIRROR_BUTT }


Enumerates mirror types supported by hardware acceleration.


Connection { INVALID = 0, CONNECTED, DISCONNECTED }


Enumerates connection types of hot plugging.



## Functions
























Function Name


Description


GfxInitialize (GfxFuncs **funcs)


int32_t


Initializes the hardware acceleration module to obtain the pointer to functions for hardware acceleration operations.


GfxUninitialize (GfxFuncs *funcs)


int32_t


Deinitializes the hardware acceleration module to release the memory allocated to the pointer to functions for hardware acceleration operations.


GrallocInitialize (GrallocFuncs **funcs)


int32_t


Initializes the memory module to obtain the pointer to functions for memory operations.


GrallocUninitialize (GrallocFuncs *funcs)


int32_t


Deinitializes the memory module to release the memory allocated to the pointer to functions for memory operations.


LayerInitialize (LayerFuncs **funcs)


int32_t


Initializes the layer to apply for resources used by the layer and obtain the pointer to functions for layer operations.


LayerUninitialize (LayerFuncs *funcs)


int32_t


Deinitializes the layer module to release the memory allocated to the pointer to functions for layer operations.



## **Details**
## **Enumeration Type Documentation**
## BlendType
```
enum [BlendType](Display.md#gaab1839ed4aab1030dfda801a51e68817)
```
**Description:**
Enumerates image blending types.
The system combines images based on a specified blending type during hardware acceleration.

























































Enumerator


Description


BLEND_NONE


No blending



BLEND_CLEAR


CLEAR blending



BLEND_SRC


SRC blending



BLEND_SRCOVER


SRC_OVER blending



BLEND_DSTOVER


DST_OVER blending



BLEND_SRCIN


SRC_IN blending



BLEND_DSTIN


DST_IN blending



BLEND_SRCOUT


SRC_OUT blending



BLEND_DSTOUT


DST_OUT blending



BLEND_SRCATOP


SRC_ATOP blending



BLEND_DSTATOP


DST_ATOP blending



BLEND_ADD


ADD blending



BLEND_XOR


XOR blending



BLEND_DST


DST blending



BLEND_AKS


AKS blending



BLEND_AKD


AKD blending



BLEND_BUTT


Null operation




## ColorKey
```
enum [ColorKey](Display.md#ga4fe6fb05c7ba0048b1739d88f4d4878e)
```
**Description:**
Enumerates color key types supported by hardware acceleration.


















Enumerator


Description


CKEY_NONE


No color key



CKEY_SRC


Source color key



CKEY_DST


Destination color key



CKEY_BUTT


Null operation




## Connection
```
enum [Connection](Display.md#gab0845c0c8d309ee865c78b095b00e671)
```
**Description:**
Enumerates connection types of hot plugging.















Enumerator


Description


INVALID


Invalid connection



CONNECTED


Connected



DISCONNECTED


Disconnected




## DispErrCode
```
enum [DispErrCode](Display.md#ga12a925dadef7573cd74d63d06824f9b0)
```
**Description:**
Enumerates return values of the functions.

































Enumerator


Description


DISPLAY_SUCCESS


Success



DISPLAY_FAILURE


Failure



DISPLAY_FD_ERR


File handle (FD) error



DISPLAY_PARAM_ERR


Parameter error



DISPLAY_NULL_PTR


Null pointer



DISPLAY_NOT_SUPPORT


Unsupported feature



DISPLAY_NOMEM


Insufficient memory



DISPLAY_SYS_BUSY


System busy



DISPLAY_NOT_PERM


Forbidden operation




## LayerType
```
enum [LayerType](Display.md#ga56943a0946e5f15e5e58054b8e7a04a4)
```
**Description:**
Enumerates layer types.


















Enumerator


Description


LAYER_TYPE_GRAPHIC


Graphic layer



LAYER_TYPE_OVERLAY


Overlay layer



LAYER_TYPE_SDIEBAND


Sideband layer



LAYER_TYPE_BUTT


Empty layer




## MemType
```
enum [MemType](Display.md#gabd31f838aefffa46191d0d7dc36a96b2)
```
**Description:**
Enumerates memory types.
Memory is allocated based on the type specified by the GUI.















Enumerator


Description


NORMAL_MEM


Memory without cache



CACHE_MEM


Memory with cache



SHM_MEM


Shared memory




## MirrorType
```
enum [MirrorType](Display.md#ga08d32376574b541d162d8534adb78fd0)
```
**Description:**
Enumerates mirror types supported by hardware acceleration.


















Enumerator


Description


MIRROR_NONE


No mirror



MIRROR_LR


Left and right mirrors



MIRROR_TB


Top and bottom mirrors



MIRROR_BUTT


Null operation




## PixelFormat
```
enum [PixelFormat](Codec.md#ga60883d4958a60b91661e97027a85072a)
```
**Description:**
Enumerates pixel formats.






































































































Enumerator


Description


PIXEL_FMT_RGB_565


RGB565 format



PIXEL_FMT_RGBA_5658


RGBA5658 format



PIXEL_FMT_RGBX_4444


RGBX4444 format



PIXEL_FMT_RGBA_4444


RGBA4444 format



PIXEL_FMT_RGB_444


RGB444 format



PIXEL_FMT_RGBX_5551


RGBX5551 format



PIXEL_FMT_RGBA_5551


RGBA5551 format



PIXEL_FMT_RGB_555


RGB555 format



PIXEL_FMT_RGBX_8888


RGBX8888 format



PIXEL_FMT_RGBA_8888


RGBA8888 format



PIXEL_FMT_RGB_888


RGB888 format



PIXEL_FMT_BGR_565


BGR565 format



PIXEL_FMT_BGRX_4444


BGRX4444 format



PIXEL_FMT_BGRA_4444


BGRA4444 format



PIXEL_FMT_BGRX_5551


BGRX5551 format



PIXEL_FMT_BGRA_5551


BGRA5551 format



PIXEL_FMT_BGRX_8888


BGRX8888 format



PIXEL_FMT_BGRA_8888


BGRA8888 format



PIXEL_FMT_YUV_422_I


YUV422 interleaved format



PIXEL_FMT_YCBCR_422_SP


YCBCR422 semi-planar format



PIXEL_FMT_YCRCB_422_SP


YCRCB422 semi-planar format



PIXEL_FMT_YCBCR_420_SP


YCBCR420 semi-planar format



PIXEL_FMT_YCRCB_420_SP


YCRCB420 semi-planar format



PIXEL_FMT_YCBCR_422_P


YCBCR422 planar format



PIXEL_FMT_YCRCB_422_P


YCRCB422 planar format



PIXEL_FMT_YCBCR_420_P


YCBCR420 planar format



PIXEL_FMT_YCRCB_420_P


YCRCB420 planar format



PIXEL_FMT_YUYV_422_PKG


YUYV422 packed format



PIXEL_FMT_UYVY_422_PKG


UYVY422 packed format



PIXEL_FMT_YVYU_422_PKG


YVYU422 packed format



PIXEL_FMT_VYUY_422_PKG


VYUY422 packed format



PIXEL_FMT_BUTT


Invalid pixel format




## RopType
```
enum [RopType](Display.md#ga24265f7618fbdba53d3da4806d3097c4)
```
**Description:**
Enumerates ROP types supported by hardware acceleration.
ROP performs bitwise Boolean operations \(including bitwise AND and bitwise OR\) on the RGB color and alpha values of the foreground bitmap with those of the background bitmap, and then outputs the result.

























































Enumerator


Description


ROP_BLACK


Blackness



ROP_NOTMERGEPEN


~(S2+S1)



ROP_MASKNOTPEN


~S2&S1



ROP_NOTCOPYPEN


~S2



ROP_MASKPENNOT


S2&~S1



ROP_NOT


~S1



ROP_XORPEN


S2^S1



ROP_NOTMASKPEN


~(S2&S1)



ROP_MASKPEN


S2&S1



ROP_NOTXORPEN


~(S2^S1)



ROP_NOP


S1



ROP_MERGENOTPEN


~S2+S1



ROP_COPYPE


S2



ROP_MERGEPENNOT


S2+~S1



ROP_MERGEPEN


S2+S1



ROP_WHITE


Whiteness



ROP_BUTT


Invalid ROP type




## TransformType
```
enum [TransformType](Display.md#gaa65f3b21a9a92ff022e435a7304126d2)
```
**Description:**
Enumerates transform types of images.





















Enumerator


Description


ROTATE_NONE


No rotation



ROTATE_90


Rotation by 90 degrees



ROTATE_180


Rotation by 180 degrees



ROTATE_270


Rotation by 270 degrees



ROTATE_BUTT


Invalid operation




## **Function Documentation**
## GfxInitialize\(\)
```
int32_t GfxInitialize ([GfxFuncs](zh-cn_topic_0000001054598159.md) ** funcs)
```
**Description:**
Initializes the hardware acceleration module to obtain the pointer to functions for hardware acceleration operations.
**Parameters:**









Name


Description


funcs


Indicates the double pointer to functions for hardware acceleration operations. Memory is allocated automatically when you initiate the hardware acceleration module, so you can simply use the pointer to gain access to the functions.



**Returns:**
Returns **0** if the operation is successful; returns an error code defined in [DispErrCode](Display.md#ga12a925dadef7573cd74d63d06824f9b0) otherwise.
**See also:**
[GfxUninitialize](Display.md#ga32595139adb26cfaacf709661b29b347)
## GfxUninitialize\(\)
```
int32_t GfxUninitialize ([GfxFuncs](zh-cn_topic_0000001054598159.md) * funcs)
```
**Description:**
Deinitializes the hardware acceleration module to release the memory allocated to the pointer to functions for hardware acceleration operations.
**Parameters:**









Name


Description


funcs


Indicates the pointer to functions for hardware acceleration operations.



**Returns:**
Returns **0** if the operation is successful; returns an error code defined in [DispErrCode](Display.md#ga12a925dadef7573cd74d63d06824f9b0) otherwise.
**See also:**
[GfxInitialize](Display.md#ga251580eb0614b601ef2c901c722a59d3)
## GrallocInitialize\(\)
```
int32_t GrallocInitialize ([GrallocFuncs](zh-cn_topic_0000001054918153.md) ** funcs)
```
**Description:**
Initializes the memory module to obtain the pointer to functions for memory operations.
**Parameters:**









Name


Description


funcs


Indicates the double pointer to functions for memory operations. Memory is allocated automatically when you initiate the memory module initialization, so you can simply use the pointer to gain access to the functions.



**Returns:**
Returns **0** if the operation is successful; returns an error code defined in [DispErrCode](Display.md#ga12a925dadef7573cd74d63d06824f9b0) otherwise.
## GrallocUninitialize\(\)
```
int32_t GrallocUninitialize ([GrallocFuncs](zh-cn_topic_0000001054918153.md) * funcs)
```
**Description:**
Deinitializes the memory module to release the memory allocated to the pointer to functions for memory operations.
**Parameters:**









Name


Description


funcs


Indicates the pointer to functions for memory operations.



**Returns:**
Returns **0** if the operation is successful; returns an error code defined in [DispErrCode](Display.md#ga12a925dadef7573cd74d63d06824f9b0) otherwise.
## LayerInitialize\(\)
```
int32_t LayerInitialize ([LayerFuncs](zh-cn_topic_0000001055678100.md) ** funcs)
```
**Description:**
Initializes the layer to apply for resources used by the layer and obtain the pointer to functions for layer operations.
**Parameters:**









Name


Description


funcs


Indicates the double pointer to functions for layer operations. Memory is allocated automatically when you initiate the layer module, so you can simply use the pointer to gain access to the functions.



**Returns:**
Returns **0** if the operation is successful; returns an error code defined in [DispErrCode](Display.md#ga12a925dadef7573cd74d63d06824f9b0) otherwise.
**See also:**
[LayerUninitialize](Display.md#ga4e32b1a65cf243a9ac015b632a4eea0b)
## LayerUninitialize\(\)
```
int32_t LayerUninitialize ([LayerFuncs](zh-cn_topic_0000001055678100.md) * funcs)
```
**Description:**
Deinitializes the layer module to release the memory allocated to the pointer to functions for layer operations.
**Parameters:**









Name


Description


funcs


Indicates the pointer to functions for layer operations.



**Returns:**
Returns **0** if the operation is successful; returns an error code defined in [DispErrCode](Display.md#ga12a925dadef7573cd74d63d06824f9b0) otherwise.
**See also:**
[LayerInitialize](Display.md#ga061e587306a5d0367ff228d64434c05d)
点赞 回复
回帖
支持markdown部分语法 ?