-
Notifications
You must be signed in to change notification settings - Fork 1
/
loadbmp.h
107 lines (89 loc) · 2.93 KB
/
loadbmp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#ifndef __LOAD_BMP_H__
#define __LOAD_BMP_H__
#include "hi_type.h"
#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* End of #ifdef __cplusplus */
/* the color format OSD supported */
typedef enum hiOSD_COLOR_FMT_E
{
OSD_COLOR_FMT_RGB444 = 0,
OSD_COLOR_FMT_RGB4444 = 1,
OSD_COLOR_FMT_RGB555 = 2,
OSD_COLOR_FMT_RGB565 = 3,
OSD_COLOR_FMT_RGB1555 = 4,
OSD_COLOR_FMT_RGB888 = 6,
OSD_COLOR_FMT_RGB8888 = 7,
OSD_COLOR_FMT_BUTT
}OSD_COLOR_FMT_E;
typedef struct hiOSD_RGB_S
{
HI_U8 u8B;
HI_U8 u8G;
HI_U8 u8R;
HI_U8 u8Reserved;
}OSD_RGB_S;
typedef struct hiOSD_SURFACE_S
{
OSD_COLOR_FMT_E enColorFmt; /* color format */
HI_U8 *pu8PhyAddr; /* physical address */
HI_U16 u16Height; /* operation height */
HI_U16 u16Width; /* operation width */
HI_U16 u16Stride; /* surface stride */
HI_U16 u16Reserved;
}OSD_SURFACE_S;
typedef struct tag_OSD_Logo
{
HI_U32 width; /* out */
HI_U32 height; /* out */
HI_U32 stride; /* in */
HI_U8 * pRGBBuffer; /* in/out */
}OSD_LOGO_T;
typedef struct tag_OSD_BITMAPINFOHEADER{
HI_U16 biSize;
HI_U32 biWidth;
HI_S32 biHeight;
HI_U16 biPlanes;
HI_U16 biBitCount;
HI_U32 biCompression;
HI_U32 biSizeImage;
HI_U32 biXPelsPerMeter;
HI_U32 biYPelsPerMeter;
HI_U32 biClrUsed;
HI_U32 biClrImportant;
} OSD_BITMAPINFOHEADER;
typedef struct tag_OSD_BITMAPFILEHEADER {
HI_U32 bfSize;
HI_U16 bfReserved1;
HI_U16 bfReserved2;
HI_U32 bfOffBits;
} OSD_BITMAPFILEHEADER;
typedef struct tag_OSD_RGBQUAD {
HI_U8 rgbBlue;
HI_U8 rgbGreen;
HI_U8 rgbRed;
HI_U8 rgbReserved;
} OSD_RGBQUAD;
typedef struct tag_OSD_BITMAPINFO {
OSD_BITMAPINFOHEADER bmiHeader;
OSD_RGBQUAD bmiColors[1];
} OSD_BITMAPINFO;
typedef struct hiOSD_COMPONENT_INFO_S{
int alen;
int rlen;
int glen;
int blen;
}OSD_COMP_INFO;
HI_S32 LoadImage(const HI_CHAR *filename, OSD_LOGO_T *pVideoLogo);
HI_S32 LoadBitMap2Surface(const HI_CHAR *pszFileName, const OSD_SURFACE_S *pstSurface, HI_U8 *pu8Virt);
HI_S32 CreateSurfaceByBitMap(const HI_CHAR *pszFileName, OSD_SURFACE_S *pstSurface, HI_U8 *pu8Virt);
HI_S32 CreateSurfaceByCanvas(const HI_CHAR *pszFileName, OSD_SURFACE_S *pstSurface, HI_U8 *pu8Virt, HI_U32 u32Width, HI_U32 u32Height, HI_U32 u32Stride);
HI_S32 GetBmpInfo(const HI_CHAR *filename, OSD_BITMAPFILEHEADER *pBmpFileHeader,OSD_BITMAPINFO *pBmpInfo);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */
#endif /* End of #ifndef __LOAD_BMP_H__*/