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

📄 mmidc_win32_simu.h

📁 手机Camera部分上层软件代码
💻 H
📖 第 1 页 / 共 3 页
字号:
/*******************************************************************************
 ** FileName:      DigitalCamera.h                                             *
 ** Author:        Zhemin.Lin&Benny.Zhou                                       *
 ** Date:          2005/8/04                                                   *
 ** CopyRight:     2005, Spreadtrum, Incorporated, All right reserved            *
 ** Description:   define DCAM interface                                       *
 *******************************************************************************

 *******************************************************************************
 **                        Edit History                                        *
 ** -------------------------------------------------------------------------- *
 ** DATE           NAME                   DESCRIPTION                          *
 ** 2005/8/04      Zhemin.Lin&Benny.Zhou      Created                          *
 *******************************************************************************/

#ifndef DIGITALCAMERA_H
#define DIGITALCAMERA_H

#ifdef __cplusplus
	extern "C"
	{
#endif

#include "sci_types.h"

//#include "dc_context.h"

/**---------------------------------------------------------------------------*
 **                         Macro definition                                  *
 **---------------------------------------------------------------------------*/
#define DC_ENCODE_WIDTH_MAX			 1280
#define	ENCODE_WIDTH_MAX			 1600
#define ENCODE_HEIGHT_MAX			 1200
#define QUARTER						 4
#define MCU_BLOCK        		 	 256	 
#define MCU_WIDTH					 2
#define MCU_HEIGHT					 8
#define AF_FRAME_WIDTH				 320
#define AF_FRAME_HEIGHT				 240
#define AF_FRAME_BUF_LEN			 6

/******************************************************************************/
// Description: create and initialize the dc context
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      none
// Output:     s_pst_context
// Return:     0           successful
//             others      failed
// Note:       this function should be called before all other functions
/******************************************************************************/
int DC_CreateContext(void);


/******************************************************************************/
// Description: regisiter sensor handle to DCAM
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      pst_sensor  point to the structure of the sensor specification
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       this function should be called before DC_Open()
/******************************************************************************/
typedef enum

{

         SENSOR_MODE_BEGIN,
		 
		 SENSOR_MODE_176X144_NORMAL,
		 
		 SENSOR_MODE_176X144_NIGHT,

         SENSOR_MODE_320X240_NORMAL,              //SENSOR_MODE_QVGA_NORMAL,         //320X240

         SENSOR_MODE_320X240_NIGHT,                   //SENSOR_MODE_QVGA_NIGHT,             

         SENSOR_MODE_640X480_NORMAL,              //SENSOR_MODE_VGA_NORMAL,  //640X480

         SENSOR_MODE_640X480_NIGHT,                   //SENSOR_MODE_VGA_NIGHT,

         SENSOR_MODE_1280X1024_NORMAL,          //SENSOR_MODE_SXGA_NORMAL,         //1280X1024

         SENSOR_MODE_1280X1024_NIGHT,     //SENSOR_MODE_SXGA_NIGHT,
 
         SENSOR_MODE_1600X1200_NORMAL,
		 
		 SENSOR_MODE_1600X1200_NIGHT,
         
         SENSOR_MODE_800X600_NORMAL,
		 
		 SENSOR_MODE_800X600_NIGHT,
		 
		 SENSOR_MODE_400X300_NORMAL,
		 
		 SENSOR_MODE_400X300_NIGHT,
		 
		 SENSOR_MODE_200X150_NORMAL,
		 
		 SENSOR_MODE_200X150_NIGHT,
                  
         SENSOR_MODE_END,
         
         
         SENSOR_EFFECT_BRIGHTNESS_BEGIN,     

         SENSOR_EFFECT_BRIGHTNESS_0,

         SENSOR_EFFECT_BRIGHTNESS_1,

         SENSOR_EFFECT_BRIGHTNESS_2,

         SENSOR_EFFECT_BRIGHTNESS_3,

         SENSOR_EFFECT_BRIGHTNESS_4,

         SENSOR_EFFECT_BRIGHTNESS_5,

         SENSOR_EFFECT_BRIGHTNESS_6,

         SENSOR_EFFECT_BRIGHTNESS_7,

         SENSOR_EFFECT_BRIGHTNESS_8,

         SENSOR_EFFECT_BRIGHTNESS_END,

 

         SENSOR_EFFECT_CONTRAST_BEGIN,          

         SENSOR_EFFECT_CONTRAST_0,

         SENSOR_EFFECT_CONTRAST_1,

         SENSOR_EFFECT_CONTRAST_2,

         SENSOR_EFFECT_CONTRAST_3,

         SENSOR_EFFECT_CONTRAST_4,

         SENSOR_EFFECT_CONTRAST_5,

         SENSOR_EFFECT_CONTRAST_6,

         SENSOR_EFFECT_CONTRAST_END,

 

         SENSOR_EFFECT_SEPIA_BEGIN,           

         SENSOR_EFFECT_SEPIA_NORMAL,             

         SENSOR_EFFECT_SEPIA_BLACKWHITE,       

         SENSOR_EFFECT_SEPIA_BLUE,            

         SENSOR_EFFECT_SEPIA_GREEN,                  

         SENSOR_EFFECT_SEPIA_RED,             

         SENSOR_EFFECT_SEPIA_CANVAS,                 

         SENSOR_EFFECT_SEPIA_NEGATIVE,    

         SENSOR_EFFECT_SEPIA_END,

         SENSOR_EFFECT_VFLIP_ENABLE,
         
         SENSOR_EFFECT_VFLIP_DISABLE,
         
         SENSOR_SEQUENCE_END

}DC_SENSOR_MODE_E;

typedef struct
{
	DC_SENSOR_MODE_E   i_name;                    /* unique id for the sequence, 0 is invalidate*/
	uint32             i_clk;                     /*XCLK for the sequence*/
	//uint32			   seq_len;					  /*length of the sequence*/
	const uint8  (*pp_sequence)[];  			  /* sequence arranged by {{addr, reg, val,..,} }*/
									  			 
									  			   

}SENSOR_SEQUENCE_T;

typedef struct
{
	uint8 vsync_pol;	                             /*Polarity of Vsync 0: Low 1: High*/ 
	uint8 hsync_pol;								 /*Polarity of Hsync 0: Low 1: High*/ 
	uint8 pclk_pol;									 /*Polarity of Pixel
													  0: Positive edge to strobe data 
													  1: Negative edge to strobe datah
													 */
	uint8 cap_frame_num;	                         /*Frame number to capture in single mode*/
	uint8 y_shift;									 /*Sensor Y data translation*/
	uint8 uv_shift;									 /*Sensor UV data translation*/
	
	uint8 i2c_write_addr;							 /*I2C slave address for write*/							
	uint8 i2c_read_addr;							 /*I2C slave address for read*/
	uint8 i2c_cmd_array_len;						 /*the length of the I2C command array,expect slave address
													   if sequence arranged by {addr, reg, val} 	   (8bit_width),  length should be 2 
													   if sequence arranged by {addr, reg, val1, val2} (16bit_width), length should be 3											 
													 */
													 
													 
	int (*pf_poweron)(void);                   /* power on & reset the sensor*/
	int (*pf_poweroff)(void); 	               /* power off the sensor*/
	const SENSOR_SEQUENCE_T *p_mode_sequence;  /* must terminated by {0,0}*/
	const SENSOR_SEQUENCE_T *p_img_effect;     /* must terminated by {0,0}*/
}SENSOR_SPEC_T;

#define DC_SCALE_OP_FACTOR			0x01
#define DC_SCALE_OP_FRACTION		0x02
#define DC_SCALE_OP_ALL				0xff

typedef struct
{
	uint8    b_dec_x;
	uint8    b_frac_x;
	uint8    b_dec_y;
	uint8    b_frac_y;
}SCALE_T;

int DC_RegisterSensorSpec(SENSOR_SPEC_T *pst_sensor);


/******************************************************************************/
// Description: regisiter lcd handle to DCAM
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      i_lcd       which lcd, 0 refer to main lcd, 1 refer to sub lcd
//			   pst_lcd     point to the structure of the lcd specification
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       this function should be called before DC_Open()
/******************************************************************************/
typedef struct
{
	uint16 w_width;        /*lcd width*/
	uint16 w_height;       /*lcd width*/
	int    i_rgb_mode;     /*rgb mode*/
}DC_LCD_SPEC_T;

int DC_RegisterLcdSpec(int i_lcd, DC_LCD_SPEC_T *pst_lcd);

/******************************************************************************/
// Description: open DCAM device
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      none
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       before using DCAM device, be sure you have successful open it
/******************************************************************************/
int DC_Open(uint8 *p_buf,uint32 dw_len);

/******************************************************************************/
// Description: close DCAM device
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      none
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       none
/******************************************************************************/
int DC_Close(void);



typedef struct
{
	uint16 w_start_x;
	uint16 w_start_y;
	uint16 w_width;
	uint16 w_height;
}RECT_T;

/******************************************************************************/
// Description: set preview parameters
// Author:     Zhemin.Lin&Benny.Zhou
// Input:      pst_param   point to the preview parameter
// Output:     none
// Return:     0           successful
//             others      failed
// Note:       before start preview, call this function to set parameters
/******************************************************************************/
typedef struct
{
	int    i_sensor_sequence;      /* sensor mode*/
	RECT_T st_trim_rect;           /* trim rectangular*/
	int    i_lcd;                  /* display on which lcd*/
	RECT_T st_disp_rect;           /* display rectangular on LCD*/
	int    i_frame_rate;           /* frame rate*/
	int    b_prefilter;            /* if 0, disable prefilter, else enable*/
	int    i_smooth;               /* if prefilter is enable, this field specify

⌨️ 快捷键说明

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