#ifdef _DLL_EXPORT_
#define _PX_ __declspec(dllexport)
#define _CT_ __declspec(dllexport)
#else
#define _PX_
#define _CT_
#endif

/***********/
// Constants
// Image colors
#define GRAY 0
#define COLOR 1

/***********/
// Dib class
class CImage;
//#include "NTadt.h"


#ifndef _CDIB_
#define _CDIB_
class _CT_ CDib:public CObject
{
	DECLARE_SERIAL(CDib)
public:
	// Members
	LPBITMAPINFOHEADER m_bmih;	// Bitmap info header
	LPBYTE m_data;				// Raw data for the image
	CPalette* m_palette;		// Palette
	DWORD m_sizeData;			// Size of the data
	int m_nColors;				// Number of colors used
	int m_width,m_height;		// Size of the image
	int m_virtualWidth;			// Width of the file with byte padding
	int m_byteCount;			// Number of bytes in the data
	// Constructors/Destructor
	CDib();
	CDib(int width,int height,int nbits);
	CDib(CImage *image,int scale =0,float min =0.0f,float max =0.0f);
	CDib(CImage *image,int *mapping, char **mask);
//	CDib(GrayImage image,int *mapping);
//	CDib(RGBImage image,int *mapping);

	CDib(int row,int col,int color,float **data,int scale =0);
	~CDib();
	// Methods
	BOOL Read(CFile *pFile);
	BOOL Write(CFile *pFile);
	BOOL Draw(CDC *pDC,int x,int y,int width,int height);
	BOOL MakePalette();
	BOOL SetSystemPalette(CDC* pDC);
	float **MakeFloatImage(int *row,int *col,int *color);
	int MakeKnownFloatImage(float **image,int color);
};
#endif