#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include <highgui.h>
#include <opencv/cv.h>


namespace Ui {
    class MainWindow;
}


class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    IplImage * img_orig;
    IplImage * img_zobrazeny;
    IplImage * img_pomoc;
    CvPoint point_centr;


    CvSize size;
    CvSize size_img;
    int posun_x;
    int posun_y;
    int posun_x_delta;
    int posun_y_delta;
    int angle;
    float angle_delta;
    double sum;


    QString path;//jmeno obrazku (nacitaneho)
    QString dir;//jmeno adresare do ktereho ukladat
    MainWindow(QWidget *parent = 0);
    static void my_mouse_callback_write_pixel( int event, int x, int y, int flags, void* param );
    static void my_mouse_callback_write_pixel2( int event, int x, int y, int flags, void* param );
    ~MainWindow();

protected:

    void changeEvent(QEvent *e);
    void show_image(IplImage * img,bool show_rect=false,int time=0);


    IplImage * Rot(IplImage* image,CvPoint2D32f centr, float angle);
    IplImage * Roi(IplImage *image,int stredX,int stredY,int width,int height);
    IplImage* Add_Noise (IplImage* image,float size);
    void Add_Noise2(IplImage* img,double pravdep=0.5, float amount=255);
    double Uniform();
    void delete_image(IplImage **img);



private:
    Ui::MainWindow *ui;
public slots:
            void Btn_load_click();
            void Btn_show_click();
            void Btn_make_DB_image_click();
};

#endif // MAINWINDOW_H
