1 
2 /**
3   * @file     	HaasCommonImage.h
4   * @author   	HaasAI Group
5   * @version	V1.0.0
6   * @date    	2021-01-10
7   * @license  	GNU General Public License (GPL)
8   * @brief
9   * @attention
10   *  This file is part of HaasAI.                                \n
11   *  This program is free software; you can redistribute it and/or modify 		\n
12   *  it under the terms of the GNU General Public License version 3 as 		    \n
13   *  published by the Free Software Foundation.                               	\n
14   *  You should have received a copy of the GNU General Public License   		\n
15   *  along with HaasAI. If not, see <http://www.gnu.org/licenses/>.       			\n
16   *  Unless required by applicable law or agreed to in writing, software       	\n
17   *  distributed under the License is distributed on an "AS IS" BASIS,         	\n
18   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  	\n
19   *  See the License for the specific language governing permissions and     	\n
20   *  limitations under the License.   											\n
21   *   																			\n
22   * @htmlonly
23   * <span style="font-weight: bold">History</span>
24   * @endhtmlonly
25   * Version|Author|Date|Describe
26   * ------|----|------|--------
27   * V1.0|HaasAI Group|2021-01-10|Create File
28   * <h2><center>&copy;COPYRIGHT 2021 WELLCASA All Rights Reserved.</center></h2>
29   */
30 #ifndef HAAS_COMMON_IMAGE_H
31 #define HAAS_COMMON_IMAGE_H
32 
33 //#include <cstdint>
34 #include <stdint.h>
35 #include <stdlib.h>
36 //#include <string>
37 #include <string.h>
38 
39 /**@enum PixelFmt_t
40 * @brief Pixel Format Value \n
41 */
42 typedef enum {
43     PIXEL_FMT_NONE    = -1,
44     PIXEL_FMT_YUV420P = 0,
45     PIXEL_FMT_NV21    = 1,
46     PIXEL_FMT_NV12    = 2,
47     PIXEL_FMT_YUYV422 = 3,
48     PIXEL_FMT_YUV422P = 4,
49     PIXEL_FMT_RGB24   = 5,
50     PIXEL_FMT_BGR24   = 6,
51     PIXEL_FMT_ARGB    = 7,
52     PIXEL_FMT_RGBA    = 8,
53     PIXEL_FMT_ABGR    = 9,
54     PIXEL_FMT_BGRA    = 10,
55     PIXEL_FMT_RGB565  = 11,
56 } PixelFmt_t;
57 
58 /**@struct ImagePos_t
59 * @brief image position \n
60 */
61 typedef struct {
62     uint32_t	x;
63     uint32_t	y;
64 } ImagePos_t;
65 
66 /**@struct Point_t
67 * @brief Point information \n
68 */
69 typedef struct {
70     uint32_t	x;
71     uint32_t	y;
72 } Point_t;
73 
74 /**@struct ImageSize_t
75 * @brief Image size infomation \n
76 */
77 typedef struct {
78     uint32_t	width; ///< image size width
79     uint32_t	height; ///< image size height
80 } ImageSize_t;
81 
82 /**@struct ImageBuffer_t
83 * @brief Image buffer information \n
84 */
85 typedef struct {
86     uint32_t		stride;
87     uint32_t		width;
88     uint32_t		height;
89     uint32_t		size;
90     PixelFmt_t	    format;
91     uint32_t	    numPlane;
92     uint8_t*		address[3];
93     uint32_t		linesize[3];
94 } ImageBuffer_t;
95 
96 #endif
97