// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently

#pragma once

#define _SECURE_SCL 0

#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN            // Exclude rarely-used stuff from Windows headers
#endif

#include "targetver.h"

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // some CString constructors will be explicit

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions

#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h>         // MFC OLE classes
#include <afxodlgs.h>       // MFC OLE dialog classes
#include <afxdisp.h>        // MFC Automation classes
#endif // _AFX_NO_OLE_SUPPORT

#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h>                      // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT

#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h>                     // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT

#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h>           // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>                     // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

#include <afxcontrolbars.h>	// MFC support for ribbon and control bars

#include <math.h>
#include <memory>
#include <algorithm>
#include <vector>
#include <map>
#include <stack>
#include <set>
#include <queue>

#include "../../buzz/xmemdc.h"
#include "../../buzz/MachineInterface.h"


using namespace std;
using namespace std::tr1;

inline COLORREF Blend(COLORREF c, COLORREF d, float a)
{
	return RGB(
		(int)(a * GetRValue(c) + (1 - a) * GetRValue(d)),
		(int)(a * GetGValue(c) + (1 - a) * GetGValue(d)),
		(int)(a * GetBValue(c) + (1 - a) * GetBValue(d)));
}

#define PATTERNXP_DATA_VERSION	3

