1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef GRAPHIC_LITE_HI_FBDEV_H
17#define GRAPHIC_LITE_HI_FBDEV_H
18
19#include "gfx_utils/pixel_format_utils.h"
20
21namespace OHOS {
22enum LayerRotateType {
23    LAYER_ROTATE_NONE = 0,        /**< No rotation */
24    LAYER_ROTATE_90,              /**< Rotation by 90 degrees */
25    LAYER_ROTATE_180,             /**< Rotation by 180 degrees */
26    LAYER_ROTATE_270,             /**< Rotation by 270 degrees */
27    LAYER_ROTATE_BUTT             /**< Invalid operation */
28};
29
30struct LiteSurfaceData {
31    ImagePixelFormat pixelFormat;
32    uint16_t width;
33    uint16_t height;
34    uint8_t *virAddr;
35    uint8_t *phyAddr;
36    uint32_t stride;
37    uint8_t bytePerPixel;
38};
39
40/**
41 * @brief Get dev surface data.
42 */
43LiteSurfaceData* GetDevSurfaceData(void);
44
45/**
46 * @brief Get layer rotate type.
47 */
48LayerRotateType GetLayerRotateType(void);
49
50/**
51 * @brief Initialize fbdev.
52 */
53void FbdevInit(void);
54
55/**
56 * @brief Close fbdev.
57 */
58void FbdevClose(void);
59
60/**
61 * @brief flush
62 */
63void FbdevFlush(void);
64} // namespace OHOS
65#endif // GRAPHIC_LITE_HI_FBDEV_H
66