MC3302_SDK_V1.1.9_202507281.../media/sample/common/loadbmp.h
2025-11-11 12:08:31 +08:00

108 lines
3.1 KiB
C
Executable File

#ifndef __LOAD_BMP_H__
#define __LOAD_BMP_H__
#include "fy_type.h"
#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* End of #ifdef __cplusplus */
/* the color format OSD supported */
typedef enum fyOSD_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 fyOSD_RGB_S
{
FH_UINT8 u8B;
FH_UINT8 u8G;
FH_UINT8 u8R;
FH_UINT8 u8Reserved;
}OSD_RGB_S;
typedef struct fyOSD_SURFACE_S
{
OSD_COLOR_FMT_E enColorFmt; /* color format */
FH_UINT8 *pu8PhyAddr; /* physical address */
FH_UINT16 u16Height; /* operation height */
FH_UINT16 u16Width; /* operation width */
FH_UINT16 u16Stride; /* surface stride */
FH_UINT16 u16Reserved;
}OSD_SURFACE_S;
typedef struct tag_OSD_Logo
{
FH_UINT32 width; /* out */
FH_UINT32 height; /* out */
FH_UINT32 stride; /* in */
FH_UINT8 * pRGBBuffer; /* in/out */
}OSD_LOGO_T;
typedef struct tag_OSD_BITMAPINFOHEADER{
FH_UINT16 biSize;
FH_UINT32 biWidth;
FH_SINT32 biHeight;
FH_UINT16 biPlanes;
FH_UINT16 biBitCount;
FH_UINT32 biCompression;
FH_UINT32 biSizeImage;
FH_UINT32 biXPelsPerMeter;
FH_UINT32 biYPelsPerMeter;
FH_UINT32 biClrUsed;
FH_UINT32 biClrImportant;
} OSD_BITMAPINFOHEADER;
typedef struct tag_OSD_BITMAPFILEHEADER {
FH_UINT32 bfSize;
FH_UINT16 bfReserved1;
FH_UINT16 bfReserved2;
FH_UINT32 bfOffBits;
} OSD_BITMAPFILEHEADER;
typedef struct tag_OSD_RGBQUAD {
FH_UINT8 rgbBlue;
FH_UINT8 rgbGreen;
FH_UINT8 rgbRed;
FH_UINT8 rgbReserved;
} OSD_RGBQUAD;
typedef struct tag_OSD_BITMAPINFO {
OSD_BITMAPINFOHEADER bmiHeader;
OSD_RGBQUAD bmiColors[1];
} OSD_BITMAPINFO;
typedef struct fyOSD_COMPONENT_INFO_S{
int alen;
int rlen;
int glen;
int blen;
}OSD_COMP_INFO;
FH_SINT32 LoadImage(const FH_CHAR *filename, OSD_LOGO_T *pVideoLogo);
FH_SINT32 LoadBitMap2Surface(const FH_CHAR *pszFileName, const OSD_SURFACE_S *pstSurface, FH_UINT8 *pu8Virt);
FH_SINT32 CreateSurfaceByBitMap(const FH_CHAR *pszFileName, OSD_SURFACE_S *pstSurface, FH_UINT8 *pu8Virt);
FH_SINT32 CreateSurfaceByCanvas(const FH_CHAR *pszFileName, OSD_SURFACE_S *pstSurface, FH_UINT8 *pu8Virt, FH_UINT32 u32Width, FH_UINT32 u32Height, FH_UINT32 u32Stride);
FH_SINT32 GetBmpInfo(const FH_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__*/