⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmidc_win32_simu.h

📁 手机Camera部分上层软件代码
💻 H
📖 第 1 页 / 共 3 页
字号:
	                                * the smoothnees the image, the large value
	                                * refer to high smoothness
	                                */
	int8	af_flag;				/*0: normal preview; 1: do continuous autofacus when preview*/
	BOOLEAN b_is_scale;	            /*0: not scale in preview, 1:scale*/
	                                
}DC_PREVIEW_PARAM_T;

int DC_SetPreviewParam(const DC_PREVIEW_PARAM_T *pst_param);

/******************************************************************************/
// Description: start preview
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      pst_param   point to the preview parameter
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       if return successful, the LCD will be on bridge mode
/******************************************************************************/
int DC_StartPreview(void);

/******************************************************************************/
// Description: stop preview
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      none
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       the caller will be pended until the last frame be displayed on
//             lcd. after calling this function lcd will be on bypass mode
/******************************************************************************/
int DC_StopPreview(void);

/******************************************************************************/
// Description: set capture parameters
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      pst_param   point to the capture parameter
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       before start snapshot, be sure the capature parameters has
//             been set successfully.
//             current target jpeg width must equal to trim.width, target height
//             must equal to trim.height
/******************************************************************************/
typedef struct
{
	int    i_sensor_sequence;       /* sensor mode*/
	RECT_T st_trim_rect;            /* trim rectangular*/
	int     b_prefilter;            /* if 0, disable prefilter, else enable*/
	int     i_smooth;               /* if prefilter is enable, this field specify
	                                 * the smoothnees the image, the large value
	                                 * refer to hight smoothness
	                                 */
	int     i_quality;              /* image quality, large value refer to hight quality*/
	uint16	w_target_width;
	         /* target jpeg width*/
	uint16  w_target_height;        /* target jpeg height*/
			 
	uint16	w_zoom_trim_width;		/* zoom target width*/
	uint16	w_zoom_trim_height;		/* zoom target height*/

}DC_CAPTURE_PARAM_T;

int DC_SetCaptureParam(const DC_CAPTURE_PARAM_T *pst_param);

/******************************************************************************/
// Description: start snapshot
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      none
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       if return successful, the LCD will be on bridge mode until
//             capture is done
/******************************************************************************/
int DC_DoSnapshot(void);

/******************************************************************************/
// Description: get snapshot data
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      *pp_buf     memory start address, where jpeg stream is store
//             *pdw_len    jpeg stream len, count in bytes
// Output:
// Return:     0           successful
//             others      failed
// Note:       *pp_buf is allocated by DCAM driver, if the data is no longer
//             used, app MUST call DC_FreeFrame() to free this buffer
/******************************************************************************/
typedef struct
{
	uint8  *p_head;
	uint32 dw_head_len;
	uint32 dw_total_section_len;
	struct {uint8 *pbuf; uint32 dw_len;} sections[2];
	uint8  *p_tail;
	uint32 dw_tail_len;
}DC_FRAME_T;

int DC_GetSnapshotData(DC_FRAME_T **pp_frame);

/******************************************************************************/
// Description: free memory
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      p_buf       frame buffer
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       none
/******************************************************************************/
int DC_FreeFrame(DC_FRAME_T *p_buf);



typedef int (*PLAYBACK_SET_FUNC)(/*when DCAM encount SOF0, it will call this function*/
							  /* returns: 0 successful, others failed*/
	int b_validate,           /* indicate if the stream is validate*/  
	uint16 w_width,           /* if stream is validate, it refer to image width*/
	uint16 w_height           /* if stream is validate, it refer to image height*/
	);

typedef int (*PLAYBACK_ACQUIREDATA_FUNC)(/*when DCAM encount dma transfer done, it will call this function*/
						 /* return: the real data length in the buffer*/
	uint8 *p_buf,        /* where the data will be stored*/
	uint32 dw_len        /* expected data len, app should fill the p_buf as much as possible, but not exceed this value*/
	);

/******************************************************************************/
// Description: set review parameters
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      pst_param   point to the review parameter
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       before start review, call this function to set parameters
/******************************************************************************/
typedef struct
{
	RECT_T st_trim_rect;           /* trim rectangular*/
	int    i_lcd;                  /* display on which lcd*/
	RECT_T st_disp_rect;           /* display rectangular on LCD*/
	int    b_postfilter;           /* if 0, disable postfilter, else enable*/
	int    i_smooth;               /* if postfiler is enable, this field specify
	                                * the smoothnees the image, the large value
	                                * refer to high smoothness
	                                */
	RECT_T  st_norm_rect;           /**/
	BOOLEAN b_is_scale;            /*t-path review mjpg will use this
	                                *if 0, disable scale video when capturing, else enable*/
	BOOLEAN reserved_1;
	uint16 w_target_width;
	uint16 w_target_height;
}DC_REVIEW_PARAM_T;

