You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
993 B
C++

//////////////////////////////////////////////////////////////////////////////
//文件 TraceContour.h
//主要功能:
//
//程序编写: 2005-12-07
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include "ImageTraceBase.h"
namespace NImage
{
//图像半自动矢量化
class AFX_EXT_CLASS CTraceContour : public CImageTraceBase
{
public:
CTraceContour(void);
virtual ~CTraceContour(void);
public:
int ExtremumTrace(POINT point);
void SetWidthError(double dwe);
double GetWidthError(void);
void SetWidthScale(double dws);
double GetWidthScale(void);
protected:
COLORREF m_curColor;
double m_errWidthError;
double m_errWidthScale;
double cw;
int MaxPD;
int RepeatNum;
double MinAngle(POINT &point);
int GetRange(POINT point,double angle,POINT &begin,POINT &end);
int TraceCurve(POINT point,double angle,int HeadOrTail);
int GetNextPoint(POINT &point,int &r,int state=1);
int IsInCurve(POINT& t);
POINT Direction(POINT &point,int r);
};
};