#ifndef __SFJP_MYU__AGH_CONTROL_Image_H__
#define __SFJP_MYU__AGH_CONTROL_Image_H__

/*class CImageImplBase{
};
typedef CImageImplBase IImageImpl;*/
class IImageImpl{
public:
	//virtual bool Load(const char* szImageFilePath){return false;};
	virtual bool Load(const char* szImageFilePath)=0;

_AGH_EVENT_ACCESS_MODIFIER:
	virtual void OnDraw()=0;

};
typedef IImageImpl CImageImplBase;

//	CImage
template <typename _BASE = CVisualControlBase>
//class CImageBase : public CVisualControlBase {
class CImageBaseT : public _BASE {
public:
	typedef float angle_t;
protected:
	//AGH_COLOR m_color;
	float m_fScaleX;
	float m_fScaleY;
	angle_t m_fAngle;
	_AGH_RECT m_srcRect;
public:
	CImageBaseT(){
		//m_color = AGHCOLOR_FULLWHITE; <- 2009/04/17 g++のお陰で_BASEにしかこの変数無い事気付いた
		m_fScaleX = 1.0f;
		m_fScaleY = 1.0f;
		m_fAngle = 0.0f;
	}
	virtual ~CImageBaseT(){}	//	デストラクタちゃんと呼ばれるための対策

	//virtual bool Load(const char* szImageFilePath)=0;
	virtual bool Load(const char* szImageFilePath){return false;};

	/*  CVisualControlBase でやります
	virtual void SetAlpha(AGH_BYTE a);
	virtual void SetColorFilter(AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetColorFilter(AGH_BYTE a, AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetFilter(AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetFilter(AGH_BYTE a, AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetRGB(AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetARGB(AGH_BYTE a, AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);*/
	//virtual void SetARGB(AGH_COLOR argb){ m_color = argb; }
	/*virtual void SetXRGB(AGH_COLOR rgb);
	virtual void SetRGB(AGH_COLOR rgb);
	virtual void SetFilter(AGH_COLOR argb);
	virtual void SetArgbFilter(AGH_COLOR argb);
	*/

	virtual void SetSrcRect(int left, int top, int right, int bottom){
		m_srcRect.left = left;
		m_srcRect.top = top;
		m_srcRect.right = right;
		m_srcRect.bottom = bottom;
	}
	virtual void SetSrcRect(_AGH_RECT &rect){
		m_srcRect = rect;
	}

	///////////////////////////////////////////////////

	virtual void SetScale(float fScale){
		m_fScaleX = fScale;
		m_fScaleY = fScale;
	}
	virtual void SetScale(float fScaleX, float fScaleY){
		m_fScaleX = fScaleX;
		m_fScaleY = fScaleY;
	}
	virtual void SetScale(AGHVECTOR2 &vect){
		m_fScaleX = vect.x;
		m_fScaleY = vect.y;
	}
	virtual AGHVECTOR2 GetScale(){ return AGHVECTOR2(m_fScaleX,m_fScaleY); }
	virtual float GetScaleX(){ return m_fScaleX; }
	virtual float GetScaleY(){ return m_fScaleY; }

	virtual void SetAngle(angle_t fAngle){ m_fAngle = fAngle; }
	virtual angle_t GetAngle(){ return m_fAngle; }
};
//typedef CImageBaseT<CVisualControlBase> CImageBase;	<- なんかコンパイルエラーになるんだわ・・・（これもVC++6.0のバグか・・・？
class CImageBase : public CImageBaseT<CVisualControlBase> {
public:
	virtual ~CImageBase(){}	//	デストラクタちゃんと呼ばれるための対策
};

//////////////////////////////////////////////////////////

class CImage : public CImageBase
{

};

//////////////////////////////////////////////////////////

class CImageCore2 : public CImage
{
protected:
	IImageImpl *m_pImpl;
public:
	virtual void OnDraw(){ m_pImpl->OnDraw(); }
	virtual bool Load(const char* szImageFilePath){ return m_pImpl->Load(szImageFilePath); }
};

/*
class CImageCore2
{
protected:
	IImageImpl *m_pImpl;
public:
	virtual void OnDraw(){ m_pImpl->OnDraw(); }
	virtual bool Load(const char* szImageFilePath){ return m_pImpl->Load(szImageFilePath); }
};
*/

/*
//	CImage
//template <typename _BASE = CVisualControlBase>
class CImageBase : public CVisualControlBase {
//class CImageBaseT : public _BASE {
protected:
	//AGH_COLOR m_color;
	float m_fScaleX;
	float m_fScaleY;
	float m_fAngle;
public:
	CImageBase(){
		m_color = AGHCOLOR_FULLWHITE;
		m_fScaleX = 1.0f;
		m_fScaleY = 1.0f;
		m_fAngle = 0.0f;
	}
	//virtual bool Load(const char* szImageFilePath)=0;
	virtual bool Load(const char* szImageFilePath){return false;};

	/*
	virtual void SetAlpha(AGH_BYTE a);
	virtual void SetColorFilter(AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetColorFilter(AGH_BYTE a, AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetFilter(AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetFilter(AGH_BYTE a, AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetRGB(AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);
	virtual void SetARGB(AGH_BYTE a, AGH_BYTE r, AGH_BYTE g, AGH_BYTE b);*/
	//virtual void SetARGB(AGH_COLOR argb){ m_color = argb; }
	/*virtual void SetXRGB(AGH_COLOR rgb);
	virtual void SetRGB(AGH_COLOR rgb);
	virtual void SetFilter(AGH_COLOR argb);
	virtual void SetArgbFilter(AGH_COLOR argb);*//*

	virtual void SetScale(float fScale){
		m_fScaleX = fScale;
		m_fScaleY = fScale;
	}
	virtual void SetScale(float fScaleX, float fScaleY){
		m_fScaleX = fScaleX;
		m_fScaleY = fScaleY;
	}
	virtual void SetAngle(float fAngle){ m_fAngle = fAngle; }
};
*/

#endif//__SFJP_MYU__AGH_CONTROL_Image_H__
