Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// SDirection.h: interface for the CSDirection class.
Toshihiro Shimizu 890ddd
//
Toshihiro Shimizu 890ddd
//////////////////////////////////////////////////////////////////////
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#if !defined(AFX_SDIRECTION_H__C672AFF1_1A65_11D6_B99E_0040F674BE6A__INCLUDED_)
Toshihiro Shimizu 890ddd
#define AFX_SDIRECTION_H__C672AFF1_1A65_11D6_B99E_0040F674BE6A__INCLUDED_
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#if _MSC_VER > 1000
Toshihiro Shimizu 890ddd
#pragma once
Toshihiro Shimizu 890ddd
#endif // _MSC_VER > 1000
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "SDef.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <vector></vector>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
using namespace std;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//#define MSIZE 3
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct {
Toshihiro Shimizu 890ddd
	char val;
Toshihiro Shimizu 890ddd
	UCHAR dir;
Toshihiro Shimizu 890ddd
} SVD;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#define NBDIR 4
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class CSDirection
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	int m_lX, m_lY;
Toshihiro Shimizu 890ddd
	UCHAR *m_dir;
Toshihiro Shimizu 890ddd
	SXYW *m_df[NBDIR];
Toshihiro Shimizu 890ddd
	int m_lDf;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void null();
Toshihiro Shimizu 890ddd
	void makeDir(UCHAR *sel);
Toshihiro Shimizu 890ddd
	UCHAR getDir(const int xx, const int yy, UCHAR *sel);
Toshihiro Shimizu 890ddd
	void makeDirFilter(const int sens);
Toshihiro Shimizu 890ddd
	UCHAR equalizeDir_GTE50(UCHAR *sel, const int xx, const int yy, const int d);
Toshihiro Shimizu 890ddd
	UCHAR equalizeDir_LT50(UCHAR *sel, const int xx, const int yy, const int d);
Toshihiro Shimizu 890ddd
	void equalizeDir(UCHAR *sel, const int d);
Toshihiro Shimizu 890ddd
	double adjustAngle(const short sum[4], const int Ima,
Toshihiro Shimizu 890ddd
					   const int Im45, const int Ip45);
Toshihiro Shimizu 890ddd
	double getAngle(const short sum[4], short ma);
Toshihiro Shimizu 890ddd
	UCHAR blurRadius(UCHAR *sel, const int xx, const int yy, const int dBlur);
Toshihiro Shimizu 890ddd
	void blurRadius(const int dBlur);
Toshihiro Shimizu 890ddd
	void setDir01();
Toshihiro Shimizu 890ddd
	bool isContourBorder(const int xx, const int yy, const int border);
Toshihiro Shimizu 890ddd
	void setContourBorder(const int border);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	CSDirection();
Toshihiro Shimizu 890ddd
	CSDirection(const int lX, const int lY, const UCHAR *sel, const int sens);
Toshihiro Shimizu 890ddd
	CSDirection(const int lX, const int lY, const UCHAR *sel, const int sens, const int border);
Toshihiro Shimizu 890ddd
	virtual ~CSDirection();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void doDir();
Toshihiro Shimizu 890ddd
	void doRadius(const double rH, const double rLR,
Toshihiro Shimizu 890ddd
				  const double rV, const double rRL, const int dBlur);
Toshihiro Shimizu 890ddd
	void getResult(UCHAR *sel);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif // !defined(AFX_SDIRECTION_H__C672AFF1_1A65_11D6_B99E_0040F674BE6A__INCLUDED_)