📄 mmidc_win32_simu.c
字号:
dc_frame.dw_tail_len = 0;//strlen(buf4);
*p_p_frame = &dc_frame;
// dc_frame.p_head = buf1;
// dc_frame.dw_head_len = strlen(buf1);
//
// dc_frame.sections[0].pbuf = buf2;
// dc_frame.sections[0].dw_len = strlen(buf2);
//
// dc_frame.sections[1].pbuf = buf3;
// dc_frame.sections[1].dw_len = strlen(buf3);
//
// dc_frame.dw_total_section_len = strlen(buf2) + strlen(buf3);
//
// dc_frame.p_tail = buf4;
// dc_frame.dw_tail_len = 1000;//strlen(buf4);
//
// *p_p_frame = &dc_frame;
return 0;
}
/******************************************************************************/
// 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)
{
return 0;
}
/******************************************************************************/
// 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
/******************************************************************************/
int DC_SetReviewParam(const DC_REVIEW_PARAM_T *pst_param)
{
return 0;
}
/******************************************************************************/
// 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
)
{
pf_callback(1, 147, 73);
return 0;
}
/******************************************************************************/
// Description: play back a jpg image which is stored in a file
// Author: Zhemin.Lin&Benny.Zhou
// Input: pf_set
// pf_trans
// Output: none
// Return: 0 successful
// others failed
// Note: none
/******************************************************************************/
int DC_PlaybackJpegFromFile(
PLAYBACK_SET_FUNC pf_set,
PLAYBACK_ACQUIREDATA_FUNC pf_trans
)
{
return 0;
}
/******************************************************************************/
// 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(int i_sensor_sequence)
//{
//}
/******************************************************************************/
// 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.
/******************************************************************************/
int DC_SetOsdZoneMode(int i_zone, const DC_OSD_MODE *pst_mode)
{
SCI_MEMCPY(&s_osd_mode[i_zone], pst_mode, sizeof(DC_OSD_MODE));
return 0;
}
/******************************************************************************/
// 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, uint8 *p_data)
{
int i = 0;
int j = 0;
DC_OSD_MODE osd_mode = {0};
GUI_RECT_T rect = {0};
osd_mode = s_osd_mode[i_zone];
// rect.left = osd_mode.st_zone.w_start_x;
// rect.right = osd_mode.st_zone.w_start_x + osd_mode.st_zone.w_width;
// rect.top = osd_mode.st_zone.w_start_y;
// rect.bottom = osd_mode.st_zone.w_start_y + osd_mode.st_zone.w_height;
//
// SCI_ASSERT(rect.right >= rect.left && rect.bottom >= rect.top);
// LCD_FillRect(0, rect, 0xd7bf );
for(i = 0; i < 16/*osd_mode.st_zone.w_height*/; i++)
{
for(j = 0; j < 16/*osd_mode.st_zone.w_width*/; j++)
{
if (p_data[i * 16/*osd_mode.st_zone.w_width*/ + j] && 0xC0 == 0xC0)
{
if ((p_data[i * 16 + j] & 0x3F) == 0x01)
{
//overwirte
LCD_DrawHLine(MAIN_LCD_ID,
osd_mode.st_zone.w_start_x + j,
osd_mode.st_zone.w_start_y + i,
osd_mode.st_zone.w_start_x + j + 1,
0//(s_cr_pallete[p_data[i * 16/*osd_mode.st_zone.w_width*/ + j] & 0x3F]) >> 16
);
}
else if ((p_data[i * 16 + j] & 0x3F) == 0x02)
{
//overwirte
LCD_DrawHLine(MAIN_LCD_ID,
osd_mode.st_zone.w_start_x + j,
osd_mode.st_zone.w_start_y + i,
osd_mode.st_zone.w_start_x + j + 1,
0xFFFF//(s_cr_pallete[p_data[i * 16/*osd_mode.st_zone.w_width*/ + j] & 0x3F]) >> 16
);
}
// //overwirte
// LCD_DrawHLine(MAIN_LCD_ID,
// osd_mode.st_zone.w_start_x + j,
// osd_mode.st_zone.w_start_y + i,
// osd_mode.st_zone.w_start_x + j + 1,
// (s_cr_pallete[p_data[i * 16/*osd_mode.st_zone.w_width*/ + j] & 0x3F]) >> 16
// );
}
else if (p_data[i * 16/*osd_mode.st_zone.w_width*/ + j] && 0xC0 == 0x00)
{
//transparent
//do nothing
}
}
}
return 0;
}
/******************************************************************************/
// 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(uint32 *p_table)
{
SCI_MEMCPY(s_cr_pallete, p_table, 64*4);
return 0;
}
/******************************************************************************/
// 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)
{
return 0;
}
/******************************************************************************/
// 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)
{
return 0;
}
/******************************************************************************/
// Description: Query DCAM current status
// Author: Zhemin.Lin&Benny.Zhou
// Input: none
// Output: none
// Return: current status, 0 refer to idle
// value format is shown as following:
// bit[0] -----------LCM busy
// bit[1] -----------previewing
// bit[2] -----------reviewing
// bit[3] -----------capturing
// bit[15-4]---------reserved
// bit[30-16]--------error category
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -