mrDarker
2025-08-14 47873f48d17bb8f7602fda73d29b19adcf43fdd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef BASE_VISION_H
#define BASE_VISION_H
 
#ifdef EXPORT_DLL_BASE_DISPLAY
#define EXPORTED_BASE_DISPLAY _declspec(dllexport)
#else
#define EXPORTED_BASE_DISPLAY _declspec(dllimport)
#endif
 
#include "typesdef.h"
 
 
class EXPORTED_BASE_DISPLAY BaseVision
{
public:
    BaseVision();
    ~BaseVision();
 
public:
    //1. »ñÈ¡µ±Ç°µÄÈí¼þ°æ±¾
    static std::string GetVersion(void);
 
    //2. »ñÈ¡¸üÐÂÄÚÈÝ
    static std::string GetUpdate(void);
 
    //3. »ñÈ¡µ±Ç°µÄĿ¼
    static std::string GetAppPathA();
 
public:
    //1. »­¾ØÐÎ
    static bool drawRect1(CDC* pDC, RECT1 rect, bool isDraw, COLORREF color, COLORREF bgColor);
 
    //2. »­Ô²ÐÎ
    static bool drawCircle(CDC* pDC, Circle2D cirle, bool isDraw, COLORREF color, COLORREF bgColor);
 
    //3. »­Ö±Ïß
    static bool drawLine(CDC* pDC, Line2D line, bool isDraw, COLORREF color, COLORREF bgColor);
 
    //4. »­Ê®×Ö¼Û
    static bool drawCross(CDC* pDC, CROSS cross, COLORREF color, int lineWidth);
 
    //5. »­²¼¾ØÐÎ2
    static bool drawRect2(CDC* pDC, RECT2 rect, bool isDraw, COLORREF color, COLORREF bgColor);
 
    //6. Ðýת±ä»»¹«Ê½
    static Point2D rotatePoint(Point2D pt, Point2D ptCenter, double angle);
 
    //7. »­ÈÎÒâÇøÓò
    static bool drawRegion(CDC* pDC, Region2D region, bool isDraw, COLORREF color, COLORREF bgColor);
 
    //8. ³õʼ»¯Í¼Ïñ
    static bool createImage(CImage &image, int width, int height, COLORREF color);
 
    //9. ¿½±´Í¼Ïñ
    static bool copyImage(const CImage *pSrcImage, CImage &destImage);
 
    //10. ×ø±êת»»
    static Point2I toPoint2I(Point2D pt);
 
    //11. ×ø±êת»»
    static Point2D toPoint2D(Point2I pt);
 
    //12. 2µã¾àÀë
    static double distancePP(double x1, double y1, double x2, double y2);
 
    //13. 2µãµÄ½Ç¶È
    static double anglePP(double x1, double y1, double x2, double y2);
 
    //14. ÅжϵãÊÇ·ñÔÚÖ±Ï߽߱çÉÏ
    static bool judgeLinePoint(Point2D pt, Line2D line, double fzDist);
 
    //15. ÅжϵãÓëµãÊÇ·ñÏàÁÚ
    static bool judgePointNear(Point2D pt0, Point2D pt1, double fzDist);
 
    //16. µãµ½Ö±ÏߵľàÀë
    static double distancePL(double px, double py, double lineX1, double lineY1, double lineX2, double lineY2);
 
    //17. Í¼Ïñ¶þÖµ»¯
    static void imageThreshold(CImage *image, int minThreshold, int maxThreshold);
 
    //18. ±¦±´Êý¾Ý
    static bool bmpToImage(CBitmap *pBitmap, CImage &image);
 
    //19. ÅжÏÎļþÊÇ·ñ´æÔÚ
    static bool fileIsExist(std::string fileName);
 
};
 
#endif