/************************************************************************

ＪＰＧファイルをロードしてテクスチャ化するクラス

※設定可能なＪＰＧの大きさはテクスチャで許される大きさのみです。

 *************************************************************************/

/* 多重インクルードの回避 */
#ifndef SYS_JPEGTEXTURE_H_INCLUDED
#define SYS_JPEGTEXTURE_H_INCLUDED

namespace uji{
namespace sys{

/************************************************************************
 ************************************************************************/
class JpegTexture
{
public:
    static const int MAX_WIDTH  = 512;
    static const int MAX_HEIGHT = 256;

	JpegTexture()
	{
		sysApp = uji::sys::SysApp::GetInstance();
	}
	~JpegTexture(){}

	bool Open( const wchar_t *fileName );
    bool Open(const u8 *decodeSrcBuffer, s32 readSize);
	void Close(void);

	u32 GetWidth(void) const { return m_Width; }
	u32 GetHeight(void) const { return m_Height; }
	u8 *GetTextureDataPointer(void) const { return m_RgbBufferJpeg; }

private:
	u8 *m_RgbBufferJpeg;
	u32 m_Width;
	u32 m_Height;
	uji::sys::SysApp *sysApp;
};

} // namespace sys
} // namespace uji

/* 多重インクルードの回避 */
#endif
