#ifndef TOOLSCLASS_H
#define TOOLSCLASS_H

#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>

class ToolsClass
{
    public:
        ToolsClass();
        ~ToolsClass();

        void CalcAngle();

        void mathRotatedPoint(double degree, double x1, double y1, double x0, double y0, double *x2, double *y2);

        void imgRotatedPoint(double degree, double x, double y, double x0, double y0, double *rx, double *ry);

        int GetMathCircleCenter(double x1, double y1, double x2, double y2, double x3, double y3, double *cx, double *cy,
                                int *radius);

        int GetGravityCenter(cv::Mat *img, double refPosX, double refPosY, double *gravityPosX, double *gravityPosY);

        int GetPreciseStarPos(cv::Mat *img, double refPosX, double refPosY, double *starPosX, double *starPosY);

        int CalcPoleCOOR(double aX, double aY, double A, double bX, double bY, double B, double *pX, double *pY, double cx,
                         double cy);

        int CorrectAtmRefraction(double posY, double latitude, double P, double T, double *corY);

        void ImgStretch(unsigned char *inputdata, unsigned char *outputdata, int w, int h, int offset, double ratio);

        //claculate the pole position
        int CalcMaskPoleCoor(double aX, double aY, double A, double bX, double bY, double B, double *pX, double *pY, double dX,
                             double dY, double angle_DBP);

        void GetCorrectValueOfPoles(double x1, double y1, double x2, double y2, double maskDX, double maskDY, double maskBX,
                                    double maskBY, double angle_DBP, double *x, double *y);

};

#endif // TOOLSCLASS_H
