1 /** 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 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. \n 14 * 15 * Description: Provides gfx common data type \n 16 */ 17 18 #ifndef SOC_GFX_TYPE_H 19 #define SOC_GFX_TYPE_H 20 21 #ifdef __cplusplus 22 #if __cplusplus 23 extern "C" { 24 #endif 25 #endif 26 27 /** 28 * @defgroup gfx_type gfx_type 29 * @ingroup gpu_type 30 * @{ 31 */ 32 33 /** 34 * @if Eng 35 * @brief Pixel Format. 36 * @else 37 * @brief 像素格式 38 * @endif 39 */ 40 typedef enum { 41 EXT_GFX_FMT_ARGB8888 = 0x00, 42 EXT_GFX_FMT_KRGB8888 = 0x01, 43 EXT_GFX_FMT_ARGB4444 = 0x02, 44 EXT_GFX_FMT_ARGB1555 = 0x03, 45 EXT_GFX_FMT_ARGB8565 = 0x04, 46 EXT_GFX_FMT_RGB888 = 0x05, 47 EXT_GFX_FMT_RGB444 = 0x06, 48 EXT_GFX_FMT_RGB555 = 0x07, 49 EXT_GFX_FMT_RGB565 = 0x08, 50 EXT_GFX_FMT_A1 = 0x09, 51 EXT_GFX_FMT_A8 = 0x0A, 52 EXT_GFX_FMT_A1B = 0x0D, 53 EXT_GFX_FMT_CLUT1 = 0x10, 54 EXT_GFX_FMT_CLUT2 = 0x11, 55 EXT_GFX_FMT_CLUT4 = 0x12, 56 EXT_GFX_FMT_CLUT8 = 0x13, 57 EXT_GFX_FMT_ACLUT44 = 0x14, 58 EXT_GFX_FMT_ACLUT88 = 0x15, 59 EXT_GFX_FMT_CLUT1B = 0x16, 60 EXT_GFX_FMT_CLUT2B = 0x17, 61 EXT_GFX_FMT_CLUT4B = 0x18, 62 EXT_GFX_FMT_A2 = 0x19, 63 EXT_GFX_FMT_A4 = 0x1A, 64 EXT_GFX_FMT_A2B = 0x1B, 65 EXT_GFX_FMT_A4B = 0x1C, 66 EXT_GFX_FMT_YUV420SP = 0x1D, 67 EXT_GFX_FMT_MAX 68 } ext_gfx_fmt; 69 70 /** 71 * @if Eng 72 * @brief ARGB Pixel Format Component Layout. 73 * @else 74 * @brief ARGB像素格式分量排布 75 * @endif 76 */ 77 typedef enum { 78 EXT_GFX_FMT_ORDER_ARGB = 0x00, 79 EXT_GFX_FMT_ORDER_ARBG = 0x01, 80 EXT_GFX_FMT_ORDER_AGRB = 0x02, 81 EXT_GFX_FMT_ORDER_AGBR = 0x03, 82 EXT_GFX_FMT_ORDER_ABRG = 0x04, 83 EXT_GFX_FMT_ORDER_ABGR = 0x05, 84 85 EXT_GFX_FMT_ORDER_RAGB = 0x06, 86 EXT_GFX_FMT_ORDER_RABG = 0x07, 87 EXT_GFX_FMT_ORDER_RGAB = 0x08, 88 EXT_GFX_FMT_ORDER_RGBA = 0x09, 89 EXT_GFX_FMT_ORDER_RBAG = 0x0a, 90 EXT_GFX_FMT_ORDER_RBGA = 0x0b, 91 92 EXT_GFX_FMT_ORDER_GRAB = 0x0c, 93 EXT_GFX_FMT_ORDER_GRBA = 0x0d, 94 EXT_GFX_FMT_ORDER_GARB = 0x0e, 95 EXT_GFX_FMT_ORDER_GABR = 0x0f, 96 EXT_GFX_FMT_ORDER_GBRA = 0x10, 97 EXT_GFX_FMT_ORDER_GBAR = 0x11, 98 99 EXT_GFX_FMT_ORDER_BRGA = 0x12, 100 EXT_GFX_FMT_ORDER_BRAG = 0x13, 101 EXT_GFX_FMT_ORDER_BGRA = 0x14, 102 EXT_GFX_FMT_ORDER_BGAR = 0x15, 103 EXT_GFX_FMT_ORDER_BARG = 0x16, 104 EXT_GFX_FMT_ORDER_BAGR = 0x17, 105 EXT_GFX_FMT_ORDER_MAX 106 } ext_gfx_argb_order; 107 108 /** 109 * @if Eng 110 * @brief Compression mode. 111 * @else 112 * @brief 压缩模式 113 * @endif 114 */ 115 typedef enum { 116 EXT_GFX_COMPRESS_NONE = 0, /*!< @if Eng uncompressed. 117 @else 非压缩 @endif */ 118 EXT_GFX_COMPRESS_HFBC, /*!< @if Eng Compression mode, ARGB format alpha 2x compression. 119 @else 压缩模式, ARGB格式alpha 2倍压缩 @endif */ 120 EXT_GFX_COMPRESS_HFBC_ABYPASS, /*!< @if Eng Compressed mode. ARGB format alpha is not compressed. 121 @else 压缩模式, ARGB格式alpha 非压缩 @endif */ 122 EXT_GFX_COMPRESS_MAX /*!< @if Eng Reserved bit, invalid input. 123 @else 保留位, 非法输入 @endif */ 124 } ext_gfx_compress_mode; 125 126 /** 127 * @} 128 */ 129 130 #ifdef __cplusplus 131 #if __cplusplus 132 } 133 #endif 134 #endif 135 136 #endif /* SOC_GFX_TYPE_H */ 137