#ifndef FACEREC_IMAGE_H
#define FACEREC_IMAGE_H 1

#include <windows.h>
#include <gdiplus.h>

#pragma comment( lib , "GdiPlus.lib" )

using namespace Gdiplus;

class UnicodeDestroyer {
public:
	WCHAR * Str;
	UnicodeDestroyer() {
		Str = NULL;
	}
	~UnicodeDestroyer() {
		if(Str != NULL)
			delete []Str;
	}
};

class ImageManip {

	inline int ARGB2Pixel(int alpha, int r, int g, int b);
	Bitmap * GetEdge(Bitmap * b);

public:

	WCHAR * ToUnicodeFR ( const char * szStr );
	int * GetPixelData(char * szImgName , int& width , int& height);
	int * Bitmap2PixelData(Gdiplus::Bitmap *b);
	int * GetEdgeData(int * Pix,int W,int H);
	Gdiplus::Bitmap * PixelData2BitMap(int width, int height,
                          int *pixData_ARGB);
	int GetCodecClsid(const char * format, CLSID* pClsid);
};

class GDIP 
{
	GdiplusStartupInput gdiplusStartupInput;
	ULONG_PTR           gdiplusToken;

public:
	void Init();// Initialize GDI+.
	void ShutDown(); 
};

#endif