int DC_SetReviewParam(const DC_REVIEW_PARAM_T *pst_param);

/******************************************************************************/
// Description: play back a jpg image which is stored in a buffer
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      p_buf       start address of the jpeg stream
//             pf_callback call back function
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       none
/******************************************************************************/
int DC_PlaybackJpegFromBuf(
							uint8 *p_buf, 
							uint32 len,
							int stream_over,
							PLAYBACK_SET_FUNC pf_callback
						  );



/******************************************************************************/
// Description: set the image effect when preview or capture
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      psz_name    effect name
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       none
/******************************************************************************/
int DC_SetImageEffect(const int i_name);

/******************************************************************************/
// Description: config osd zone
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      i_zone      which zone to be config: 0~5
//             pst_mode    zone mode
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       before call this function, be sure that DCAM device is not
//             in busy state. due to the preview/review/capture share the
//             same osd resource, so config osd before preview/review/capture,
//             otherwise, the DCAM use the last osd config information.
//             after DC_Open, osd default status is all block are disable.
/******************************************************************************/
#define DC_OSD_IMSIZE_2x128  1
#define DC_OSD_IMSIZE_4x64   2
#define DC_OSD_IMSIZE_8x32   3
#define DC_OSD_IMSIZE_16x16  4
#define DC_OSD_IMSIZE_32x8   5
#define DC_OSD_IMSIZE_64x4   6
#define DC_OSD_IMSIZE_128x2  7

typedef struct
{
	int    b_enable;       /* if 0, disable this osd block and other fields in
	                        * this structure will be discaded
	                        */
	int    e_size_mode;    /* image size mode which is used to do osd:
							* 2x128 4x64 8x32 16x16 32x8 64x4 128x2
							*/
	RECT_T st_zone;        /* define the zone to be osd*/
	int    i_expand_factor;/* image expanded factor: 1 2 4*/
}DC_OSD_MODE;

int DC_SetOsdZoneMode(int i_zone, const DC_OSD_MODE *pst_mode);

/******************************************************************************/
// Description: config osd image data
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      i_zone      the osd image in which zone
//             p_image     point to image data, image data size is fixed on 256 bytes
//                         data format is shown as following:
//                         bit[7] bit[6]----- osd operation mode: 
//                                            00 transparent, 
//                                            01 half-transparent
//                                            10 XOR
//                                            11 overwrite
//                         bit[5]..bit[0]-----color index
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       before call this function, be sure that DCAM device is not
//             in busy state. 
/******************************************************************************/
int DC_SetOsdImage(int i_zone, const uint8 *p_data);

/******************************************************************************/
// Description: config osd color palette
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      p_table     color palette, the table must have 64 entries
//                         data format is shown as following:
//                         bit[ 7]~bit[ 0]   V value(-128~127)
//                         bit[15]~bit[ 8]   U value(-128~127)
//                         bit[23]~bit[16]   Y value(-128~127)
//                         bit[31]~bit[24]   reserved
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       before call this function, be sure that DCAM device is not
//             in busy state. 
/******************************************************************************/
int DC_SetOsdColorPalette(const uint32 *p_table);

/******************************************************************************/
// Description: config osd image data when previewing/capturing/reviewing
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      i_zone      the osd image in which zone
//             i_pixel     pixel id from 0~255. 0 top-left , 255 right-bottom 
//                         scaning from left to right and top to bottom.
//             b_value     data value of this pixel
//                         data format is shown as following:
//                         bit[7] bit[6]----- osd operation mode: 
//                                            00 transparent, 
//                                            01 half-transparent
//                                            10 XOR
//                                            11 overwrite
//                         bit[5]..bit[0]-----color index
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       this function can be called when DCAM is busy
/******************************************************************************/
int DC_ModifyOsdImage(int i_zone, int i_pixel, uint8 b_value);

/******************************************************************************/
// Description: set osd enable mode
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      i_flag      enable mode of osd zones
//                         bit[i]  0, the i-th zone is disable
//                         bit[i]  1, the i-th zone is enable
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       before call this function, be sure that DCAM device is not
//             in busy state. 
/******************************************************************************/
int DC_SetOsdEnableMode(int flag);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -