// ImageCache.h: interface for the CImageCache class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_IMAGECACHE_H__46D028E9_5A10_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_IMAGECACHE_H__46D028E9_5A10_11D3_8B36_00902712C9AE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "..\..\Libraries\ImageLib\Image.h"
#define MAXIMAGES 1024

class ImageChain
{
protected:
Image OrgImg;
Image *HFImg;
Image *PrvImg;
Image *TNImg;

public:
ImageChain(); 
void LoadImg(CString str);
void BuildHFImg(int nx,int ny);
void BuildPrvImg(int nx,int ny);
void BuildTNImg(int nx,int ny);
Image *GetImage();
Image *GetHFImage();
Image *GetPrvImage();
Image *GetTNImage();

void SaveChain(FILE *fl);
void LoadChain(FILE *fl);

~ImageChain();

};


class CImageCache  
{
protected:
	ImageChain *ISet[MAXIMAGES];
	int ImgTot;
public:
	static void InitInstance();
	ImageChain *GetChain(CString &str);
	BOOL LoadNextImage(int x,int y);
	void SaveCache(CString fname);
void LoadCache(CString fname);
void SaveCache(FILE *fl);
void LoadCache(FILE *fl);
	void Clear();
	CImageCache();
	static CImageCache *Instance;
	virtual ~CImageCache();

};

#endif // !defined(AFX_IMAGECACHE_H__46D028E9_5A10_11D3_8B36_00902712C9AE__INCLUDED_)
