提交 af211bb0 编写于 作者: G Gloria

Update docs against 20339

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 82771590
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
## Overview ## Overview
Provides the native window capability for connection to the EGL. The **NativeWindow** module provides the **NativeWindow** capability for connection to the EGL.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Since:** **Since**
8 8
...@@ -16,58 +17,97 @@ Provides the native window capability for connection to the EGL. ...@@ -16,58 +17,97 @@ Provides the native window capability for connection to the EGL.
### Files ### Files
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [external_window.h](external__window_8h.md) | Defines the functions for obtaining and using a native window. <br>File to Include: <native_window/external_window.h> | | [external_window.h](external__window_8h.md) | Declares the functions for obtaining and using **NativeWindow**.<br>File to include: &lt;native_window/external_window.h&gt; |
### Structs ### Structs
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [Region](_region.md) | Defines the rectangle (dirty region) where the content is to be updated in the local native window. | | [Region](_region.md) | Defines the rectangle (dirty region) where the content is to be updated in the local **OHNativeWindow**.|
| [OHHDRMetaData](_o_h_h_d_r_meta_data.md) | Defines the HDR metadata. | | [OHHDRMetaData](_o_h_h_d_r_meta_data.md) | Defines the HDR metadata.|
| [OHExtDataHandle](_o_h_ext_data_handle.md) | Defines the extended data handle. | | [OHExtDataHandle](_o_h_ext_data_handle.md) | Defines the extended data handle.|
### Types ### Types
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| OHNativeWindow | Provides the function of accessing the **NativeWindow**. | | [OHNativeWindow](#ohnativewindow) | Provides the capability of accessing the **OHNativeWindow**.|
| OHNativeWindowBuffer | Provides the function of accessing the **NativeWindowBuffer**. | | [OHNativeWindowBuffer](#ohnativewindowbuffer) | Provides the capability of accessing the **OHNativeWindowBuffer**.|
| Region | Defines the rectangle (dirty region) where the content is to be updated in the local native window. | | [Region](#region) | Defines the rectangle (dirty region) where the content is to be updated in the local **OHNativeWindow**.|
### Enums ### Enums
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [NativeWindowOperation](#nativewindowoperation) {<br/>SET_BUFFER_GEOMETRY, GET_BUFFER_GEOMETRY, GET_FORMAT, SET_FORMAT,<br/>GET_USAGE, SET_USAGE, SET_STRIDE, GET_STRIDE,<br/>SET_SWAP_INTERVAL, GET_SWAP_INTERVAL, SET_TIMEOUT, GET_TIMEOUT,<br/>SET_COLOR_GAMUT, GET_COLOR_GAMUT, SET_TRANSFORM, GET_TRANSFORM,<br/>SET_UI_TIMESTAMP<br/>} | Enumerates the operation codes in the **OH_NativeWindow_NativeWindowHandleOpt** function. | | [NativeWindowOperation](#nativewindowoperation) {<br>SET_BUFFER_GEOMETRY, GET_BUFFER_GEOMETRY, GET_FORMAT, SET_FORMAT,<br>GET_USAGE, SET_USAGE, SET_STRIDE, GET_STRIDE,<br>SET_SWAP_INTERVAL, GET_SWAP_INTERVAL, SET_TIMEOUT, GET_TIMEOUT,<br>SET_COLOR_GAMUT, GET_COLOR_GAMUT, SET_TRANSFORM, GET_TRANSFORM,<br>SET_UI_TIMESTAMP<br>} | Enumerates the operation codes in the **OH_NativeWindow_NativeWindowHandleOpt** function.|
| [OHScalingMode](#ohscalingmode) { OH_SCALING_MODE_FREEZE = 0, OH_SCALING_MODE_SCALE_TO_WINDOW, OH_SCALING_MODE_SCALE_CROP, OH_SCALING_MODE_NO_SCALE_CROP } | Enumerates the scaling modes. | | [OHScalingMode](#ohscalingmode) { OH_SCALING_MODE_FREEZE = 0, OH_SCALING_MODE_SCALE_TO_WINDOW, OH_SCALING_MODE_SCALE_CROP, OH_SCALING_MODE_NO_SCALE_CROP } | Enumerates the scaling modes.|
| [OHHDRMetadataKey](#ohhdrmetadatakey) {<br/>OH_METAKEY_RED_PRIMARY_X = 0, OH_METAKEY_RED_PRIMARY_Y = 1, OH_METAKEY_GREEN_PRIMARY_X = 2, OH_METAKEY_GREEN_PRIMARY_Y = 3,<br/>OH_METAKEY_BLUE_PRIMARY_X = 4, OH_METAKEY_BLUE_PRIMARY_Y = 5, OH_METAKEY_WHITE_PRIMARY_X = 6, OH_METAKEY_WHITE_PRIMARY_Y = 7,<br/>OH_METAKEY_MAX_LUMINANCE = 8, OH_METAKEY_MIN_LUMINANCE = 9, OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL = 10, OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11,<br/>OH_METAKEY_HDR10_PLUS = 12, OH_METAKEY_HDR_VIVID = 13<br/>} | Enumerates the HDR metadata keys. | | [OHHDRMetadataKey](#ohhdrmetadatakey) {<br>OH_METAKEY_RED_PRIMARY_X = 0, OH_METAKEY_RED_PRIMARY_Y = 1, OH_METAKEY_GREEN_PRIMARY_X = 2, OH_METAKEY_GREEN_PRIMARY_Y = 3,<br>OH_METAKEY_BLUE_PRIMARY_X = 4, OH_METAKEY_BLUE_PRIMARY_Y = 5, OH_METAKEY_WHITE_PRIMARY_X = 6, OH_METAKEY_WHITE_PRIMARY_Y = 7,<br>OH_METAKEY_MAX_LUMINANCE = 8, OH_METAKEY_MIN_LUMINANCE = 9, OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL = 10, OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11,<br>OH_METAKEY_HDR10_PLUS = 12, OH_METAKEY_HDR_VIVID = 13<br>} | Enumerates the HDR metadata keys.|
### Functions ### Functions
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_NativeWindow_CreateNativeWindow](#oh_nativewindow_createnativewindow) (void \*pSurface) | Creates a **NativeWindow** instance. A new **NativeWindow** instance is created each time this function is called. | | [OH_NativeWindow_CreateNativeWindow](#oh_nativewindow_createnativewindow) (void \*pSurface) | Creates an **OHNativeWindow** instance. A new **OHNativeWindow** instance is created each time this function is called.|
| [OH_NativeWindow_DestroyNativeWindow](#oh_nativewindow_destroynativewindow) (OHNativeWindow \*window) | Decreases the reference count of a **NativeWindow** instance by 1 and when the reference count reaches 0, destroys the instance. | | [OH_NativeWindow_DestroyNativeWindow](#oh_nativewindow_destroynativewindow) (OHNativeWindow \*window) | Decreases the reference count of an **OHNativeWindow** instance by 1 and when the reference count reaches 0, destroys the instance.|
| [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](#oh_nativewindow_createnativewindowbufferfromsurfacebuffer) (void \*pSurfaceBuffer) | Creates a **NativeWindowBuffer** instance. A new **NativeWindowBuffer** instance is created each time this function is called. | | [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](#oh_nativewindow_createnativewindowbufferfromsurfacebuffer) (void \*pSurfaceBuffer) | Creates an **OHNativeWindowBuffer** instance. A new **OHNativeWindowBuffer** instance is created each time this function is called.|
| [OH_NativeWindow_DestroyNativeWindowBuffer](#oh_nativewindow_destroynativewindowbuffer) (OHNativeWindowBuffer \*buffer) | Decreases the reference count of a **NativeWindowBuffer** instance by 1 and when the reference count reaches 0, destroys the instance. | | [OH_NativeWindow_DestroyNativeWindowBuffer](#oh_nativewindow_destroynativewindowbuffer) (OHNativeWindowBuffer \*buffer) | Decreases the reference count of an **OHNativeWindowBuffer** instance by 1 and when the reference count reaches 0, destroys the instance.|
| [OH_NativeWindow_NativeWindowRequestBuffer](#oh_nativewindow_nativewindowrequestbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*\*buffer, int \*fenceFd) | Requests a **NativeWindowBuffer** through a **NativeWindow** instance for content production. | | [OH_NativeWindow_NativeWindowRequestBuffer](#oh_nativewindow_nativewindowrequestbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*\*buffer, int \*fenceFd) | Requests an **OHNativeWindowBuffer** through an **OHNativeWindow** instance for content production.|
| [OH_NativeWindow_NativeWindowFlushBuffer](#oh_nativewindow_nativewindowflushbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer, int fenceFd, [Region](_region.md) region) | Flushes the **NativeWindowBuffer** filled with the content to the buffer queue through a **NativeWindow** instance for content consumption. | | [OH_NativeWindow_NativeWindowFlushBuffer](#oh_nativewindow_nativewindowflushbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer, int fenceFd, Region region) | Flushes the **OHNativeWindowBuffer** filled with the content to the buffer queue through an **OHNativeWindow** instance for content consumption.|
| [OH_NativeWindow_NativeWindowAbortBuffer](#oh_nativewindow_nativewindowabortbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer) | Returns the **NativeWindowBuffer** to the buffer queue through a **NativeWindow** instance, without filling in any content. The **NativeWindowBuffer** can be used for another request. | | [OH_NativeWindow_NativeWindowAbortBuffer](#oh_nativewindow_nativewindowabortbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer) | Returns the **OHNativeWindowBuffer** to the buffer queue through an **OHNativeWindow** instance, without filling in any content. The **OHNativeWindowBuffer** can be used for a new request.|
| [OH_NativeWindow_NativeWindowHandleOpt](#oh_nativewindow_nativewindowhandleopt) (OHNativeWindow \*window, int code,...) | Sets or obtains the attributes of a native window, including the width, height, and content format. | | [OH_NativeWindow_NativeWindowHandleOpt](#oh_nativewindow_nativewindowhandleopt) (OHNativeWindow \*window, int code,...) | Sets or obtains the attributes of an **OHNativeWindow**, including the width, height, and content format.|
| [OH_NativeWindow_GetBufferHandleFromNative](#oh_nativewindow_getbufferhandlefromnative) (OHNativeWindowBuffer \*buffer) | Obtains the pointer to a **BufferHandle** of a **NativeWindowBuffer** instance. | | [OH_NativeWindow_GetBufferHandleFromNative](#oh_nativewindow_getbufferhandlefromnative) (OHNativeWindowBuffer \*buffer) | Obtains the pointer to a **BufferHandle** of an **OHNativeWindowBuffer** instance.|
| [OH_NativeWindow_NativeObjectReference](#oh_nativewindow_nativeobjectreference) (void \*obj) | Adds the reference count of a native object. | | [OH_NativeWindow_NativeObjectReference](#oh_nativewindow_nativeobjectreference) (void \*obj) | Adds the reference count of a native object.|
| [OH_NativeWindow_NativeObjectUnreference](#oh_nativewindow_nativeobjectunreference) (void \*obj) | Decreases the reference count of a native object and when the reference count reaches 0, destroys this object. | | [OH_NativeWindow_NativeObjectUnreference](#oh_nativewindow_nativeobjectunreference) (void \*obj) | Decreases the reference count of a native object and when the reference count reaches 0, destroys this object.|
| [OH_NativeWindow_GetNativeObjectMagic](#oh_nativewindow_getnativeobjectmagic) (void \*obj) | Obtains the magic ID of a native object. | | [OH_NativeWindow_GetNativeObjectMagic](#oh_nativewindow_getnativeobjectmagic) (void \*obj) | Obtains the magic ID of a native object.|
| [OH_NativeWindow_NativeWindowSetScalingMode](#oh_nativewindow_nativewindowsetscalingmode) (OHNativeWindow \*window, uint32_t sequence, [OHScalingMode](#ohscalingmode) scalingMode) | Sets the scaling mode for a native window. | | [OH_NativeWindow_NativeWindowSetScalingMode](#oh_nativewindow_nativewindowsetscalingmode) (OHNativeWindow \*window, uint32_t sequence, OHScalingMode scalingMode) | Sets a scaling mode for an **OHNativeWindow**.|
| [OH_NativeWindow_NativeWindowSetMetaData](#oh_nativewindow_nativewindowsetmetadata) (OHNativeWindow \*window, uint32_t sequence, int32_t size, const [OHHDRMetaData](_o_h_h_d_r_meta_data.md) \*metaData) | Sets the metadata for a native window. | | [OH_NativeWindow_NativeWindowSetMetaData](#oh_nativewindow_nativewindowsetmetadata) (OHNativeWindow \*window, uint32_t sequence, int32_t size, const OHHDRMetaData \*metaData) | Sets metadata for an **OHNativeWindow**.|
| [OH_NativeWindow_NativeWindowSetMetaDataSet](#oh_nativewindow_nativewindowsetmetadataset) (OHNativeWindow \*window, uint32_t sequence, [OHHDRMetadataKey](#ohhdrmetadatakey) key, int32_t size, const uint8_t \*metaData) | Sets the metadata set for a native window. | | [OH_NativeWindow_NativeWindowSetMetaDataSet](#oh_nativewindow_nativewindowsetmetadataset) (OHNativeWindow*window, uint32_t sequence, OHHDRMetadataKey key, int32_t size, const uint8_t \*metaData) | Sets a metadata set for an **OHNativeWindow**.|
| [OH_NativeWindow_NativeWindowSetTunnelHandle](#oh_nativewindow_nativewindowsettunnelhandle) (OHNativeWindow \*window, const [OHExtDataHandle](_o_h_ext_data_handle.md) \*handle) | Sets a tunnel handle for a native window. | | [OH_NativeWindow_NativeWindowSetTunnelHandle](#oh_nativewindow_nativewindowsettunnelhandle) (OHNativeWindow \*window, const OHExtDataHandle \*handle) | Sets a tunnel handle to an **OHNativeWindow**.|
## Type Description
### OHNativeWindow
```
typedef struct NativeWindow OHNativeWindow
```
**Description**
Provides the capability of accessing the **OHNativeWindow**.
### OHNativeWindowBuffer
```
typedef struct NativeWindowBuffer OHNativeWindowBuffer
```
**Description**
Provides the capability of accessing the **OHNativeWindowBuffer**.
### Region
```
typedef struct Region Region
```
**Description**
Defines the rectangle (dirty region) where the content is to be updated in the local **OHNativeWindow**.
## Enum Description ## Enum Description
...@@ -75,76 +115,98 @@ Provides the native window capability for connection to the EGL. ...@@ -75,76 +115,98 @@ Provides the native window capability for connection to the EGL.
### NativeWindowOperation ### NativeWindowOperation
``` ```
enum NativeWindowOperation enum NativeWindowOperation
``` ```
**Description**<br>
**Description**
Enumerates the operation codes in the **OH_NativeWindow_NativeWindowHandleOpt** function. Enumerates the operation codes in the **OH_NativeWindow_NativeWindowHandleOpt** function.
| Name | Description | | Value| Description|
| -------- | -------- | | -------- | -------- |
| SET_BUFFER_GEOMETRY | Setting the geometry for the local window buffer. Variable arguments in the function: [Input] int32_t height and [Input] int32_t width. | | SET_BUFFER_GEOMETRY | Setting the geometry for the local window buffer.<br>Variable arguments in the function: [Input] int32_t height and [Input] int32_t width.|
| GET_BUFFER_GEOMETRY | Obtaining the geometry of the local window buffer. Variable arguments in the function: [Output] int32_t \*height and [Output] int32_t \*width. | | GET_BUFFER_GEOMETRY | Obtaining the geometry of the local window buffer.<br>Variable arguments in the function: [Output] int32_t *height and [Output] int32_t *width.|
| GET_FORMAT | Obtaining the format of the local window buffer. Variable argument in the function: [Output] int32_t \*format. | | GET_FORMAT | Obtaining the format of the local window buffer.<br>Variable argument in the function: [Output] int32_t *format.|
| SET_FORMAT | Setting the format for the local window buffer. Variable argument in the function: [Input] int32_t format. | | SET_FORMAT | Setting the format for the local window buffer.<br>Variable argument in the function: [Input] int32_t format.|
| GET_USAGE | Obtaining the usage mode of the local window buffer. Variable argument in the function: [Output] int32_t \*usage. | | GET_USAGE | Obtaining the usage mode of the local window buffer.<br>Variable argument in the function: [Output] int32_t *usage.|
| SET_USAGE | Setting the usage mode for the local window buffer. Variable argument in the function: [Input] int32_t usage. | | SET_USAGE | Setting the usage mode for the local window buffer.<br>Variable argument in the function: [Input] int32_t usage.|
| SET_STRIDE | Setting the stride for the local window buffer. Variable argument in the function: [Input] int32_t stride. | | SET_STRIDE | Setting the stride for the local window buffer.<br>Variable argument in the function: [Input] int32_t stride.|
| GET_STRIDE | Obtaining the stride of the local window buffer. Variable argument in the function: [Output] int32_t \*stride. | | GET_STRIDE | Obtaining the stride of the local window buffer.<br>Variable argument in the function: [Output] int32_t *stride.|
| SET_SWAP_INTERVAL | Setting the swap interval for the local window buffer. Variable argument in the function: [Input] int32_t interval. | | SET_SWAP_INTERVAL | Setting the swap interval for the local window buffer.<br>Variable argument in the function: [Input] int32_t interval.|
| GET_SWAP_INTERVAL | Obtaining the swap interval of the local window buffer. Variable argument in the function: [Output] int32_t \*interval. | | GET_SWAP_INTERVAL | Obtaining the swap interval of the local window buffer.<br>Variable argument in the function: [Output] int32_t *interval.|
| SET_TIMEOUT | Setting the timeout duration for requesting the local window buffer. Variable argument in the function: [Input] int32_t timeout. | | SET_TIMEOUT | Setting the timeout duration for requesting the local window buffer.<br>Variable argument in the function: [Input] int32_t timeout.|
| GET_TIMEOUT | Obtaining the timeout duration for requesting the local window buffer. Variable argument in the function: [Output] int32_t \*timeout. | | GET_TIMEOUT | Obtaining the timeout duration for requesting the local window buffer.<br>Variable argument in the function: [Output] int32_t *timeout.|
| SET_COLOR_GAMUT | Setting the color gamut for the local window buffer. Variable argument in the function: [Input] int32_t colorGamut. | | SET_COLOR_GAMUT | Setting the color gamut for the local window buffer.<br>Variable argument in the function: [Input] int32_t colorGamut.|
| GET_COLOR_GAMUT | Obtaining the color gamut of the local window buffer. Variable argument in the function: [out int32_t \*colorGamut]. | | GET_COLOR_GAMUT | Obtaining the color gamut of the local window buffer.<br>Variable argument in the function: [Output] int32_t *colorGamut.|
| SET_TRANSFORM | Setting the transform for the local window buffer. Variable argument in the function: [Input] int32_t transform. | | SET_TRANSFORM | Setting the transform for the local window buffer.<br>Variable argument in the function: [Input] int32_t transform.|
| GET_TRANSFORM | Obtaining the transform of the local window buffer. Variable argument in the function: [Output] int32_t \*transform. | | GET_TRANSFORM | Obtaining the transform of the local window buffer.<br>Variable argument in the function: [Output] int32_t *transform.|
| SET_UI_TIMESTAMP | Setting the UI timestamp for the local window buffer. Variable argument in the function: [Input] uint64_t uiTimestamp. | | SET_UI_TIMESTAMP | Setting the UI timestamp for the local window buffer.<br>Variable argument in the function: [Input] uint64_t uiTimestamp.|
### OHHDRMetadataKey ### OHHDRMetadataKey
``` ```
enum OHHDRMetadataKey enum OHHDRMetadataKey
``` ```
**Description**<br>
**Description**
Enumerates the HDR metadata keys. Enumerates the HDR metadata keys.
| Name | Description | **Since**
9
**Deprecated**
This enum is deprecated since API version 10. No substitute enum is provided.
| Value| Description|
| -------- | -------- | | -------- | -------- |
| OH_METAKEY_RED_PRIMARY_X | X coordinate of the red primary color. | | OH_METAKEY_RED_PRIMARY_X | X coordinate of the red primary color.|
| OH_METAKEY_RED_PRIMARY_Y | Y coordinate of the red primary color. | | OH_METAKEY_RED_PRIMARY_Y | Y coordinate of the red primary color.|
| OH_METAKEY_GREEN_PRIMARY_X | X coordinate of the green primary color. | | OH_METAKEY_GREEN_PRIMARY_X | X coordinate of the green primary color.|
| OH_METAKEY_GREEN_PRIMARY_Y | Y coordinate of the green primary color. | | OH_METAKEY_GREEN_PRIMARY_Y | Y coordinate of the green primary color.|
| OH_METAKEY_BLUE_PRIMARY_X | X coordinate of the blue primary color. | | OH_METAKEY_BLUE_PRIMARY_X | X coordinate of the blue primary color.|
| OH_METAKEY_BLUE_PRIMARY_Y | Y coordinate of the blue primary color. | | OH_METAKEY_BLUE_PRIMARY_Y | Y coordinate of the blue primary color.|
| OH_METAKEY_WHITE_PRIMARY_X | X coordinate of the white point. | | OH_METAKEY_WHITE_PRIMARY_X | X coordinate of the white point.|
| OH_METAKEY_WHITE_PRIMARY_Y | Y coordinate of the white point. | | OH_METAKEY_WHITE_PRIMARY_Y | Y coordinate of the white point.|
| OH_METAKEY_MAX_LUMINANCE | Maximum luminance. | | OH_METAKEY_MAX_LUMINANCE | Maximum luminance.|
| OH_METAKEY_MIN_LUMINANCE | Minimum luminance. | | OH_METAKEY_MIN_LUMINANCE | Minimum luminance.|
| OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL | Maximum content light level (MaxCLL). | | OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL | Maximum content light level (MaxCLL).|
| OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL | Maximum frame average light level (MaxFALLL). | | OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL | Maximum frame average light level (MaxFALLL).|
| OH_METAKEY_HDR10_PLUS | HDR10+. | | OH_METAKEY_HDR10_PLUS | HDR10 Plus |
| OH_METAKEY_HDR_VIVID | Vivid. | | OH_METAKEY_HDR_VIVID | Vivid |
### OHScalingMode ### OHScalingMode
``` ```
enum OHScalingMode enum OHScalingMode
``` ```
**Description**<br>
**Description**
Enumerates the scaling modes. Enumerates the scaling modes.
| Name | Description | **Since**
9
**Deprecated**
This enum is deprecated since API version 10. No substitute enum is provided.
| Value| Description|
| -------- | -------- | | -------- | -------- |
| OH_SCALING_MODE_FREEZE | The window content cannot be updated before the buffer of the window size is received. | | OH_SCALING_MODE_FREEZE | The window content cannot be updated before the buffer of the window size is received.|
| OH_SCALING_MODE_SCALE_TO_WINDOW | The buffer is scaled in two dimensions to match the window size. | | OH_SCALING_MODE_SCALE_TO_WINDOW | The buffer is scaled in two dimensions to match the window size.|
| OH_SCALING_MODE_SCALE_CROP | The buffer is scaled uniformly so that its smaller size can match the window size. | | OH_SCALING_MODE_SCALE_CROP | The buffer is scaled uniformly so that its smaller size can match the window size.|
| OH_SCALING_MODE_NO_SCALE_CROP | The window is cropped to the size of the buffer's cropping rectangle. Pixels outside the cropping rectangle are considered completely transparent. | | OH_SCALING_MODE_NO_SCALE_CROP | The window is cropped to the size of the buffer's cropping rectangle. Pixels outside the cropping rectangle are considered completely transparent.|
## Function Description ## Function Description
...@@ -152,100 +214,110 @@ Enumerates the scaling modes. ...@@ -152,100 +214,110 @@ Enumerates the scaling modes.
### OH_NativeWindow_CreateNativeWindow() ### OH_NativeWindow_CreateNativeWindow()
``` ```
OHNativeWindow* OH_NativeWindow_CreateNativeWindow (void * pSurface) OHNativeWindow* OH_NativeWindow_CreateNativeWindow (void * pSurface)
``` ```
**Description**<br>
Creates a **NativeWindow** instance. A new **NativeWindow** instance is created each time this function is called. **Description**
Creates an **OHNativeWindow** instance. A new **OHNativeWindow** instance is created each time this function is called.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| pSurface | Indicates the pointer to a **ProduceSurface**. The type is **sptr&lt;OHOS::Surface&gt;**. | | pSurface | Pointer to a **ProduceSurface**. The type is **sptr&lt;OHOS::Surface&gt;**.|
**Returns** **Returns**
Returns the pointer to the **NativeWindow** instance created. Returns the pointer to the **OHNativeWindow** instance created.
### OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer() ### OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer()
``` ```
OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer (void * pSurfaceBuffer) OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer (void * pSurfaceBuffer)
``` ```
**Description**<br>
Creates a **NativeWindowBuffer** instance. A new **NativeWindowBuffer** instance is created each time this function is called. **Description**
Creates an **OHNativeWindowBuffer** instance. A new **OHNativeWindowBuffer** instance is created each time this function is called.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| pSurfaceBuffer | Indicates the pointer to a produce buffer. The type is **sptr&lt;OHOS::SurfaceBuffer&gt;**. | | pSurfaceBuffer | Pointer to a **ProduceSurfaceBuffer**. The type is **sptr&lt;OHOS::SurfaceBuffer&gt;**.|
**Returns** **Returns**
Returns the pointer to the **NativeWindowBuffer** instance created. Returns the pointer to the **OHNativeWindowBuffer** instance created.
### OH_NativeWindow_DestroyNativeWindow() ### OH_NativeWindow_DestroyNativeWindow()
``` ```
void OH_NativeWindow_DestroyNativeWindow (OHNativeWindow * window) void OH_NativeWindow_DestroyNativeWindow (OHNativeWindow * window)
``` ```
**Description**<br>
Decreases the reference count of a **NativeWindow** instance by 1 and when the reference count reaches 0, destroys the instance. **Description**
Decreases the reference count of an **OHNativeWindow** instance by 1 and when the reference count reaches 0, destroys the instance.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| window | Indicates the pointer to a **NativeWindow** instance. | | window | Pointer to an **OHNativeWindow** instance.|
### OH_NativeWindow_DestroyNativeWindowBuffer() ### OH_NativeWindow_DestroyNativeWindowBuffer()
``` ```
void OH_NativeWindow_DestroyNativeWindowBuffer (OHNativeWindowBuffer * buffer) void OH_NativeWindow_DestroyNativeWindowBuffer (OHNativeWindowBuffer * buffer)
``` ```
**Description**<br>
Decreases the reference count of a **NativeWindowBuffer** instance by 1 and when the reference count reaches 0, destroys the instance. **Description**
Decreases the reference count of an **OHNativeWindowBuffer** instance by 1 and when the reference count reaches 0, destroys the instance.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| buffer | Indicates the pointer to a **NativeWindowBuffer** instance. | | buffer | Pointer to an **OHNativeWindowBuffer** instance.|
### OH_NativeWindow_GetBufferHandleFromNative() ### OH_NativeWindow_GetBufferHandleFromNative()
``` ```
BufferHandle* OH_NativeWindow_GetBufferHandleFromNative (OHNativeWindowBuffer * buffer) BufferHandle* OH_NativeWindow_GetBufferHandleFromNative (OHNativeWindowBuffer * buffer)
``` ```
**Description**<br>
Obtains the pointer to a **BufferHandle** of a **NativeWindowBuffer** instance. **Description**
Obtains the pointer to a **BufferHandle** of an **OHNativeWindowBuffer** instance.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| buffer | Indicates the pointer to a **NativeWindowBuffer** instance. | | buffer | Pointer to an **OHNativeWindowBuffer** instance.|
**Returns** **Returns**
...@@ -254,20 +326,22 @@ Returns the pointer to the **BufferHandle** instance obtained. ...@@ -254,20 +326,22 @@ Returns the pointer to the **BufferHandle** instance obtained.
### OH_NativeWindow_GetNativeObjectMagic() ### OH_NativeWindow_GetNativeObjectMagic()
``` ```
int32_t OH_NativeWindow_GetNativeObjectMagic (void * obj) int32_t OH_NativeWindow_GetNativeObjectMagic (void * obj)
``` ```
**Description**<br>
**Description**
Obtains the magic ID of a native object. Obtains the magic ID of a native object.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| obj | Indicates the pointer to a **NativeWindow** or **NativeWindowBuffer** instance. | | obj | Pointer to an **OHNativeWindow** or **OHNativeWindowBuffer** instance.|
**Returns** **Returns**
...@@ -276,237 +350,289 @@ Returns the magic ID, which is unique for each native object. ...@@ -276,237 +350,289 @@ Returns the magic ID, which is unique for each native object.
### OH_NativeWindow_NativeObjectReference() ### OH_NativeWindow_NativeObjectReference()
``` ```
int32_t OH_NativeWindow_NativeObjectReference (void * obj) int32_t OH_NativeWindow_NativeObjectReference (void * obj)
``` ```
**Description**<br>
**Description**
Adds the reference count of a native object. Adds the reference count of a native object.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| obj | Indicates the pointer to a **NativeWindow** or **NativeWindowBuffer** instance. | | obj | Pointer to an **OHNativeWindow** or **OHNativeWindowBuffer** instance.|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
### OH_NativeWindow_NativeObjectUnreference() ### OH_NativeWindow_NativeObjectUnreference()
``` ```
int32_t OH_NativeWindow_NativeObjectUnreference (void * obj) int32_t OH_NativeWindow_NativeObjectUnreference (void * obj)
``` ```
**Description**<br>
**Description**
Decreases the reference count of a native object and when the reference count reaches 0, destroys this object. Decreases the reference count of a native object and when the reference count reaches 0, destroys this object.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| obj | Indicates the pointer to a **NativeWindow** or **NativeWindowBuffer** instance. | | obj | Pointer to an **OHNativeWindow** or **OHNativeWindowBuffer** instance.|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
### OH_NativeWindow_NativeWindowAbortBuffer() ### OH_NativeWindow_NativeWindowAbortBuffer()
``` ```
int32_t OH_NativeWindow_NativeWindowAbortBuffer (OHNativeWindow * window, OHNativeWindowBuffer * buffer ) int32_t OH_NativeWindow_NativeWindowAbortBuffer (OHNativeWindow * window, OHNativeWindowBuffer * buffer )
``` ```
**Description**<br>
Returns the **NativeWindowBuffer** to the buffer queue through a **NativeWindow** instance, without filling in any content. The **NativeWindowBuffer** can be used for another request. **Description**
Returns the **OHNativeWindowBuffer** to the buffer queue through an **OHNativeWindow** instance, without filling in any content. The **OHNativeWindowBuffer** can be used for a new request.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| window | Indicates the pointer to a **NativeWindow** instance. | | window | Pointer to an **OHNativeWindow** instance.|
| buffer | Indicates the pointer to a **NativeWindowBuffer** instance. | | buffer | Pointer to an **OHNativeWindowBuffer** instance.|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
### OH_NativeWindow_NativeWindowFlushBuffer() ### OH_NativeWindow_NativeWindowFlushBuffer()
``` ```
int32_t OH_NativeWindow_NativeWindowFlushBuffer (OHNativeWindow * window, OHNativeWindowBuffer * buffer, int fenceFd, Region region ) int32_t OH_NativeWindow_NativeWindowFlushBuffer (OHNativeWindow * window, OHNativeWindowBuffer * buffer, int fenceFd, Region region )
``` ```
**Description**<br>
Flushes the **NativeWindowBuffer** filled with the content to the buffer queue through a **NativeWindow** instance for content consumption. **Description**
Flushes the **OHNativeWindowBuffer** filled with the content to the buffer queue through an **OHNativeWindow** instance for content consumption.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| window | Indicates the pointer to a **NativeWindow** instance. | | window | Pointer to an **OHNativeWindow** instance.|
| buffer | Indicates the pointer to a **NativeWindowBuffer** instance. | | buffer | Pointer to an **OHNativeWindowBuffer** instance.|
| fenceFd | Indicates a file descriptor handle, which is used for timing synchronization. | | fenceFd | File descriptor handle, which is used for timing synchronization.|
| region | Indicates a dirty region where content is updated. | | region | Dirty region where content is updated.|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
### OH_NativeWindow_NativeWindowHandleOpt() ### OH_NativeWindow_NativeWindowHandleOpt()
``` ```
int32_t OH_NativeWindow_NativeWindowHandleOpt (OHNativeWindow * window, int code, ... ) int32_t OH_NativeWindow_NativeWindowHandleOpt (OHNativeWindow * window, int code, ... )
``` ```
**Description**<br>
Sets or obtains the attributes of a native window, including the width, height, and content format. **Description**
Sets or obtains the attributes of an **OHNativeWindow**, including the width, height, and content format.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| window | Indicates the pointer to a **NativeWindow** instance. | | window | Pointer to an **OHNativeWindow** instance.|
| code | Indicates the operation code. For details, see [NativeWindowOperation](#nativewindowoperation). | | code | Operation code. For details, see [NativeWindowOperation](#nativewindowoperation).|
| ... | Indicates the variable argument, which must correspond to the operation code. | | ... | Variable argument, which must correspond to the operation code.|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
### OH_NativeWindow_NativeWindowRequestBuffer() ### OH_NativeWindow_NativeWindowRequestBuffer()
``` ```
int32_t OH_NativeWindow_NativeWindowRequestBuffer (OHNativeWindow * window, OHNativeWindowBuffer ** buffer, int * fenceFd ) int32_t OH_NativeWindow_NativeWindowRequestBuffer (OHNativeWindow * window, OHNativeWindowBuffer ** buffer, int * fenceFd )
``` ```
**Description**<br>
Requests a **NativeWindowBuffer** through a **NativeWindow** instance for content production. **Description**
Requests an **OHNativeWindowBuffer** through an **OHNativeWindow** instance for content production.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| window | Indicates the pointer to a **NativeWindow** instance. | | window | Pointer to an **OHNativeWindow** instance.|
| buffer | Indicates the double pointer to a **NativeWindowBuffer** instance. | | buffer | Double pointer to an **OHNativeWindowBuffer** instance.|
| fenceFd | Indicates the pointer to a file descriptor handle. | | fenceFd | Pointer to a file descriptor handle.|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
### OH_NativeWindow_NativeWindowSetMetaData() ### OH_NativeWindow_NativeWindowSetMetaData()
``` ```
int32_t OH_NativeWindow_NativeWindowSetMetaData (OHNativeWindow * window, uint32_t sequence, int32_t size, const OHHDRMetaData * metaData ) int32_t OH_NativeWindow_NativeWindowSetMetaData (OHNativeWindow * window, uint32_t sequence, int32_t size, const OHHDRMetaData * metaData )
``` ```
**Description**<br>
Sets the metadata for a native window. **Description**
Sets metadata for an **OHNativeWindow**.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| window | Indicates the pointer to a **NativeWindow** instance. | | window | Pointer to an **OHNativeWindow** instance.|
| sequence | Indicates the sequence of the producer buffer. | | sequence | Sequence of the producer buffer.|
| size | Indicates the size of the **[OHHDRMetaData](_o_h_h_d_r_meta_data.md)** array. | | size | Size of the **OHHDRMetaData** array.|
| metaData | Indicates the pointer to the **[OHHDRMetaData](_o_h_h_d_r_meta_data.md)** array. | | metaData| Pointer to the **OHHDRMetaData** array.|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
**Since**
9
**Deprecated**
This function is deprecated since API version 10. No substitute function is provided.
### OH_NativeWindow_NativeWindowSetMetaDataSet() ### OH_NativeWindow_NativeWindowSetMetaDataSet()
``` ```
int32_t OH_NativeWindow_NativeWindowSetMetaDataSet (OHNativeWindow * window, uint32_t sequence, OHHDRMetadataKey key, int32_t size, const uint8_t * metaData ) int32_t OH_NativeWindow_NativeWindowSetMetaDataSet (OHNativeWindow * window, uint32_t sequence, OHHDRMetadataKey key, int32_t size, const uint8_t * metaData )
``` ```
**Description**<br>
Sets the metadata set for a native window. **Description**
Sets a metadata set for an **OHNativeWindow**.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| window | Indicates the pointer to a **NativeWindow** instance. | | window | Pointer to an **OHNativeWindow** instance.|
| sequence | Indicates the sequence of the producer buffer. | | sequence | Sequence of the producer buffer.|
| key | Indicates a metadata key. For details, see **OHHDRMetadataKey**. | | key | Metadata key. For details, see [OHHDRMetadataKey](#ohhdrmetadatakey).|
| size | Indicates the size of the uint8_t vector. | | size | Size of the uint8_t vector.|
| metaData | Indicates the pointer to the uint8_t vector. | | metaData| Pointer to the uint8_t vector.|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
**Since**
9
**Deprecated**
This function is deprecated since API version 10. No substitute function is provided.
### OH_NativeWindow_NativeWindowSetScalingMode() ### OH_NativeWindow_NativeWindowSetScalingMode()
``` ```
int32_t OH_NativeWindow_NativeWindowSetScalingMode (OHNativeWindow * window, uint32_t sequence, OHScalingMode scalingMode ) int32_t OH_NativeWindow_NativeWindowSetScalingMode (OHNativeWindow * window, uint32_t sequence, OHScalingMode scalingMode )
``` ```
**Description**<br>
Sets the scaling mode for a native window. **Description**
Sets a scaling mode for an **OHNativeWindow**.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| window | Indicates the pointer to a **NativeWindow** instance. | | window | Pointer to an **OHNativeWindow** instance.|
| sequence | Indicates the sequence of the producer buffer. | | sequence | Sequence of the producer buffer.|
| scalingMode | Indicates the scaling mode to set. For details, see **OHScalingMode**. | | scalingMode | Scaling mode to set. For details, see [OHScalingMode](#ohscalingmode).|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
**Since**
9
**Deprecated**
This function is deprecated since API version 10. No substitute function is provided.
### OH_NativeWindow_NativeWindowSetTunnelHandle() ### OH_NativeWindow_NativeWindowSetTunnelHandle()
``` ```
int32_t OH_NativeWindow_NativeWindowSetTunnelHandle (OHNativeWindow * window, const OHExtDataHandle * handle ) int32_t OH_NativeWindow_NativeWindowSetTunnelHandle (OHNativeWindow * window, const OHExtDataHandle * handle )
``` ```
**Description**<br>
Sets a tunnel handle for a native window. **Description**
Sets a tunnel handle to an **OHNativeWindow**.
\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow \@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| window | Indicates the pointer to a **NativeWindow** instance. | | window | Pointer to an **OHNativeWindow** instance.|
| handle | Indicates the pointer to an **[OHExtDataHandle](_o_h_ext_data_handle.md)**. | | handle | Pointer to an [OHExtDataHandle](_o_h_ext_data_handle.md).|
**Returns** **Returns**
Returns an error code defined in **GSError**. Returns **0** if the operation is successful.
**Since**
9
**Deprecated**
This function is deprecated since API version 10. No substitute function is provided.
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
## Overview ## Overview
Defines the extended data handle. The **OHExtDataHandle** module defines the extended data handle.
**Related Modules:** **Since**
9
**Related Modules**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
...@@ -15,41 +19,47 @@ Defines the extended data handle. ...@@ -15,41 +19,47 @@ Defines the extended data handle.
### Member Variables ### Member Variables
| Name | Description | | Name| Description:|
| -------- | -------- | | -------- | -------- |
| [fd](#fd) | File descriptor handle. The value **-1** indicates that the handle is not supported. | | [fd](#fd) | File descriptor handle. The value **-1** indicates that the handle is not supported.|
| [reserveInts](#reserveints) | Number of reserved arrays. | | [reserveInts](#reserveints) | Number of reserved arrays.|
| [reserve](#reserve) [0] | Reserve array. | | [reserve](#reserve) [0] | Reserved array.|
## Member Variable Description ## Member Variable Description
### fd ### fd
``` ```
int32_t OHExtDataHandle::fd int32_t OHExtDataHandle::fd
``` ```
**Description**<br>
**Description**
File descriptor handle. The value **-1** indicates that the handle is not supported. File descriptor handle. The value **-1** indicates that the handle is not supported.
### reserve ### reserve
``` ```
int32_t OHExtDataHandle::reserve[0] int32_t OHExtDataHandle::reserve[0]
``` ```
**Description**<br>
Reserve array. **Description**
Reserved array.
### reserveInts ### reserveInts
``` ```
uint32_t OHExtDataHandle::reserveInts uint32_t OHExtDataHandle::reserveInts
``` ```
**Description**<br>
**Description**
Number of reserved arrays. Number of reserved arrays.
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
## Overview ## Overview
Defines the HDR metadata. The **OHHDRMetaData** module defines the HDR metadata.
**Related Modules:** **Since**
9
**Related Modules**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
...@@ -15,30 +19,34 @@ Defines the HDR metadata. ...@@ -15,30 +19,34 @@ Defines the HDR metadata.
### Member Variables ### Member Variables
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [key](#key) | Key of the HDR metadata. | | [key](#key) | HDR metadata key.|
| [value](#value) | Value corresponding to the metadata key. | | [value](#value) | Value of the key.|
## Member Variable Description ## Member Variable Description
### key ### key
``` ```
OHHDRMetadataKey OHHDRMetaData::key OHHDRMetadataKey OHHDRMetaData::key
``` ```
**Description**<br>
Key of the HDR metadata. **Description**
HDR metadata key.
### value ### value
``` ```
float OHHDRMetaData::value float OHHDRMetaData::value
``` ```
**Description**<br>
Value corresponding to the metadata key. **Description**
Value of the key.
...@@ -3,10 +3,13 @@ ...@@ -3,10 +3,13 @@
## Overview ## Overview
If **rects** is a null pointer, the buffer size is the same as the size of the dirty region by default. The **Rect** module describes a rectangle on the display.
**Since**
**Related Modules:** 8
**Related Modules**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
...@@ -14,25 +17,25 @@ If **rects** is a null pointer, the buffer size is the same as the size of the d ...@@ -14,25 +17,25 @@ If **rects** is a null pointer, the buffer size is the same as the size of the d
## Summary ## Summary
### Member Variables ### Member Variables
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| x | Start X coordinate of the rectangle. | | [x](#x) | Start X coordinate of the rectangle.|
| y | Start Y coordinate of the rectangle. | | [y](#y) | Start Y coordinate of the rectangle.|
| w | Width of the rectangle. | | [w](#w) | Width of the rectangle.|
| h | Height of the rectangle. | | [h](#h) | Height of the rectangle.|
## Member Variable Description
### x ### x
``` ```
int32_t Rect::x int32_t Rect::x
``` ```
**Description**<br>
**Description**
Start X coordinate of the rectangle. Start X coordinate of the rectangle.
...@@ -42,16 +45,21 @@ Start X coordinate of the rectangle. ...@@ -42,16 +45,21 @@ Start X coordinate of the rectangle.
``` ```
int32_t Rect::y int32_t Rect::y
``` ```
**Description**<br>
**Description**
Start Y coordinate of the rectangle. Start Y coordinate of the rectangle.
### w ### w
``` ```
int32_t Rect::w uint32_t Rext::w
``` ```
**Description**<br>
**Description**
Width of the rectangle. Width of the rectangle.
...@@ -59,7 +67,9 @@ Width of the rectangle. ...@@ -59,7 +67,9 @@ Width of the rectangle.
``` ```
int32_t Rect::h uint32_t Rect::h
``` ```
**Description**<br>
**Description**
Height of the rectangle. Height of the rectangle.
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
## Overview ## Overview
Defines the rectangle (dirty region) where the content is to be updated in the local native window. The **Region** module defines the rectangle (dirty region) where the content is to be updated in the local NativeWindow.
**Related Modules:** **Since**
8
**Related Modules**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
...@@ -13,16 +17,12 @@ Defines the rectangle (dirty region) where the content is to be updated in the l ...@@ -13,16 +17,12 @@ Defines the rectangle (dirty region) where the content is to be updated in the l
## Summary ## Summary
### Member Variables ### Member Variables
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [rects](#rects) | If **rects** is a null pointer, the buffer size is the same as the size of the dirty region by default. | | [*rects](#rects) | If **rects** is a null pointer, the buffer size is the same as the size of the dirty region by default.|
| [rectNumber](#rectnumber) | If **rectNumber** is **0**, the buffer size is the same as the size of the dirty region by default. | | [rectNumber](#rectnumber) | If **rectNumber** is **0**, the buffer size is the same as the size of the dirty region by default.|
## Member Variable Description
### rectNumber ### rectNumber
...@@ -31,17 +31,19 @@ Defines the rectangle (dirty region) where the content is to be updated in the l ...@@ -31,17 +31,19 @@ Defines the rectangle (dirty region) where the content is to be updated in the l
``` ```
int32_t Region::rectNumber int32_t Region::rectNumber
``` ```
**Description**<br>
**Description**
If **rectNumber** is **0**, the buffer size is the same as the size of the dirty region by default. If **rectNumber** is **0**, the buffer size is the same as the size of the dirty region by default.
### *rects ### \*rects
``` ```
struct Rect Region::*rects struct Rect Region::*rects
``` ```
**Description**<br> **Description**
If **rects** is a null pointer, the buffer size is the same as the size of the dirty region by default.
<!--no_check--> Pointer to the struct. The type is [Rect](_rect.md). If **rects** is a null pointer, the buffer size is the same as the size of the dirty region by default.
\ No newline at end of file
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
## Overview ## Overview
Defines the functions for obtaining and using a native window. The **external_window.h** file declares the functions for obtaining and using **NativeWindow**.
**Since**
**Since:**
8 8
**Related Modules:** **Related Modules**
[NativeWindow](_native_window.md) [NativeWindow](_native_window.md)
...@@ -18,49 +19,49 @@ Defines the functions for obtaining and using a native window. ...@@ -18,49 +19,49 @@ Defines the functions for obtaining and using a native window.
### Structs ### Structs
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [Region](_region.md) | Defines the rectangle (dirty region) where the content is to be updated in the local native window. | | [Region](_region.md) | Defines the rectangle (dirty region) where the content is to be updated in the local **OHNativeWindow**.|
| [Region::Rect](_rect.md) | Rectangular area. | | [Region::Rect](_rect.md) | Describes a rectangle on the display.|
| [OHHDRMetaData](_o_h_h_d_r_meta_data.md) | Defines the HDR metadata. | | [OHHDRMetaData](_o_h_h_d_r_meta_data.md) | Defines the HDR metadata.|
| [OHExtDataHandle](_o_h_ext_data_handle.md) | Defines the extended data handle. | | [OHExtDataHandle](_o_h_ext_data_handle.md) | Defines the extended data handle.|
### Types ### Types
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OHNativeWindow](_native_window.md) | Provides the function of accessing the **NativeWindow**. | | [OHNativeWindow](_native_window.md#ohnativewindow) | Provides the capability of accessing the **OHNativeWindow**.|
| [OHNativeWindowBuffer](_native_window.md) | Provides the function of accessing the **NativeWindowBuffer**. | | [OHNativeWindowBuffer](_native_window.md#ohnativewindowbuffer) | Provides the capability of accessing the **OHNativeWindowBuffer**.|
| [Region](_native_window.md) | Defines the rectangle (dirty region) where the content is to be updated in the local native window. | | [Region](_native_window.md#region) | Defines the rectangle (dirty region) where the content is to be updated in the local **OHNativeWindow**.|
### Enums ### Enums
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [NativeWindowOperation](_native_window.md#nativewindowoperation) {<br/>[SET_BUFFER_GEOMETRY](_native_window.md), [GET_BUFFER_GEOMETRY](_native_window.md), [GET_FORMAT](_native_window.md), [SET_FORMAT](_native_window.md),<br/>[GET_USAGE](_native_window.md), [SET_USAGE](_native_window.md), [SET_STRIDE](_native_window.md), [GET_STRIDE](_native_window.md),<br/>[SET_SWAP_INTERVAL](_native_window.md), [GET_SWAP_INTERVAL](_native_window.md), [SET_TIMEOUT](_native_window.md), [GET_TIMEOUT](_native_window.md),<br/>[SET_COLOR_GAMUT](_native_window.md), [GET_COLOR_GAMUT](_native_window.md), [SET_TRANSFORM](_native_window.md), [GET_TRANSFORM](_native_window.md),<br/>[SET_UI_TIMESTAMP](_native_window.md)<br/>} | Enumerates the operation codes in the **OH_NativeWindow_NativeWindowHandleOpt** function. | | [NativeWindowOperation](_native_window.md#nativewindowoperation) {<br>[SET_BUFFER_GEOMETRY](_native_window.md), [GET_BUFFER_GEOMETRY](_native_window.md), [GET_FORMAT](_native_window.md), [SET_FORMAT](_native_window.md),<br>[GET_USAGE](_native_window.md), [SET_USAGE](_native_window.md), [SET_STRIDE](_native_window.md), [GET_STRIDE](_native_window.md),<br>[SET_SWAP_INTERVAL](_native_window.md), [GET_SWAP_INTERVAL](_native_window.md), [SET_TIMEOUT](_native_window.md), [GET_TIMEOUT](_native_window.md),<br>[SET_COLOR_GAMUT](_native_window.md), [GET_COLOR_GAMUT](_native_window.md), [SET_TRANSFORM](_native_window.md), [GET_TRANSFORM](_native_window.md),<br>[SET_UI_TIMESTAMP](_native_window.md)<br>} | Enumerates the operation codes in the **OH_NativeWindow_NativeWindowHandleOpt** function.|
| [OHScalingMode](_native_window.md#ohscalingmode) { [OH_SCALING_MODE_FREEZE](_native_window.md) = 0, [OH_SCALING_MODE_SCALE_TO_WINDOW](_native_window.md), [OH_SCALING_MODE_SCALE_CROP](_native_window.md), [OH_SCALING_MODE_NO_SCALE_CROP](_native_window.md) } | Enumerates the scaling modes. | | [OHScalingMode](_native_window.md#ohscalingmode) { [OH_SCALING_MODE_FREEZE](_native_window.md) = 0, [OH_SCALING_MODE_SCALE_TO_WINDOW](_native_window.md), [OH_SCALING_MODE_SCALE_CROP](_native_window.md), [OH_SCALING_MODE_NO_SCALE_CROP](_native_window.md) } | Enumerates the scaling modes.|
| [OHHDRMetadataKey](_native_window.md#ohhdrmetadatakey) {<br/>[OH_METAKEY_RED_PRIMARY_X](_native_window.md) = 0, [OH_METAKEY_RED_PRIMARY_Y](_native_window.md) = 1, [OH_METAKEY_GREEN_PRIMARY_X](_native_window.md) = 2, [OH_METAKEY_GREEN_PRIMARY_Y](_native_window.md) = 3,<br/>[OH_METAKEY_BLUE_PRIMARY_X](_native_window.md) = 4, [OH_METAKEY_BLUE_PRIMARY_Y](_native_window.md) = 5, [OH_METAKEY_WHITE_PRIMARY_X](_native_window.md) = 6, [OH_METAKEY_WHITE_PRIMARY_Y](_native_window.md) = 7,<br/>[OH_METAKEY_MAX_LUMINANCE](_native_window.md) = 8, [OH_METAKEY_MIN_LUMINANCE](_native_window.md) = 9, [OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL](_native_window.md) = 10, [OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL](_native_window.md) = 11,<br/>[OH_METAKEY_HDR10_PLUS](_native_window.md) = 12, [OH_METAKEY_HDR_VIVID](_native_window.md) = 13<br/>} | Enumerates the HDR metadata keys. | | [OHHDRMetadataKey](_native_window.md#ohhdrmetadatakey) {<br>[OH_METAKEY_RED_PRIMARY_X](_native_window.md) = 0, [OH_METAKEY_RED_PRIMARY_Y](_native_window.md) = 1, [OH_METAKEY_GREEN_PRIMARY_X](_native_window.md) = 2, [OH_METAKEY_GREEN_PRIMARY_Y](_native_window.md) = 3,<br>[OH_METAKEY_BLUE_PRIMARY_X](_native_window.md) = 4, [OH_METAKEY_BLUE_PRIMARY_Y](_native_window.md) = 5, [OH_METAKEY_WHITE_PRIMARY_X](_native_window.md) = 6, [OH_METAKEY_WHITE_PRIMARY_Y](_native_window.md) = 7,<br>[OH_METAKEY_MAX_LUMINANCE](_native_window.md) = 8, [OH_METAKEY_MIN_LUMINANCE](_native_window.md) = 9, [OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL](_native_window.md) = 10, [OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL](_native_window.md) = 11,<br>[OH_METAKEY_HDR10_PLUS](_native_window.md) = 12, [OH_METAKEY_HDR_VIVID](_native_window.md) = 13<br>} | Enumerates the HDR metadata keys.|
### Functions ### Functions
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_NativeWindow_CreateNativeWindow](_native_window.md#oh_nativewindow_createnativewindow) (void \*pSurface) | [OHNativeWindow](_native_window.md) \*<br/>Creates a **NativeWindow** instance. A new **NativeWindow** instance is created each time this function is called. | | [OH_NativeWindow_CreateNativeWindow](_native_window.md#oh_nativewindow_createnativewindow) (void \*pSurface) | Creates an **OHNativeWindow** instance. A new **OHNativeWindow** instance is created each time this function is called.|
| [OH_NativeWindow_DestroyNativeWindow](_native_window.md#oh_nativewindow_destroynativewindow) ([OHNativeWindow](_native_window.md) \*window) | Decreases the reference count of a **NativeWindow** instance by 1 and when the reference count reaches 0, destroys the instance. | | [OH_NativeWindow_DestroyNativeWindow](_native_window.md#oh_nativewindow_destroynativewindow) (OHNativeWindow \*window) | Decreases the reference count of an **OHNativeWindow** instance by 1 and when the reference count reaches 0, destroys the instance.|
| [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](_native_window.md#oh_nativewindow_createnativewindowbufferfromsurfacebuffer) (void \*pSurfaceBuffer) | [OHNativeWindowBuffer](_native_window.md) \*<br/>Creates a **NativeWindowBuffer** instance. A new **NativeWindowBuffer** instance is created each time this function is called. | | [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](_native_window.md#oh_nativewindow_createnativewindowbufferfromsurfacebuffer) (void \*pSurfaceBuffer) | Creates an **OHNativeWindowBuffer** instance. A new **OHNativeWindowBuffer** instance is created each time this function is called.|
| [OH_NativeWindow_DestroyNativeWindowBuffer](_native_window.md#oh_nativewindow_destroynativewindowbuffer) ([OHNativeWindowBuffer](_native_window.md) \*buffer) | Decreases the reference count of a **NativeWindowBuffer** instance by 1 and when the reference count reaches 0, destroys the instance. | | [OH_NativeWindow_DestroyNativeWindowBuffer](_native_window.md#oh_nativewindow_destroynativewindowbuffer) (OHNativeWindowBuffer \*buffer) | Decreases the reference count of an **OHNativeWindowBuffer** instance by 1 and when the reference count reaches 0, destroys the instance.|
| [OH_NativeWindow_NativeWindowRequestBuffer](_native_window.md#oh_nativewindow_nativewindowrequestbuffer) ([OHNativeWindow](_native_window.md) \*window, [OHNativeWindowBuffer](_native_window.md) \*\*buffer, int \*fenceFd) | Requests a **NativeWindowBuffer** through a **NativeWindow** instance for content production. | | [OH_NativeWindow_NativeWindowRequestBuffer](_native_window.md#oh_nativewindow_nativewindowrequestbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*\*buffer, int \*fenceFd) | Requests an **OHNativeWindowBuffer** through an **OHNativeWindow** instance for content production.|
| [OH_NativeWindow_NativeWindowFlushBuffer](_native_window.md#oh_nativewindow_nativewindowflushbuffer) ([OHNativeWindow](_native_window.md) \*window, [OHNativeWindowBuffer](_native_window.md) \*buffer, int fenceFd, [Region](_region.md) region) | Flushes the **NativeWindowBuffer** filled with the content to the buffer queue through a **NativeWindow** instance for content consumption. | | [OH_NativeWindow_NativeWindowFlushBuffer](_native_window.md#oh_nativewindow_nativewindowflushbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer, int fenceFd, Region region) | Flushes the **OHNativeWindowBuffer** filled with the content to the buffer queue through an **OHNativeWindow** instance for content consumption.|
| [OH_NativeWindow_NativeWindowAbortBuffer](_native_window.md#oh_nativewindow_nativewindowabortbuffer) ([OHNativeWindow](_native_window.md) \*window, [OHNativeWindowBuffer](_native_window.md) \*buffer) | Returns the **NativeWindowBuffer** to the buffer queue through a **NativeWindow** instance, without filling in any content. The **NativeWindowBuffer** can be used for another request. | | [OH_NativeWindow_NativeWindowAbortBuffer](_native_window.md#oh_nativewindow_nativewindowabortbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer) | Returns the **OHNativeWindowBuffer** to the buffer queue through an **OHNativeWindow** instance, without filling in any content. The **OHNativeWindowBuffer** can be used for a new request.|
| [OH_NativeWindow_NativeWindowHandleOpt](_native_window.md#oh_nativewindow_nativewindowhandleopt) ([OHNativeWindow](_native_window.md) \*window, int code,...) | Sets or obtains the attributes of a native window, including the width, height, and content format. | | [OH_NativeWindow_NativeWindowHandleOpt](_native_window.md#oh_nativewindow_nativewindowhandleopt) (OHNativeWindow*window, int code,...) | Sets or obtains the attributes of an **OHNativeWindow**, including the width, height, and content format.|
| [OH_NativeWindow_GetBufferHandleFromNative](_native_window.md#oh_nativewindow_getbufferhandlefromnative) ([OHNativeWindowBuffer](_native_window.md) \*buffer) | Obtains the pointer to a **BufferHandle** of a **NativeWindowBuffer** instance. | | [OH_NativeWindow_GetBufferHandleFromNative](_native_window.md#oh_nativewindow_getbufferhandlefromnative) (OHNativeWindowBuffer \*buffer) | Obtains the pointer to a **BufferHandle** of an **OHNativeWindowBuffer** instance.|
| [OH_NativeWindow_NativeObjectReference](_native_window.md#oh_nativewindow_nativeobjectreference) (void \*obj) | Adds the reference count of a native object. | | [OH_NativeWindow_NativeObjectReference](_native_window.md#oh_nativewindow_nativeobjectreference) (void \*obj) | Adds the reference count of a native object.|
| [OH_NativeWindow_NativeObjectUnreference](_native_window.md#oh_nativewindow_nativeobjectunreference) (void \*obj) | Decreases the reference count of a native object and when the reference count reaches 0, destroys this object. | | [OH_NativeWindow_NativeObjectUnreference](_native_window.md#oh_nativewindow_nativeobjectunreference) (void \*obj) | Decreases the reference count of a native object and when the reference count reaches 0, destroys this object.|
| [OH_NativeWindow_GetNativeObjectMagic](_native_window.md#oh_nativewindow_getnativeobjectmagic) (void \*obj) | Obtains the magic ID of a native object. | | [OH_NativeWindow_GetNativeObjectMagic](_native_window.md#oh_nativewindow_getnativeobjectmagic) (void \*obj) | Obtains the magic ID of a native object.|
| [OH_NativeWindow_NativeWindowSetScalingMode](_native_window.md#oh_nativewindow_nativewindowsetscalingmode) ([OHNativeWindow](_native_window.md) \*window, uint32_t sequence, [OHScalingMode](_native_window.md#ohscalingmode) scalingMode) | Sets the scaling mode for a native window. | | [OH_NativeWindow_NativeWindowSetScalingMode](_native_window.md#oh_nativewindow_nativewindowsetscalingmode) (OHNativeWindownative_window.md#ohscalingmode) scalingMode) | Sets a scaling mode for an **OHNativeWindow**.|
| [OH_NativeWindow_NativeWindowSetMetaData](_native_window.md#oh_nativewindow_nativewindowsetmetadata) ([OHNativeWindow](_native_window.md) \*window, uint32_t sequence, int32_t size, const [OHHDRMetaData](_o_h_h_d_r_meta_data.md) \*metaData) | Sets the metadata for a native window. | | [OH_NativeWindow_NativeWindowSetMetaData](_native_window.md#oh_nativewindow_nativewindowsetmetadata) (OHNativeWindow \*window, uint32_t sequence, int32_t size, const OHHDRMetaData \*metaData) | Sets metadata for an **OHNativeWindow**.|
| [OH_NativeWindow_NativeWindowSetMetaDataSet](_native_window.md#oh_nativewindow_nativewindowsetmetadataset) ([OHNativeWindow](_native_window.md) \*window, uint32_t sequence, [OHHDRMetadataKey](_native_window.md#ohhdrmetadatakey) key, int32_t size, const uint8_t \*metaData) | Sets the metadata set for a native window. | | [OH_NativeWindow_NativeWindowSetMetaDataSet](_native_window.md#oh_nativewindow_nativewindowsetmetadataset) (OHNativeWindow \*window, uint32_t sequence, OHHDRMetadataKey key, int32_t size, const uint8_t \*metaData) | Sets a metadata set for an **OHNativeWindow**.|
| [OH_NativeWindow_NativeWindowSetTunnelHandle](_native_window.md#oh_nativewindow_nativewindowsettunnelhandle) ([OHNativeWindow](_native_window.md) \*window, const [OHExtDataHandle](_o_h_ext_data_handle.md) \*handle) | Sets a tunnel handle for a native window. | | [OH_NativeWindow_NativeWindowSetTunnelHandle](_native_window.md#oh_nativewindow_nativewindowsettunnelhandle) (OHNativeWindow \*window, const OHExtDataHandle \*handle) | Sets a tunnel handle to an **OHNativeWindow**.|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册