Shinya Kitaoka 810553
#pragma once
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
#include "SDef.h"
Toshihiro Shimizu 890ddd
Shinya Kitaoka 79e39b
#include <memory></memory>
Shinya Kitaoka 79e39b
#include <array></array>
Toshihiro Shimizu 890ddd
#include <vector></vector>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//#define MSIZE 3
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct {
Shinya Kitaoka 120a6e
  char val;
Shinya Kitaoka 120a6e
  UCHAR dir;
Toshihiro Shimizu 890ddd
} SVD;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#define NBDIR 4
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class CSDirection {
Shinya Kitaoka 120a6e
  int m_lX, m_lY;
Shinya Kitaoka 120a6e
  std::unique_ptr<uchar[]> m_dir;</uchar[]>
Shinya Kitaoka 120a6e
  std::array<std::unique_ptr<sxyw[]>, NBDIR> m_df;</std::unique_ptr<sxyw[]>
Shinya Kitaoka 120a6e
  int m_lDf;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  void null();
Shinya Kitaoka 120a6e
  void makeDir(UCHAR *sel);
Shinya Kitaoka 120a6e
  UCHAR getDir(const int xx, const int yy, UCHAR *sel);
Shinya Kitaoka 120a6e
  void makeDirFilter(const int sens);
Shinya Kitaoka 120a6e
  UCHAR equalizeDir_GTE50(UCHAR *sel, const int xx, const int yy, const int d);
Shinya Kitaoka 120a6e
  UCHAR equalizeDir_LT50(UCHAR *sel, const int xx, const int yy, const int d);
Shinya Kitaoka 120a6e
  void equalizeDir(UCHAR *sel, const int d);
Shinya Kitaoka 120a6e
  double adjustAngle(const short sum[4], const int Ima, const int Im45,
Shinya Kitaoka 120a6e
                     const int Ip45);
Shinya Kitaoka 120a6e
  double getAngle(const short sum[4], short ma);
Shinya Kitaoka 120a6e
  UCHAR blurRadius(UCHAR *sel, const int xx, const int yy, const int dBlur);
Shinya Kitaoka 120a6e
  void blurRadius(const int dBlur);
Shinya Kitaoka 120a6e
  void setDir01();
Shinya Kitaoka 120a6e
  bool isContourBorder(const int xx, const int yy, const int border);
Shinya Kitaoka 120a6e
  void setContourBorder(const int border);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  CSDirection();
Shinya Kitaoka 120a6e
  CSDirection(const int lX, const int lY, const UCHAR *sel, const int sens);
Shinya Kitaoka 120a6e
  CSDirection(const int lX, const int lY, const UCHAR *sel, const int sens,
Shinya Kitaoka 120a6e
              const int border);
Shinya Kitaoka 120a6e
  virtual ~CSDirection();
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  void doDir();
Shinya Kitaoka 120a6e
  void doRadius(const double rH, const double rLR, const double rV,
Shinya Kitaoka 120a6e
                const double rRL, const int dBlur);
Shinya Kitaoka 120a6e
  void getResult(UCHAR *sel);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // !defined(AFX_SDIRECTION_H__C672AFF1_1A65_11D6_B99E_0040F674BE6A__INCLUDED_)