/**
    05Robot - Computer Vision Module

    @author P.Kaczmarek,J.Tomczynski,T.Mankowski
    @version 1.0 2017
*/
#ifndef OBJECTEXTRACTIONWINDOW_H
#define OBJECTEXTRACTIONWINDOW_H

#include <QWidget>
#include "ProcessorWindow.h"
#include "ui_ObjectExtractionWindow.h"
#include "ProcessorObject.h"
#include "ProcessorThread.h"
#include <QVector3D>

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

#include <QDebug>
/** \addtogroup ComputerVisionModule
 *  @{
 */
/**
 @brief Object extraction processor preview window
 
 Preview from image extraction processor. Allows triggering of background capture, load and save.
 
 */
class ObjectExtractionWindow : public ProcessorWindow
{
	Q_OBJECT

public:
    /**
     @brief Default constructor, initializes object extraction preview window
     
     @param pt corresponding ProcessorThread
     @param parent pointer to parent widget
     @param flags window flags
     */
    ObjectExtractionWindow(ProcessorThread* pt,QWidget *parent = 0, Qt::WindowFlags flags = 0);
    /**
     @brief Default destructor, cleans up
     */
	~ObjectExtractionWindow();

private:
	Ui::ObjectExtractionWindow ui;
	
public slots:
	/**
	 @brief Update displayed picture

	 @param id Frame ID
	 @param frame Pointer to picture
	 */
	void frameIn(int id, cv::Mat* frame);
private slots:
    void object_picked(int x, int y) {
        emit signalSpecial(QString("object_picked " + QString::number(x) + " " + QString::number(y)));
    }
    void get_background() {
        emit signalSpecial(QString("get_background"));
    }
    void save_background() {
        emit signalSpecial(QString("save_background"));
    }
    void load_background() {
        emit signalSpecial(QString("load_background"));
    }
    
    void on_pushButton_screenshot_clicked() {
        qDebug() << "on_pushButton_screenshot_clicked()";
        emit signalSpecial(QString("screenshot"));
    }
};
/** @}*/
#endif // OBJECTEXTRACTIONWINDOW_H
