#ifndef _H_VIEWSYNAPI
#define _H_VIEWSYNAPI

#define REDUCED_RES                   1
#if REDUCED_RES
#define QC_VSP_Asymmetric_Resolution  1
#endif


#if defined (__cplusplus)
extern "C" 
{
#endif

#ifndef IMGTYPE
#define IMGTYPE 0
#endif


#include "typedefs.h"


	typedef struct  
	{
		double m_fIntrinsicMatrix[3][3];
		double m_fExtrinsicMatrix[3][3];
		double m_fTranslationVector[3];

	}CameraParameters;

	typedef struct  
	{
		double   ZLeftNearestDepthValue[3];       //!< 0: Left, 1: Center, 2: Right
		double   ZLeftFarthestDepthValue[3];      //!< 0: Left, 1: Center, 2: Right
		double   ZRightNearestDepthValue[3];      //!< 0: Left, 1: Center, 2: Right
		double   ZRightFarthestDepthValue[3];     //!< 0: Left, 1: Center, 2: Right
		double   Translation[3];                  //!< 0: Left, 1: Center, 2: Right
	}CamParaUpdate;

	typedef struct  
	{
		imgpel** ColorLeft[3];                    //!<Y,U,V in the format of 4:2:0
		imgpel** ColorRight[3];
		imgpel** DepthLeft;                       //!<4:0:0
		imgpel** DepthRight;

		imgpel** ColorSynthesized[3];             //!<the synthesized color(4:2:0)
		imgpel** DepthSynthesized;

	}ViewSynIOFrmData;

	typedef struct  
	{
		int        SourceWidth;
		int        SourceHeight;
#if NOKIA_DISP_CALC_B0150
		int**      disparity_lut_left; //!< disparity look up table [0:quarter-pel, 1:half-pel][depth_value]
		int**      disparity_lut_right; //!< disparity look up table [0:quarter-pel, 1:half-pel][depth_value]
#else
		double     ZLeftNearestDepthValue;
		double     ZLeftFarthestDepthValue;
		double     ZRightNearestDepthValue;
		double     ZRightFarthestDepthValue;
#endif


		int     SubPelOption;
		int     UpsampleRefs;
		int     Filter;
		int     BoundaryNoiseRemoval;
		int     ViewBlending;

		int  SplattingOption;     //!< 0: Disable splatting; 1: Enable splatting; 2: Splatting only along boundaries
		int  BoundaryGrowth;      //!< Only useful for SplattingOption 2
		int  MergingOption;       //!< 0: Z_buffer, 1: camera distance weighting. 2: Z_buffer + hole counting + camera distance weighting
		int  DepthThreshold;      //!< Only useful for MergingOption 2
		int  HoleCountThreshold;  //!< Only useful for MergingOption 2
		int  TemporalImprovementOption;  //!<0: Disable; 1; Enable    Zhejiang,May,4
		int  WarpEnhancementOption;
		int  CleanNoiseOption;    //!<0: Disable; 1; Enable 
		int  SynDirection;        //!<0: from left,1: from right,2: from left and right
#if POZNAN_NONLINEAR_DEPTH
		int   NonlinearDepthNum;
		char  NonlinearDepthPoints[256];
#endif
	}ViewSynParams;
										  
#if NOKIA_DISP_CALC_B0150
	int InitViewSyn(ViewSynParams* pViewSynParams);
#else
	int InitViewSyn(ViewSynParams* pViewSynParams,CameraParameters* pCamParams);
#endif


#if QC_VSP_Asymmetric_Resolution
	int BeginViewSyn(ViewSynIOFrmData* pViewSynIOFrmData, Boolean bMixedRes);	  
#else
	int BeginViewSyn(ViewSynIOFrmData* pViewSynIOFrmData);	  //!<
#endif

#if defined (__cplusplus)
}
#endif

#endif

