2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
// SDirection.h: interface for the CSDirection class.
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#if !defined(AFX_SDIRECTION_H__C672AFF1_1A65_11D6_B99E_0040F674BE6A__INCLUDED_)
|
|
|
|
#define AFX_SDIRECTION_H__C672AFF1_1A65_11D6_B99E_0040F674BE6A__INCLUDED_
|
|
|
|
|
|
|
|
#include "SDef.h"
|
|
|
|
|
2016-04-15 19:44:40 +12:00
|
|
|
#include <memory>
|
|
|
|
#include <array>
|
2016-03-19 06:57:51 +13:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
//#define MSIZE 3
|
|
|
|
|
|
|
|
typedef struct {
|
2016-06-15 18:43:10 +12:00
|
|
|
char val;
|
|
|
|
UCHAR dir;
|
2016-03-19 06:57:51 +13:00
|
|
|
} SVD;
|
|
|
|
|
|
|
|
#define NBDIR 4
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
class CSDirection {
|
|
|
|
int m_lX, m_lY;
|
|
|
|
std::unique_ptr<UCHAR[]> m_dir;
|
|
|
|
std::array<std::unique_ptr<SXYW[]>, NBDIR> m_df;
|
|
|
|
int m_lDf;
|
|
|
|
|
|
|
|
void null();
|
|
|
|
void makeDir(UCHAR *sel);
|
|
|
|
UCHAR getDir(const int xx, const int yy, UCHAR *sel);
|
|
|
|
void makeDirFilter(const int sens);
|
|
|
|
UCHAR equalizeDir_GTE50(UCHAR *sel, const int xx, const int yy, const int d);
|
|
|
|
UCHAR equalizeDir_LT50(UCHAR *sel, const int xx, const int yy, const int d);
|
|
|
|
void equalizeDir(UCHAR *sel, const int d);
|
|
|
|
double adjustAngle(const short sum[4], const int Ima, const int Im45,
|
|
|
|
const int Ip45);
|
|
|
|
double getAngle(const short sum[4], short ma);
|
|
|
|
UCHAR blurRadius(UCHAR *sel, const int xx, const int yy, const int dBlur);
|
|
|
|
void blurRadius(const int dBlur);
|
|
|
|
void setDir01();
|
|
|
|
bool isContourBorder(const int xx, const int yy, const int border);
|
|
|
|
void setContourBorder(const int border);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
CSDirection();
|
|
|
|
CSDirection(const int lX, const int lY, const UCHAR *sel, const int sens);
|
|
|
|
CSDirection(const int lX, const int lY, const UCHAR *sel, const int sens,
|
|
|
|
const int border);
|
|
|
|
virtual ~CSDirection();
|
|
|
|
|
|
|
|
void doDir();
|
|
|
|
void doRadius(const double rH, const double rLR, const double rV,
|
|
|
|
const double rRL, const int dBlur);
|
|
|
|
void getResult(UCHAR *sel);
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
#endif // !defined(AFX_SDIRECTION_H__C672AFF1_1A65_11D6_B99E_0040F674BE6A__INCLUDED_)
|