123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- #include "time.h"
- #ifndef NULL
- #define NULL (void *)0
- #endif
- #ifndef bool
- #define bool char
- #endif
- #define EXIF_STR_MAX_LEN (256)
- #define EXIF_PHOTO_TIME_STR_LEN (20)
- typedef enum
- {
- Source_DTV = 0,
- Source_USB,
- }PhotoAPI_SourceType;
- typedef enum
- {
- PHOTO_STREAM_FILE = 0,
- PHOTO_STREAM_BUFFER,
- }PhotoAPI_StreamMdoe;
- typedef enum
- {
- PHOTO_DECODE_FAIL = 0,
- PHOTO_DECODE_SUCCESS,
- PHOTO_DECODE_FORCESTOP,
- PHOTO_DECODE_DECODING,
- }PhotoAPI_DecodeStatus;
- typedef enum
- {
- OSD_ROT_DIRECTION_CLOCKWISE = 1, //Left
- OSD_ROT_DIRECTION_COUNTERCLOCKWISE, //Right
- }PhotoAPI_OSD_ROT_DIRECTION;
- typedef enum
- {
- PAN_DIRECTION_UP,
- PAN_DIRECTION_DOWN,
- PAN_DIRECTION_LEFT,
- PAN_DIRECTION_RIGHT,
- PAN_DIRECTION_TOTAL,
- }PhotoAPI_VIP_PAN_MODE;
- typedef enum
- {
- PHOTO_DISPLAY_DISABLE = 0,
- PHOTO_DISPLAY_ENABLE,
- }PhotoAPI_PicDisplay_show;
- typedef enum
- {
- PHOTO_DISPLAY_RGB = 0,
- PHOTO_DISPLAY_YUV = 4,
- }PhotoAPI_PicDisplay_DataFMT;
- typedef enum
- {
- PHOTO_NO_EFFECT = 0,
- PHOTO_MOVING_EFFECT,
- PHOTO_SPECIAL_EFFECT,
- }PhotoAPI_Effect_Mode;
- typedef enum
- {
- PHOTO_MOVING_NONE = 0,
- PHOTO_MOVING_LEFT,
- PHOTO_MOVING_RIGHT,
- PHOTO_MOVING_DOWN,
- PHOTO_MOVING_UP,
- } PhotoAPIMovingType_t;
- typedef enum
- {
- PHOTO_ROT_CLOCKWISE = 0,
- PHOTO_ROT_COUNTERCLOCKWISE,
- PHOTO_ROT_180_ANGLE,
- }PhotoAPI_Rotation_Mode;
- typedef enum
- {
- PHOTO_EFFECT_NONE = 0,
- PHOTO_EFFECT_UP,
- PHOTO_EFFECT_DOWN,
- PHOTO_EFFECT_GRID_BOTTEM_RIGHT,
- PHOTO_EFFECT_GRID_BOTTEM_LEFT,
- PHOTO_EFFECT_GRID_UPPER_RIGHT,
- PHOTO_EFFECT_GRID_UPPER_LEFT,
- PHOTO_EFFECT_SPIRAL,
- PHOTO_EFFECT_SHUTTERS,
- PHOTO_EFFECT_RAMDOM_GRID,
- PHOTO_EFFECT_HORIZONTALOPEN,
- PHOTO_EFFECT_VERTICALOPEN,
- PHOTO_EFFECT_RIGHT_SHUTTERS,
- PHOTO_EFFECT_DOWN_SHUTTERS,
- PHOTO_EFFECT_SQUARE_BLOCKS,
- PHOTO_EFFECT_STRIP_DOWN,
- PHOTO_EFFECT_STRIP_LEFT,
- PHOTO_EFFECT_CROSS,
- PHOTO_EFFECT_TURNOVER_DOWN,
- PHOTO_EFFECT_RAMDOM_LINE_VERTICAL,
- PHOTO_EFFECT_RAMDOM_LINE_HORIZONTAL,
- PHOTO_EFFECT_SQUARE_IN,
- PHOTO_EFFECT_BLOCKS_SHUTTERS,
- PHOTO_EFFECT_DIGITAL_BLOCKS_DOWN,
- PHOTO_EFFECT_DIGITAL_BLOCKS_RIGHT,
- PHOTO_EFFECT_STRIP_HORIZONTAL_IN,
- PHOTO_EFFECT_STRIP_VERTICAL_IN,
- PHOTO_EFFECT_DIGITAL_BLOCKS_UP,
- PHOTO_EFFECT_DIGITAL_BLOCKS_LEFT,
- PHOTO_EFFECT_SEQ,
- } PhotoAPIEffectType_t;
- typedef enum
- {
- PHOTO_PIC_ROTATION_0 = 0, /*!< Photo Rotation Angle = 0*/
- PHOTO_PIC_ROTATION_90, /*!< Photo Rotation Angle = 90*/
- PHOTO_PIC_ROTATION_180, /*!< Photo Rotation Angle = 180*/
- PHOTO_PIC_ROTATION_270, /*!< Photo Rotation Angle = 270*/
- } PhotoAPI_Exif_Rotation_Info_t;
- typedef enum
- {
- PHOTO_UNKNOW_FORMAT = 0,
- PHOTO_JPEG_FORMAT,
- PHOTO_PNG_FORMAT,
- PHOTO_BMP_FORMAT,
- PHOTO_GIF_FORMAT,
- PHOTO_TIFF_FORMAT,
- } PhotoAPI_PhotoType_t;
- /*struct tm
- {
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- int tm_isdst;
- };*/
- typedef struct
- {
- struct tm UTC_time; //Last file status change time
- struct tm UTM_time; //Last data modification time
- long long Size; //file size
- } PhotoAPI_File_Details_t;
- typedef struct
- {
- char Make[EXIF_STR_MAX_LEN]; /*!< Exif Make Tag, Manufacturing company, eg. SONY*/
- char Model[EXIF_STR_MAX_LEN]; /*!< Exif Model Tag, Model Name, eg. TX1, NEX5...*/
- unsigned int ISO_Speedrating; /*!< Exof IsoSpeedrating Tag, ISO, eg. 125*/
- PhotoAPI_Exif_Rotation_Info_t Rotation;
- float F_Number;
- unsigned int Shutter_Speed_Denominator;
- unsigned char Datetimeoriginal[EXIF_PHOTO_TIME_STR_LEN];
- } PhotoAPI_Exif_Info_t, *PPhotoAPI_Exif_Info_t;
- typedef struct _PhotoAPI_PicInfo
- {
- PhotoAPI_File_Details_t FileSystem_Info; //file informations
- bool Is_File_Support; //lib support this picture
- bool Is_Thumbnail_Support; //lib support this picture thumbnail
- unsigned int Width; //picture width
- unsigned int Height; //picture height
- unsigned int Thumbnail_Width; //thumbnail width
- unsigned int Thumbnail_Height; //thumbnail height
- unsigned int isProgressiveJPEG; //progressive JPEG
- PhotoAPI_PhotoType_t Photo_Format; //picture file format , jpeg / png / bmp
- PhotoAPI_Exif_Info_t Exif; //Exif infomations
- } PhotoAPI_PicInfo, *PPhotoAPI_PicInfo;
- typedef struct _PhotoAPI_PicFrmInfo
- {
- unsigned int scale_width;
- unsigned int scale_height;
- unsigned int x_onFrame;
- unsigned int y_onFrame;
- } PhotoAPI_PicFrmInfo, *PPhotoAPI_PicFrmInfo;
- typedef struct _PhotoAPI_WinFrmInfo
- {
- unsigned int x_onFrame;
- unsigned int y_onFrame;
- unsigned int Width;
- unsigned int WinWidth;
- unsigned int Height;
- unsigned int WinHeight;
- }PhotoAPI_WinFrmInfo, *PPhotoAPI_WinFrmInfo;
- typedef struct _PhotoAPI_Resolution
- {
- unsigned int Width;
- unsigned int Height;
- }PhotoAPI_Resolution, *PPhotoAPI_Resolution;
- typedef struct _PhotoAPI_THUMB_InitInfo
- {
- unsigned char Is_thumb_decode;
- unsigned char Force_thumb_decode;
- unsigned short thumb_Width;
- unsigned short thumb_Height;
- unsigned short pos_X;
- unsigned short pos_Y;
- }PhotoAPI_THUMB_InitInfo, *PPhotoAPI_THUMB_InitInfo;
- typedef struct _PhotoAPI_StreamInfo
- {
- PhotoAPI_StreamMdoe StreamMode;
- PhotoAPI_Effect_Mode EffectMode;
- int EffectIdx;
- char *FilePath;
- char *DataBufAddr;
- unsigned int DataSize;
- }PhotoAPI_StreamInfo, *PPhotoAPI_StreamInfo;
- int Photo_Init(int Photo_MsgQid, PhotoAPI_SourceType SourceType);
- int Photo_OpenFile_Init(PPhotoAPI_StreamInfo StreamInfo, PPhotoAPI_THUMB_InitInfo pthumb_InitInfo);
- int Photo_Decode(void);
- void Photo_Stop(void);
- void Photo_CloseFile_Exit(void);
- void Photo_Exit (void);
- int Photo_SetFadeEffect (char ucStartVal, char ucEndVal, char ucIncVal);
- void Photo_Rotate (PhotoAPI_Rotation_Mode Mode);
- int Photo_Zoom (char zoom_size);
- int Photo_Zoom_out(char ZoomNum, char ZoomDenom);
- int Photo_Pan(char mode, unsigned int movePixel);
- int Photo_GetWinOnFrameInfo(PPhotoAPI_WinFrmInfo pWinFrame_Info);
- void Photo_GetPanelSize(PPhotoAPI_Resolution pPanelSize);
- void Photo_GetPicDisplaySize(PPhotoAPI_Resolution pDisplaySize);
- void Photo_GetPicOnFrameInfo(PPhotoAPI_PicFrmInfo pPicFrm_Info);
- void Photo_SetPicDisplay(PhotoAPI_PicDisplay_show cShow, PhotoAPI_PicDisplay_DataFMT DataFormat);
- void Photo_ResetVipAddr(void);
- void Photo_ClearDisplayBuffer(void);
- void Photo_SetBGColor(UINT32 bg_color);
- void Photo_SetSourceType(PhotoAPI_SourceType SourceType);
- int Photo_GetPicInfo(char *FilePath, PPhotoAPI_PicInfo pPic_Info);
- int Photo_GetFileInfo(char *FilePath, PPhotoAPI_PicInfo pPic_Info);
- int Photo_Encode_JPG(char * filename,int encode_quality);
- int Photo_SetAspPercent(UINT8 HPercent,UINT8 VPercent,UINT32 mode);
|