//*******************************************************************
//
// File: Asura_Direct3D_FSFX.h               
//
// Created: 31 Jul 2006
//
// Description: 
//
//*******************************************************************

#if !defined( _ASURA_DIRECT3D_FSFX_H_)
#define _ASURA_DIRECT3D_FSFX_H_

// other libraries
#include "Core/Asura_HeapArray.h"

// internal dependencies

// forward declarations

//*******************************************************************
// Constants
//*******************************************************************

#define ASURA_FSFX_BLUR_PS2_REFERENCE_SCREEN_WIDTH (512)

//*******************************************************************
// Class Definitions
//*******************************************************************

struct Asura_Direct3D_FSFX_BlurKernalCoeff
{
	float m_fOffset;
	float m_fScale;
};

struct Asura_Direct3D_FSFX_Blur_Vertex
{
	float m_fPositionX;
	float m_fPositionY;
	float m_fPositionZ;
	float m_afTextureOffset[4][2];
	float m_afCoeffs[4];
};

class Asura_Direct3D_FSFX_Blur_Info
{
public:
	u_int uKernalPolygonVertices;
	u_int uKernalPolygonIndices;
	u_int uKernalPolygons;
};

class Asura_Direct3D_FSFX
{
public:
	static bool Component_GaussianBlur_CalcCoeffs( const float fBlurRadius, Asura_HeapArray< Asura_Direct3D_FSFX_BlurKernalCoeff>& xArrayKernalCoeffs, const u_int uKernalCoeffsPerPolygon, u_int& uUsedKernalWidth);
	
	static bool Component_Setup( const u_int uUsedKernalWidth, const u_int uKernalCoeffsPerPolygon, Asura_Direct3D_FSFX_Blur_Info& Info, Asura_HeapArray< Asura_Direct3D_FSFX_Blur_Vertex>& xArrayPolygonVertices, Asura_HeapArray< uint16>& xArrayPolygonIndices);
	static bool Component_Setup_Horizontal( const float fViewWidth, const float fViewHeight, const Asura_Direct3D_FSFX_Blur_Info& xBlurInfo, Asura_HeapArray< Asura_Direct3D_FSFX_BlurKernalCoeff>& xArrayKernalCoeffs, Asura_HeapArray< Asura_Direct3D_FSFX_Blur_Vertex>& xArrayPolygonVertices);
	static bool Component_Setup_Vertical( const float fViewWidth, const float fViewHeight, const float fBufferWidth, const float fBufferHeight, const Asura_Direct3D_FSFX_Blur_Info& xBlurInfo, Asura_HeapArray< Asura_Direct3D_FSFX_BlurKernalCoeff>& xArrayKernalCoeffs, Asura_HeapArray< Asura_Direct3D_FSFX_Blur_Vertex>& xArrayPolygonVertices);

};

//*******************************************************************
// Inline Function Definitions
//*******************************************************************


//*******************************************************************
//
// (c) 2006 Rebellion Ltd
//
//
//*******************************************************************

#endif // _ASURA_DIRECT3D_FSFX_H_
