1094332d3Sopenharmony_ci/*
2094332d3Sopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3094332d3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4094332d3Sopenharmony_ci * you may not use this file except in compliance with the License.
5094332d3Sopenharmony_ci * You may obtain a copy of the License at
6094332d3Sopenharmony_ci *
7094332d3Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8094332d3Sopenharmony_ci *
9094332d3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10094332d3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11094332d3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12094332d3Sopenharmony_ci * See the License for the specific language governing permissions and
13094332d3Sopenharmony_ci * limitations under the License.
14094332d3Sopenharmony_ci */
15094332d3Sopenharmony_ci
16094332d3Sopenharmony_ci/**
17094332d3Sopenharmony_ci * @addtogroup Display
18094332d3Sopenharmony_ci * @{
19094332d3Sopenharmony_ci *
20094332d3Sopenharmony_ci * @brief Defines driver functions of the display module.
21094332d3Sopenharmony_ci *
22094332d3Sopenharmony_ci * This module provides driver functions for the graphics subsystem, including graphics layer management,
23094332d3Sopenharmony_ci * device control, graphics hardware acceleration, display memory management, and callbacks.
24094332d3Sopenharmony_ci *
25094332d3Sopenharmony_ci * @since 1.0
26094332d3Sopenharmony_ci * @version 1.0
27094332d3Sopenharmony_ci */
28094332d3Sopenharmony_ci
29094332d3Sopenharmony_ci/**
30094332d3Sopenharmony_ci * @file display_layer.h
31094332d3Sopenharmony_ci *
32094332d3Sopenharmony_ci * @brief Declares the driver functions for implementing layer operations.
33094332d3Sopenharmony_ci *
34094332d3Sopenharmony_ci * @since 1.0
35094332d3Sopenharmony_ci * @version 2.0
36094332d3Sopenharmony_ci */
37094332d3Sopenharmony_ci
38094332d3Sopenharmony_ci#ifndef DISPLAY_LAYTER_H
39094332d3Sopenharmony_ci#define DISPLAY_LAYTER_H
40094332d3Sopenharmony_ci#include "display_type.h"
41094332d3Sopenharmony_ci
42094332d3Sopenharmony_ci#ifdef __cplusplus
43094332d3Sopenharmony_ciextern "C" {
44094332d3Sopenharmony_ci#endif
45094332d3Sopenharmony_ci
46094332d3Sopenharmony_ci/**
47094332d3Sopenharmony_ci * @brief Defines pointers to the layer driver functions.
48094332d3Sopenharmony_ci */
49094332d3Sopenharmony_citypedef struct {
50094332d3Sopenharmony_ci    /**
51094332d3Sopenharmony_ci     * @brief Initializes a display device.
52094332d3Sopenharmony_ci     *
53094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
54094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
55094332d3Sopenharmony_ci     *
56094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
57094332d3Sopenharmony_ci     * otherwise.
58094332d3Sopenharmony_ci     * @see DeinitDisplay
59094332d3Sopenharmony_ci     * @since 1.0
60094332d3Sopenharmony_ci     * @version 1.0
61094332d3Sopenharmony_ci     */
62094332d3Sopenharmony_ci    int32_t (*InitDisplay)(uint32_t devId);
63094332d3Sopenharmony_ci
64094332d3Sopenharmony_ci    /**
65094332d3Sopenharmony_ci     * @brief Deinitializes a display device.
66094332d3Sopenharmony_ci     *
67094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
68094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
69094332d3Sopenharmony_ci     *
70094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
71094332d3Sopenharmony_ci     * otherwise.
72094332d3Sopenharmony_ci     * @see InitDisplay
73094332d3Sopenharmony_ci     * @since 1.0
74094332d3Sopenharmony_ci     * @version 1.0
75094332d3Sopenharmony_ci     */
76094332d3Sopenharmony_ci    int32_t (*DeinitDisplay)(uint32_t devId);
77094332d3Sopenharmony_ci
78094332d3Sopenharmony_ci    /**
79094332d3Sopenharmony_ci     * @brief Obtains information about a display device.
80094332d3Sopenharmony_ci     *
81094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
82094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
83094332d3Sopenharmony_ci     * @param dispInfo Indicates the pointer to the display device information obtained.
84094332d3Sopenharmony_ci     *
85094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
86094332d3Sopenharmony_ci     * otherwise.
87094332d3Sopenharmony_ci     * @since 1.0
88094332d3Sopenharmony_ci     * @version 1.0
89094332d3Sopenharmony_ci     */
90094332d3Sopenharmony_ci    int32_t (*GetDisplayInfo)(uint32_t devId, DisplayInfo *dispInfo);
91094332d3Sopenharmony_ci
92094332d3Sopenharmony_ci    /**
93094332d3Sopenharmony_ci     * @brief Opens a layer on a specified display device.
94094332d3Sopenharmony_ci     *
95094332d3Sopenharmony_ci     * Before using a layer on the GUI, you must open the layer based on the layer information. After the layer is
96094332d3Sopenharmony_ci     * opened, you can obtain the layer ID and then use other functions based on the layer ID.
97094332d3Sopenharmony_ci     *
98094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
99094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
100094332d3Sopenharmony_ci     * @param layerInfo Indicates the pointer to the layer information passed to open a layer, including the layer
101094332d3Sopenharmony_ci     * type, layer size, and pixel format.
102094332d3Sopenharmony_ci     * @param layerId Indicates the pointer to the layer ID, which uniquely identifies a layer. The layer ID is returned
103094332d3Sopenharmony_ci     * to the GUI after the layer is successfully opened.
104094332d3Sopenharmony_ci     *
105094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
106094332d3Sopenharmony_ci     * otherwise.
107094332d3Sopenharmony_ci     * @see CloseLayer
108094332d3Sopenharmony_ci     * @since 1.0
109094332d3Sopenharmony_ci     * @version 1.0
110094332d3Sopenharmony_ci     */
111094332d3Sopenharmony_ci
112094332d3Sopenharmony_ci    int32_t (*CreateLayer)(uint32_t devId, const LayerInfo *layerInfo, uint32_t *layerId);
113094332d3Sopenharmony_ci    /**
114094332d3Sopenharmony_ci     * @brief Closes a layer that is no longer required on a specified display device.
115094332d3Sopenharmony_ci     *
116094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
117094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
118094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
119094332d3Sopenharmony_ci     * with the specified layer ID.
120094332d3Sopenharmony_ci     *
121094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
122094332d3Sopenharmony_ci     * otherwise.
123094332d3Sopenharmony_ci     * @see OpenLayer
124094332d3Sopenharmony_ci     * @since 1.0
125094332d3Sopenharmony_ci     * @version 1.0
126094332d3Sopenharmony_ci     */
127094332d3Sopenharmony_ci    int32_t (*CloseLayer)(uint32_t devId, uint32_t layerId);
128094332d3Sopenharmony_ci
129094332d3Sopenharmony_ci    /**
130094332d3Sopenharmony_ci     * @brief Sets whether a layer is visible.
131094332d3Sopenharmony_ci     *
132094332d3Sopenharmony_ci     * A visible layer is displayed on the screen, whereas an invisible layer is not displayed on the screen.
133094332d3Sopenharmony_ci     *
134094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
135094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
136094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
137094332d3Sopenharmony_ci     * with the specified layer ID.
138094332d3Sopenharmony_ci     * @param visible Indicates the visibility to set for the layer. The value <b>true</b> means to set the layer to be
139094332d3Sopenharmony_ci     * visible, and <b>false</b> means the opposite.
140094332d3Sopenharmony_ci     *
141094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
142094332d3Sopenharmony_ci     * otherwise.
143094332d3Sopenharmony_ci     * @see GetLayerVisibleState
144094332d3Sopenharmony_ci     * @since 1.0
145094332d3Sopenharmony_ci     * @version 1.0
146094332d3Sopenharmony_ci     */
147094332d3Sopenharmony_ci    int32_t (*SetLayerVisible)(uint32_t devId, uint32_t layerId, bool visible);
148094332d3Sopenharmony_ci
149094332d3Sopenharmony_ci    /**
150094332d3Sopenharmony_ci     * @brief Checks whether a layer is visible.
151094332d3Sopenharmony_ci     *
152094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
153094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
154094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
155094332d3Sopenharmony_ci     * with the specified layer ID.
156094332d3Sopenharmony_ci     * @param visible Indicates the pointer to the obtained layer visibility. The value <b>true</b> indicates that the
157094332d3Sopenharmony_ci     * layer is visible, and <b>false</b> indicates that the layer is invisible.
158094332d3Sopenharmony_ci     *
159094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
160094332d3Sopenharmony_ci     * otherwise.
161094332d3Sopenharmony_ci     * @see SetLayerVisible
162094332d3Sopenharmony_ci     * @since 1.0
163094332d3Sopenharmony_ci     * @version 1.0
164094332d3Sopenharmony_ci     */
165094332d3Sopenharmony_ci    int32_t (*GetLayerVisibleState)(uint32_t devId, uint32_t layerId, bool *visible);
166094332d3Sopenharmony_ci
167094332d3Sopenharmony_ci    /**
168094332d3Sopenharmony_ci     * @brief Sets the size of a layer.
169094332d3Sopenharmony_ci     *
170094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
171094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
172094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
173094332d3Sopenharmony_ci     * with the specified layer ID.
174094332d3Sopenharmony_ci     * @param rect Indicates the pointer to the layer size to set, in pixels.
175094332d3Sopenharmony_ci     *
176094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
177094332d3Sopenharmony_ci     * otherwise.
178094332d3Sopenharmony_ci     * @see GetLayerSize
179094332d3Sopenharmony_ci     * @since 1.0
180094332d3Sopenharmony_ci     * @version 1.0
181094332d3Sopenharmony_ci     */
182094332d3Sopenharmony_ci    int32_t (*SetLayerSize)(uint32_t devId, uint32_t layerId, IRect *rect);
183094332d3Sopenharmony_ci
184094332d3Sopenharmony_ci    /**
185094332d3Sopenharmony_ci     * @brief Obtains the size of a layer.
186094332d3Sopenharmony_ci     *
187094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
188094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
189094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
190094332d3Sopenharmony_ci     * with the specified layer ID.
191094332d3Sopenharmony_ci     * @param rect Indicates the pointer to the obtained layer size.
192094332d3Sopenharmony_ci     *
193094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
194094332d3Sopenharmony_ci     * otherwise.
195094332d3Sopenharmony_ci     * @see SetLayerSize
196094332d3Sopenharmony_ci     * @since 1.0
197094332d3Sopenharmony_ci     * @version 1.0
198094332d3Sopenharmony_ci     */
199094332d3Sopenharmony_ci    int32_t (*GetLayerSize)(uint32_t devId, uint32_t layerId, IRect *rect);
200094332d3Sopenharmony_ci
201094332d3Sopenharmony_ci    /**
202094332d3Sopenharmony_ci     * @brief Sets the rectangular area to crop for a layer.
203094332d3Sopenharmony_ci     *
204094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
205094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
206094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
207094332d3Sopenharmony_ci     * with the specified layer ID.
208094332d3Sopenharmony_ci     * @param rect Indicates the pointer to the rectangular area to crop.
209094332d3Sopenharmony_ci     *
210094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
211094332d3Sopenharmony_ci     * otherwise.
212094332d3Sopenharmony_ci     * @since 1.0
213094332d3Sopenharmony_ci     * @version 1.0
214094332d3Sopenharmony_ci     */
215094332d3Sopenharmony_ci    int32_t (*SetLayerCrop)(uint32_t devId, uint32_t layerId, IRect *rect);
216094332d3Sopenharmony_ci
217094332d3Sopenharmony_ci    /**
218094332d3Sopenharmony_ci     * @brief Sets the z-order for a layer.
219094332d3Sopenharmony_ci     *
220094332d3Sopenharmony_ci     * A larger z-order value indicates a higher layer.
221094332d3Sopenharmony_ci     *
222094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
223094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
224094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
225094332d3Sopenharmony_ci     * with the specified layer ID.
226094332d3Sopenharmony_ci     * @param zorder Indicates the z-order to set. The value is an integer ranging from 0 to 255.
227094332d3Sopenharmony_ci     *
228094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
229094332d3Sopenharmony_ci     * otherwise.
230094332d3Sopenharmony_ci     * @see GetLayerZorder
231094332d3Sopenharmony_ci     * @since 1.0
232094332d3Sopenharmony_ci     * @version 1.0
233094332d3Sopenharmony_ci     */
234094332d3Sopenharmony_ci    int32_t (*SetLayerZorder)(uint32_t devId, uint32_t layerId, uint32_t zorder);
235094332d3Sopenharmony_ci
236094332d3Sopenharmony_ci    /**
237094332d3Sopenharmony_ci     * @brief Obtains the z-order of a layer.
238094332d3Sopenharmony_ci     *
239094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
240094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
241094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
242094332d3Sopenharmony_ci     * with the specified layer ID.
243094332d3Sopenharmony_ci     * @param zorder Indicates the pointer to the obtained z-order. The value is an integer ranging from 0 to 255.
244094332d3Sopenharmony_ci     * A larger z-order value indicates a higher layer.
245094332d3Sopenharmony_ci     *
246094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
247094332d3Sopenharmony_ci     * otherwise.
248094332d3Sopenharmony_ci     * @see SetLayerZorder
249094332d3Sopenharmony_ci     * @since 1.0
250094332d3Sopenharmony_ci     * @version 1.0
251094332d3Sopenharmony_ci     */
252094332d3Sopenharmony_ci    int32_t (*GetLayerZorder)(uint32_t devId, uint32_t layerId, uint32_t *zorder);
253094332d3Sopenharmony_ci
254094332d3Sopenharmony_ci    /**
255094332d3Sopenharmony_ci     * @brief Sets layer premultiplication.
256094332d3Sopenharmony_ci     *
257094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
258094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
259094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
260094332d3Sopenharmony_ci     * with the specified layer ID.
261094332d3Sopenharmony_ci     * @param preMul Specifies whether to enable layer premultiplication. The value <b>1</b> means to enable layer
262094332d3Sopenharmony_ci     * premultiplication, and <b>0</b> means the opposite.
263094332d3Sopenharmony_ci     *
264094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
265094332d3Sopenharmony_ci     * otherwise.
266094332d3Sopenharmony_ci     * @see GetLayerPreMulti
267094332d3Sopenharmony_ci     * @since 1.0
268094332d3Sopenharmony_ci     * @version 1.0
269094332d3Sopenharmony_ci     */
270094332d3Sopenharmony_ci    int32_t (*SetLayerPreMulti)(uint32_t devId, uint32_t layerId, bool preMul);
271094332d3Sopenharmony_ci
272094332d3Sopenharmony_ci    /**
273094332d3Sopenharmony_ci     * @brief Obtains the premultiplication flag of a layer.
274094332d3Sopenharmony_ci     *
275094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
276094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
277094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
278094332d3Sopenharmony_ci     * with the specified layer ID.
279094332d3Sopenharmony_ci     * @param preMul Indicates the pointer to the obtained layer premultiplication flag.
280094332d3Sopenharmony_ci     *
281094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
282094332d3Sopenharmony_ci     * otherwise.
283094332d3Sopenharmony_ci     * @see SetLayerPreMulti
284094332d3Sopenharmony_ci     * @since 1.0
285094332d3Sopenharmony_ci     * @version 1.0
286094332d3Sopenharmony_ci     */
287094332d3Sopenharmony_ci    int32_t (*GetLayerPreMulti)(uint32_t devId, uint32_t layerId, bool *preMul);
288094332d3Sopenharmony_ci
289094332d3Sopenharmony_ci    /**
290094332d3Sopenharmony_ci     * @brief Sets the alpha value for a layer.
291094332d3Sopenharmony_ci     *
292094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
293094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
294094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
295094332d3Sopenharmony_ci     * with the specified layer ID.
296094332d3Sopenharmony_ci     * @param alpha Indicates the pointer to the alpha value to set.
297094332d3Sopenharmony_ci     *
298094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
299094332d3Sopenharmony_ci     * otherwise.
300094332d3Sopenharmony_ci     * @see GetLayerAlpha
301094332d3Sopenharmony_ci     * @since 1.0
302094332d3Sopenharmony_ci     * @version 1.0
303094332d3Sopenharmony_ci     */
304094332d3Sopenharmony_ci    int32_t (*SetLayerAlpha)(uint32_t devId, uint32_t layerId, LayerAlpha *alpha);
305094332d3Sopenharmony_ci
306094332d3Sopenharmony_ci    /**
307094332d3Sopenharmony_ci     * @brief Obtains the alpha value of a layer.
308094332d3Sopenharmony_ci     *
309094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
310094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
311094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
312094332d3Sopenharmony_ci     * with the specified layer ID.
313094332d3Sopenharmony_ci     * @param alpha Indicates the pointer to the obtained alpha value.
314094332d3Sopenharmony_ci     *
315094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
316094332d3Sopenharmony_ci     * otherwise.
317094332d3Sopenharmony_ci     * @see SetLayerAlpha
318094332d3Sopenharmony_ci     * @since 1.0
319094332d3Sopenharmony_ci     * @version 1.0
320094332d3Sopenharmony_ci     */
321094332d3Sopenharmony_ci    int32_t (*GetLayerAlpha)(uint32_t devId, uint32_t layerId, LayerAlpha *alpha);
322094332d3Sopenharmony_ci
323094332d3Sopenharmony_ci    /**
324094332d3Sopenharmony_ci     * @brief Sets the color key for a layer. The color key is used during layer overlay.
325094332d3Sopenharmony_ci     *
326094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
327094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
328094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
329094332d3Sopenharmony_ci     * with the specified layer ID.
330094332d3Sopenharmony_ci     * @param enable Specify whether to enable the color key.
331094332d3Sopenharmony_ci     * @param key Indicates the color key.
332094332d3Sopenharmony_ci     *
333094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
334094332d3Sopenharmony_ci     * otherwise.
335094332d3Sopenharmony_ci     * @see GetLayerColorKey
336094332d3Sopenharmony_ci     * @since 1.0
337094332d3Sopenharmony_ci     * @version 1.0
338094332d3Sopenharmony_ci     */
339094332d3Sopenharmony_ci    int32_t (*SetLayerColorKey)(uint32_t devId, uint32_t layerId, bool enable, uint32_t key);
340094332d3Sopenharmony_ci
341094332d3Sopenharmony_ci    /**
342094332d3Sopenharmony_ci     * @brief Obtains the color key of a layer.
343094332d3Sopenharmony_ci     *
344094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
345094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
346094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
347094332d3Sopenharmony_ci     * with the specified layer ID.
348094332d3Sopenharmony_ci     * @param enable Indicates the pointer to the color key enable bit.
349094332d3Sopenharmony_ci     * @param key Indicates the pointer to the color key.
350094332d3Sopenharmony_ci     *
351094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
352094332d3Sopenharmony_ci     * otherwise.
353094332d3Sopenharmony_ci     * @see SetLayerColorKey
354094332d3Sopenharmony_ci     * @since 1.0
355094332d3Sopenharmony_ci     * @version 1.0
356094332d3Sopenharmony_ci     */
357094332d3Sopenharmony_ci    int32_t (*GetLayerColorKey)(uint32_t devId, uint32_t layerId, bool *enable, uint32_t *key);
358094332d3Sopenharmony_ci
359094332d3Sopenharmony_ci    /**
360094332d3Sopenharmony_ci     * @brief Sets the palette for a layer.
361094332d3Sopenharmony_ci     *
362094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
363094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
364094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
365094332d3Sopenharmony_ci     * with the specified layer ID.
366094332d3Sopenharmony_ci     * @param palette Indicates the pointer to the palette to set.
367094332d3Sopenharmony_ci     * @param len Indicates the length of the palette.
368094332d3Sopenharmony_ci     *
369094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
370094332d3Sopenharmony_ci     * otherwise.
371094332d3Sopenharmony_ci     * @see GetLayerPalette
372094332d3Sopenharmony_ci     * @since 1.0
373094332d3Sopenharmony_ci     * @version 1.0
374094332d3Sopenharmony_ci     */
375094332d3Sopenharmony_ci    int32_t (*SetLayerPalette)(uint32_t devId, uint32_t layerId, uint32_t *palette, uint32_t len);
376094332d3Sopenharmony_ci
377094332d3Sopenharmony_ci    /**
378094332d3Sopenharmony_ci     * @brief Obtains the palette of a layer.
379094332d3Sopenharmony_ci     *
380094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
381094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
382094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
383094332d3Sopenharmony_ci     * with the specified layer ID.
384094332d3Sopenharmony_ci     * @param palette Indicates the pointer to the obtained palette.
385094332d3Sopenharmony_ci     * @param len Indicates the length of the palette.
386094332d3Sopenharmony_ci     *
387094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
388094332d3Sopenharmony_ci     * otherwise.
389094332d3Sopenharmony_ci     * @see SetLayerPalette
390094332d3Sopenharmony_ci     * @since 1.0
391094332d3Sopenharmony_ci     * @version 1.0
392094332d3Sopenharmony_ci     */
393094332d3Sopenharmony_ci    int32_t (*GetLayerPalette)(uint32_t devId, uint32_t layerId, uint32_t *palette, uint32_t len);
394094332d3Sopenharmony_ci
395094332d3Sopenharmony_ci    /**
396094332d3Sopenharmony_ci     * @brief Sets the transform mode for rotating, scaling, or moving a layer.
397094332d3Sopenharmony_ci     *
398094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
399094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
400094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
401094332d3Sopenharmony_ci     * with the specified layer ID.
402094332d3Sopenharmony_ci     * @param type Indicates the transformation mode to set.
403094332d3Sopenharmony_ci     *
404094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
405094332d3Sopenharmony_ci     * otherwise.
406094332d3Sopenharmony_ci     * @since 1.0
407094332d3Sopenharmony_ci     * @version 1.0
408094332d3Sopenharmony_ci     */
409094332d3Sopenharmony_ci    int32_t (*SetTransformMode)(uint32_t devId, uint32_t layerId, TransformType type);
410094332d3Sopenharmony_ci
411094332d3Sopenharmony_ci    /**
412094332d3Sopenharmony_ci     * @brief Sets the compression feature for a layer.
413094332d3Sopenharmony_ci     *
414094332d3Sopenharmony_ci     * In specific scenarios, images need to be compressed. You can set whether to enable layer compression.
415094332d3Sopenharmony_ci     *
416094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
417094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
418094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
419094332d3Sopenharmony_ci     * with the specified layer ID.
420094332d3Sopenharmony_ci     * @param compType Specifies whether to enable the compression feature. The value <b>true>/b> means to enable
421094332d3Sopenharmony_ci     * compression, and <b>false> means the opposite.
422094332d3Sopenharmony_ci     *
423094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
424094332d3Sopenharmony_ci     * otherwise.
425094332d3Sopenharmony_ci     * @see GetLayerCompression
426094332d3Sopenharmony_ci     * @since 1.0
427094332d3Sopenharmony_ci     * @version 1.0
428094332d3Sopenharmony_ci     */
429094332d3Sopenharmony_ci    int32_t (*SetLayerCompression)(uint32_t devId, uint32_t layerId, int32_t compType);
430094332d3Sopenharmony_ci
431094332d3Sopenharmony_ci    /**
432094332d3Sopenharmony_ci     * @brief Checks whether the compression feature is enabled for a layer.
433094332d3Sopenharmony_ci     *
434094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
435094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
436094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
437094332d3Sopenharmony_ci     * with the specified layer ID.
438094332d3Sopenharmony_ci     * @param compType Indicates the pointer to the variable specifying whether the compression feature is enabled.
439094332d3Sopenharmony_ci     *
440094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
441094332d3Sopenharmony_ci     * otherwise.
442094332d3Sopenharmony_ci     * @see SetLayerCompression
443094332d3Sopenharmony_ci     * @since 1.0
444094332d3Sopenharmony_ci     * @version 1.0
445094332d3Sopenharmony_ci     */
446094332d3Sopenharmony_ci    int32_t (*GetLayerCompression)(uint32_t devId, uint32_t layerId, int32_t *compType);
447094332d3Sopenharmony_ci
448094332d3Sopenharmony_ci    /**
449094332d3Sopenharmony_ci     * @brief Sets the flushing area for a layer.
450094332d3Sopenharmony_ci     *
451094332d3Sopenharmony_ci     * After the GUI draws an image, you must set the layer flushing area before calling the {@link Flush} function to
452094332d3Sopenharmony_ci     * flush the screen.
453094332d3Sopenharmony_ci     *
454094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
455094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
456094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
457094332d3Sopenharmony_ci     * with the specified layer ID.
458094332d3Sopenharmony_ci     * @param region Indicates the pointer to the flushing area to set.
459094332d3Sopenharmony_ci     *
460094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
461094332d3Sopenharmony_ci     * otherwise.
462094332d3Sopenharmony_ci     * @since 1.0
463094332d3Sopenharmony_ci     * @version 1.0
464094332d3Sopenharmony_ci     */
465094332d3Sopenharmony_ci    int32_t (*SetLayerDirtyRegion)(uint32_t devId, uint32_t layerId, IRect *region);
466094332d3Sopenharmony_ci
467094332d3Sopenharmony_ci    /**
468094332d3Sopenharmony_ci     * @brief Obtains the buffer of a layer.
469094332d3Sopenharmony_ci     *
470094332d3Sopenharmony_ci     * After drawing a picture in the buffer, the application calls the {@link Flush} function to display the picture
471094332d3Sopenharmony_ci     * on the screen.
472094332d3Sopenharmony_ci     *
473094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
474094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
475094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
476094332d3Sopenharmony_ci     * with the specified layer ID.
477094332d3Sopenharmony_ci     * @param buffer Indicates the pointer to the obtained buffer.
478094332d3Sopenharmony_ci     *
479094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
480094332d3Sopenharmony_ci     * otherwise.
481094332d3Sopenharmony_ci     * @see Flush
482094332d3Sopenharmony_ci     * @since 1.0
483094332d3Sopenharmony_ci     * @version 1.0
484094332d3Sopenharmony_ci     */
485094332d3Sopenharmony_ci    int32_t (*GetLayerBuffer)(uint32_t devId, uint32_t layerId, LayerBuffer *buffer);
486094332d3Sopenharmony_ci
487094332d3Sopenharmony_ci    /**
488094332d3Sopenharmony_ci     * @brief Flushes a layer.
489094332d3Sopenharmony_ci     *
490094332d3Sopenharmony_ci     * Display data in the buffer is flushed to a specified layer so that the image data is displayed on the screen.
491094332d3Sopenharmony_ci     *
492094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
493094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
494094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
495094332d3Sopenharmony_ci     * with the specified layer ID.
496094332d3Sopenharmony_ci     * @param buffer Indicates the pointer to the buffer in which the display data is to flush.
497094332d3Sopenharmony_ci     *
498094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
499094332d3Sopenharmony_ci     * otherwise.
500094332d3Sopenharmony_ci     * @since 1.0
501094332d3Sopenharmony_ci     * @version 1.0
502094332d3Sopenharmony_ci     */
503094332d3Sopenharmony_ci    int32_t (*Flush)(uint32_t devId, uint32_t layerId, LayerBuffer *buffer);
504094332d3Sopenharmony_ci
505094332d3Sopenharmony_ci    /**
506094332d3Sopenharmony_ci     * @brief Waits for the arrival of vertical blanking.
507094332d3Sopenharmony_ci     *
508094332d3Sopenharmony_ci     * This function blocks the process until vertical blanking arrives, implementing the synchronization between
509094332d3Sopenharmony_ci     * software and hardware.
510094332d3Sopenharmony_ci     *
511094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
512094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
513094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
514094332d3Sopenharmony_ci     * with the specified layer ID.
515094332d3Sopenharmony_ci     * @param timeOut Indicates the maximum duration that the process waits for the arrival of vertical blanking.
516094332d3Sopenharmony_ci     *
517094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
518094332d3Sopenharmony_ci     * otherwise.
519094332d3Sopenharmony_ci     * @since 1.0
520094332d3Sopenharmony_ci     * @version 1.0
521094332d3Sopenharmony_ci     */
522094332d3Sopenharmony_ci    int32_t (*WaitForVBlank)(uint32_t devId, uint32_t layerId, int32_t timeOut);
523094332d3Sopenharmony_ci
524094332d3Sopenharmony_ci    /**
525094332d3Sopenharmony_ci     * @brief Implements the snapshot feature.
526094332d3Sopenharmony_ci     *
527094332d3Sopenharmony_ci     * This function saves the screenshot of image data on the display device to the buffer for debugging or as
528094332d3Sopenharmony_ci     * requested by applications.
529094332d3Sopenharmony_ci     *
530094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
531094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
532094332d3Sopenharmony_ci     * @param buffer Indicates the pointer to the buffer for saving screenshots.
533094332d3Sopenharmony_ci     *
534094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
535094332d3Sopenharmony_ci     * otherwise.
536094332d3Sopenharmony_ci     * @since 1.0
537094332d3Sopenharmony_ci     * @version 1.0
538094332d3Sopenharmony_ci     */
539094332d3Sopenharmony_ci    int32_t (*SnapShot)(uint32_t devId, LayerBuffer *buffer);
540094332d3Sopenharmony_ci
541094332d3Sopenharmony_ci    /**
542094332d3Sopenharmony_ci     * @brief Set the visible region for a layer
543094332d3Sopenharmony_ci     *
544094332d3Sopenharmony_ci     *
545094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
546094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
547094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
548094332d3Sopenharmony_ci     * with the specified layer ID.
549094332d3Sopenharmony_ci     * @param num Indicates the count of rect. the region contains multiple IRect, the num means how much rects in the
550094332d3Sopenharmony_ci     * region.
551094332d3Sopenharmony_ci     * @param rect Indicates the pointer of the rectes.
552094332d3Sopenharmony_ci     *
553094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
554094332d3Sopenharmony_ci     * otherwise.
555094332d3Sopenharmony_ci     * @since 2.0
556094332d3Sopenharmony_ci     * @version 2.0
557094332d3Sopenharmony_ci     */
558094332d3Sopenharmony_ci    int32_t (*SetLayerVisibleRegion)(uint32_t devId, uint32_t layerId, uint32_t num, IRect *rect);
559094332d3Sopenharmony_ci
560094332d3Sopenharmony_ci    /**
561094332d3Sopenharmony_ci     * @brief Set the buffer for a layer.
562094332d3Sopenharmony_ci     *
563094332d3Sopenharmony_ci     *
564094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
565094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
566094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
567094332d3Sopenharmony_ci     * with the specified layer ID.
568094332d3Sopenharmony_ci     * @param buffer Indicates the pointer of the buffer handle. The buffer handle should contain all information of the
569094332d3Sopenharmony_ci     * buffer which will be used for composition.
570094332d3Sopenharmony_ci     * @param fence Indicates the fd of a sync file.
571094332d3Sopenharmony_ci     *
572094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
573094332d3Sopenharmony_ci     * otherwise.
574094332d3Sopenharmony_ci     * @since 2.0
575094332d3Sopenharmony_ci     * @version 2.0
576094332d3Sopenharmony_ci     */
577094332d3Sopenharmony_ci    int32_t (*SetLayerBuffer)(uint32_t devId, uint32_t layerId, const BufferHandle *buffer, int32_t fence);
578094332d3Sopenharmony_ci
579094332d3Sopenharmony_ci    /**
580094332d3Sopenharmony_ci     * @brief Extension interface
581094332d3Sopenharmony_ci     *
582094332d3Sopenharmony_ci     *
583094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
584094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
585094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
586094332d3Sopenharmony_ci     * with the specified layer ID.
587094332d3Sopenharmony_ci     * @param cmd Indicates extension cmd to be used to identify different intention.
588094332d3Sopenharmony_ci     *
589094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
590094332d3Sopenharmony_ci     * otherwise.
591094332d3Sopenharmony_ci     * @since 2.0
592094332d3Sopenharmony_ci     * @version 2.0
593094332d3Sopenharmony_ci     */
594094332d3Sopenharmony_ci    int32_t (*InvokeLayerCmd)(uint32_t devId, uint32_t layerId, uint32_t cmd, ...);
595094332d3Sopenharmony_ci
596094332d3Sopenharmony_ci    /**
597094332d3Sopenharmony_ci     * @brief set the composition type which the client expect
598094332d3Sopenharmony_ci     *
599094332d3Sopenharmony_ci     *
600094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
601094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
602094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
603094332d3Sopenharmony_ci     * with the specified layer ID.
604094332d3Sopenharmony_ci     * @param type Indicates the composition type which the client expect. It may vary with the implementation.
605094332d3Sopenharmony_ci     *
606094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
607094332d3Sopenharmony_ci     * otherwise.
608094332d3Sopenharmony_ci     * @since 2.0
609094332d3Sopenharmony_ci     * @version 2.0
610094332d3Sopenharmony_ci     */
611094332d3Sopenharmony_ci    int32_t (*SetLayerCompositionType)(uint32_t devId, uint32_t layerId, CompositionType type);
612094332d3Sopenharmony_ci
613094332d3Sopenharmony_ci    /**
614094332d3Sopenharmony_ci     * @brief set the blend type
615094332d3Sopenharmony_ci     *
616094332d3Sopenharmony_ci     *
617094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
618094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
619094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
620094332d3Sopenharmony_ci     * with the specified layer ID.
621094332d3Sopenharmony_ci     * @param type Indicates blend type
622094332d3Sopenharmony_ci     *
623094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
624094332d3Sopenharmony_ci     * otherwise.
625094332d3Sopenharmony_ci     * @since 2.0
626094332d3Sopenharmony_ci     * @version 2.0
627094332d3Sopenharmony_ci     */
628094332d3Sopenharmony_ci    int32_t (*SetLayerBlendType)(uint32_t devId, uint32_t layerId, BlendType type);
629094332d3Sopenharmony_ci
630094332d3Sopenharmony_ci    /**
631094332d3Sopenharmony_ci     * @brief Sets a 4x4 color transformation matrix.
632094332d3Sopenharmony_ci     *
633094332d3Sopenharmony_ci     *
634094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
635094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
636094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
637094332d3Sopenharmony_ci     * with the specified layer ID.
638094332d3Sopenharmony_ci     * @param matrix Indicates the 4x4 color transformation matrix.
639094332d3Sopenharmony_ci     *
640094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
641094332d3Sopenharmony_ci     * otherwise.
642094332d3Sopenharmony_ci     * @since 1.0
643094332d3Sopenharmony_ci     * @version 1.0
644094332d3Sopenharmony_ci     */
645094332d3Sopenharmony_ci    int32_t (*SetLayerColorTransform)(uint32_t devId, uint32_t layerId, const float *matrix);
646094332d3Sopenharmony_ci
647094332d3Sopenharmony_ci    /**
648094332d3Sopenharmony_ci     * @brief Sets a color data space for a layer.
649094332d3Sopenharmony_ci     *
650094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
651094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
652094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
653094332d3Sopenharmony_ci     * with the specified layer ID.
654094332d3Sopenharmony_ci     * @param colorSpace Indicates the color data space to set.
655094332d3Sopenharmony_ci     *
656094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
657094332d3Sopenharmony_ci     * otherwise.
658094332d3Sopenharmony_ci     * @since 1.0
659094332d3Sopenharmony_ci     * @version 1.0
660094332d3Sopenharmony_ci     */
661094332d3Sopenharmony_ci    int32_t (*SetLayerColorDataSpace)(uint32_t devId, uint32_t layerId, ColorDataSpace colorSpace);
662094332d3Sopenharmony_ci
663094332d3Sopenharmony_ci    /**
664094332d3Sopenharmony_ci     * @brief Obtains the color data space of a layer.
665094332d3Sopenharmony_ci     *
666094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
667094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
668094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
669094332d3Sopenharmony_ci     * with the specified layer ID.
670094332d3Sopenharmony_ci     * @param colorSpace Indicates the pointer to the color data space obtained.
671094332d3Sopenharmony_ci     *
672094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
673094332d3Sopenharmony_ci     * otherwise.
674094332d3Sopenharmony_ci     * @since 1.0
675094332d3Sopenharmony_ci     * @version 1.0
676094332d3Sopenharmony_ci     */
677094332d3Sopenharmony_ci    int32_t (*GetLayerColorDataSpace)(uint32_t devId, uint32_t layerId, ColorDataSpace *colorSpace);
678094332d3Sopenharmony_ci
679094332d3Sopenharmony_ci    /**
680094332d3Sopenharmony_ci     * @brief Sets metadata for a layer.
681094332d3Sopenharmony_ci     *
682094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
683094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
684094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
685094332d3Sopenharmony_ci     * with the specified layer ID.
686094332d3Sopenharmony_ci     * @param num Indicates the number of metadata records.
687094332d3Sopenharmony_ci     * @param metaData Indicates the pointer to the metadata to set.
688094332d3Sopenharmony_ci     *
689094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
690094332d3Sopenharmony_ci     * otherwise.
691094332d3Sopenharmony_ci     * @since 1.0
692094332d3Sopenharmony_ci     * @version 1.0
693094332d3Sopenharmony_ci     */
694094332d3Sopenharmony_ci    int32_t (*SetLayerMetaData)(uint32_t devId, uint32_t layerId, uint32_t num, const HDRMetaData *metaData);
695094332d3Sopenharmony_ci
696094332d3Sopenharmony_ci    /**
697094332d3Sopenharmony_ci     * @brief Sets a metadata set for a layer.
698094332d3Sopenharmony_ci     *
699094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
700094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
701094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
702094332d3Sopenharmony_ci     * with the specified layer ID.
703094332d3Sopenharmony_ci     * @param key Indicates the metadata key.
704094332d3Sopenharmony_ci     * @param num Indicates the number of metadata records.
705094332d3Sopenharmony_ci     * @param metaData Indicates the pointer to the metadata set of the uint8_t type to set.
706094332d3Sopenharmony_ci     *
707094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
708094332d3Sopenharmony_ci     * otherwise.
709094332d3Sopenharmony_ci     * @since 1.0
710094332d3Sopenharmony_ci     * @version 1.0
711094332d3Sopenharmony_ci     */
712094332d3Sopenharmony_ci    int32_t (*SetLayerMetaDataSet)(uint32_t devId, uint32_t layerId, HDRMetadataKey key, uint32_t num,
713094332d3Sopenharmony_ci                                   const uint8_t *metaData);
714094332d3Sopenharmony_ci
715094332d3Sopenharmony_ci    /**
716094332d3Sopenharmony_ci     * @brief Obtains the hardware display present timestamp type supported by a layer.
717094332d3Sopenharmony_ci     *
718094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
719094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
720094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
721094332d3Sopenharmony_ci     * with the specified layer ID.
722094332d3Sopenharmony_ci     * @param type Indicates the pointer to the present timestamp type obtained.
723094332d3Sopenharmony_ci     *
724094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
725094332d3Sopenharmony_ci     * otherwise.
726094332d3Sopenharmony_ci     * @since 1.0
727094332d3Sopenharmony_ci     * @version 1.0
728094332d3Sopenharmony_ci     */
729094332d3Sopenharmony_ci    int32_t (*GetSupportedPresentTimestamp)(uint32_t devId, uint32_t layerId, PresentTimestampType *type);
730094332d3Sopenharmony_ci
731094332d3Sopenharmony_ci    /**
732094332d3Sopenharmony_ci     * @brief Obtains the hardware display present timestamp of a layer.
733094332d3Sopenharmony_ci     *
734094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
735094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
736094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
737094332d3Sopenharmony_ci     * with the specified layer ID.
738094332d3Sopenharmony_ci     * @param pts Indicates the pointer to the present timestamp obtained.
739094332d3Sopenharmony_ci     *
740094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
741094332d3Sopenharmony_ci     * otherwise.
742094332d3Sopenharmony_ci     * @since 1.0
743094332d3Sopenharmony_ci     * @version 1.0
744094332d3Sopenharmony_ci     */
745094332d3Sopenharmony_ci    int32_t (*GetHwPresentTimestamp)(uint32_t devId, uint32_t layerId, PresentTimestamp *pts);
746094332d3Sopenharmony_ci    /**
747094332d3Sopenharmony_ci     * @brief Sets a tunnel handle for a layer.
748094332d3Sopenharmony_ci     *
749094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
750094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
751094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
752094332d3Sopenharmony_ci     * with the specified layer ID.
753094332d3Sopenharmony_ci     * @param handle Indicates the handle of ExtDataHandle.
754094332d3Sopenharmony_ci     *
755094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
756094332d3Sopenharmony_ci     * otherwise.
757094332d3Sopenharmony_ci     * @since 3.2
758094332d3Sopenharmony_ci     * @version 1.0
759094332d3Sopenharmony_ci     */
760094332d3Sopenharmony_ci    int32_t (*SetLayerTunnelHandle)(uint32_t devId, uint32_t layerId, ExtDataHandle *handle);
761094332d3Sopenharmony_ci    /**
762094332d3Sopenharmony_ci     * @brief Obtains the release fence of a layer.
763094332d3Sopenharmony_ci     *
764094332d3Sopenharmony_ci     * @param devId Indicates the ID of the display device. The value ranges from 0 to 4, where 0 indicates the first
765094332d3Sopenharmony_ci     * display device, and 4 indicates the last display device.
766094332d3Sopenharmony_ci     * @param layerId Indicates the layer ID, which uniquely identifies a layer. You can perform operations on the layer
767094332d3Sopenharmony_ci     * with the specified layer ID.
768094332d3Sopenharmony_ci     * @param fence Indicates the pointer to the release fence obtained.
769094332d3Sopenharmony_ci     *
770094332d3Sopenharmony_ci     * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
771094332d3Sopenharmony_ci     * otherwise.
772094332d3Sopenharmony_ci     * @since 3.2
773094332d3Sopenharmony_ci     * @version 1.0
774094332d3Sopenharmony_ci     */
775094332d3Sopenharmony_ci    int32_t (*GetLayerReleaseFence)(uint32_t devId, uint32_t layerId, int32_t *fence);
776094332d3Sopenharmony_ci} LayerFuncs;
777094332d3Sopenharmony_ci
778094332d3Sopenharmony_ci/**
779094332d3Sopenharmony_ci * @brief Initializes the layer to apply for resources used by the layer and obtain the pointer to functions for
780094332d3Sopenharmony_ci * layer operations.
781094332d3Sopenharmony_ci *
782094332d3Sopenharmony_ci * @param funcs Indicates the double pointer to functions for layer operations. Memory is allocated automatically when
783094332d3Sopenharmony_ci * you initiate the layer module, so you can simply use the pointer to gain access to the functions.
784094332d3Sopenharmony_ci *
785094332d3Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
786094332d3Sopenharmony_ci * otherwise.
787094332d3Sopenharmony_ci * @see LayerUninitialize
788094332d3Sopenharmony_ci * @since 1.0
789094332d3Sopenharmony_ci * @version 1.0
790094332d3Sopenharmony_ci */
791094332d3Sopenharmony_ciint32_t LayerInitialize(LayerFuncs **funcs);
792094332d3Sopenharmony_ci
793094332d3Sopenharmony_ci/**
794094332d3Sopenharmony_ci * @brief Deinitializes the layer module to release the memory allocated to the pointer to functions for
795094332d3Sopenharmony_ci * layer operations.
796094332d3Sopenharmony_ci *
797094332d3Sopenharmony_ci * @param funcs Indicates the pointer to functions for layer operations.
798094332d3Sopenharmony_ci *
799094332d3Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns an error code defined in {@link DispErrCode}
800094332d3Sopenharmony_ci * otherwise.
801094332d3Sopenharmony_ci * @see LayerInitialize
802094332d3Sopenharmony_ci * @since 1.0
803094332d3Sopenharmony_ci * @version 1.0
804094332d3Sopenharmony_ci */
805094332d3Sopenharmony_ciint32_t LayerUninitialize(LayerFuncs *funcs);
806094332d3Sopenharmony_ci
807094332d3Sopenharmony_ci#ifdef __cplusplus
808094332d3Sopenharmony_ci}
809094332d3Sopenharmony_ci#endif
810094332d3Sopenharmony_ci#endif
811094332d3Sopenharmony_ci/** @} */
812