//---------------------------------------------------------------------------

#ifndef TVmsImageFH
#define TVmsImageFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <stdio.h>
#include <ADODB.hpp>
#include <DB.hpp>
#include <SyncObjs.hpp>
#include <ExtCtrls.hpp>
#include <jpeg.hpp>
#include <GIFimg.hpp>
#include "LibSTLF.hpp"
//---------------------------------------------------------------------------
#include "VitzroCommF.h"
#include "ITSLogF.h"
//---------------------------------------------------------------------------

// VMS 이미지 타입
typedef enum en_vms_image_type
{
	vms_image_type_bmp,			/* 0:비트맵 */
	vms_image_type_gif,			/* 1:GIF */
	vms_image_type_jpg,			/* 2:JPG */
	vms_image_type_pcx			/* 3:PCX */
} EN_VMS_IMAGE_TYPE;

//---------------------------------------------------------------------------
class TCDSImageCell
{
public:
    TCDSImageCell();
    ~TCDSImageCell();

public:
    AnsiString SYMBLIB_NMBR;    //NUMBER(4)	    N	0		심벌라이브러리 번호
    int        CELL_ID;         //NUMBER(4)	    N			셀 ID
    int        POSX;            //NUMBER(4)	    Y	0		이미지내 셀좌표 X
    int        POSY;            //NUMBER(4)	    Y	0		이미지내 셀좌표 Y
    AnsiString VMS_IFSC_ID;     //NUMBER(10)	Y			VMS 정보제공구간 ID
};

//---------------------------------------------------------------------------
class TCDSImage
{
public:
    TCDSImage();
    ~TCDSImage();

public:
	AnsiString  Nmbr;
	int         Type;
    AnsiString  VmsType;
	TImage     *pImage;

public:
    IntMap<TCDSImageCell> FLists;

    void Clear();
};
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
class TCDSImageManager
{
public:
    TCDSImageManager();
    ~TCDSImageManager();

private:

public:
    ListMap<TCDSImage> FLists;
};
//---------------------------------------------------------------------------
typedef std::map<AnsiString, TCDSImage*>::iterator   CDSImageItr;
extern TCDSImageManager *ImageManager;
//---------------------------------------------------------------------------

extern void AssignBmp(TImage *AImage, TStream *AStream);
extern void AssignGif(TImage *AImage, TStream *AStream);
extern void AssignJpg(TImage *AImage, TStream *AStream);

extern void SaveToFileBmp(TImage *AImage, AnsiString AFileName);
extern void SaveToFileGif(TImage *AImage, AnsiString AFileName);
extern void SaveToFileJpg(TImage *AImage, AnsiString AFileName);

extern void SaveToStreamGif(TImage *AImage, TStream *AStream);
extern void SaveToStreamJpg(TImage *AImage, TStream *AStream);
//---------------------------------------------------------------------------


#endif
