• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Bestechnic (Shanghai) Co., Ltd. All rights reserved.
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 #ifndef GRAPHIC_LITE_FBDEV_H
16 #define GRAPHIC_LITE_FBDEV_H
17 
18 #include "gfx_utils/pixel_format_utils.h"
19 
20 namespace OHOS
21 {
22 enum 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 
30 struct 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  */
43 LiteSurfaceData *GetDevSurfaceData();
44 
45 /**
46  * @brief Get layer rotate type.
47  */
48 LayerRotateType GetLayerRotateType();
49 
50 /**
51  * @brief Initialize fbdev.
52  */
53 void FbdevInit(void);
54 
55 /**
56  * @brief Close fbdev.
57  */
58 void FbdevClose();
59 
60 /**
61  * @brief flush
62  */
63 void FbdevFlush();
64 } // namespace OHOS
65 #endif // GRAPHIC_LITE_HI_FBDEV_H
66