diff --git a/src/Acid.Cam.v2.OpenCV3.Linux.pro b/src/Acid.Cam.v2.OpenCV3.Linux.pro index 88713ba..1d0c39f 100644 --- a/src/Acid.Cam.v2.OpenCV3.Linux.pro +++ b/src/Acid.Cam.v2.OpenCV3.Linux.pro @@ -16,5 +16,5 @@ QMAKE_CXXFLAGS += `pkg-config acidcam opencv sdl2 --cflags` RESOURCES += qresource.qrc QMAKE_CFLAGS_ISYSTEM = -I # Input -HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h gl_display.h controller.h -SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp gl_display.cpp controller.cpp +HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h gl_display.h controller.h color_range.h slitscan_win.h +SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp gl_display.cpp controller.cpp color_range.cpp slitscan_win.cpp diff --git a/src/Acid.Cam.v2.OpenCV3.pro b/src/Acid.Cam.v2.OpenCV3.pro index d4099c7..089326a 100644 --- a/src/Acid.Cam.v2.OpenCV3.pro +++ b/src/Acid.Cam.v2.OpenCV3.pro @@ -16,5 +16,5 @@ QMAKE_CXXFLAGS += `pkg-config acidcam opencv sdl2 --cflags` RESOURCES += qresource.qrc QMAKE_CFLAGS_ISYSTEM = -I # Input -HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h gl_display.h controller.h -SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp gl_display.cpp controller.cpp +HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h gl_display.h controller.h color_range.h slitscan_win.h +SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp gl_display.cpp controller.cpp color_range.cpp slitscan_win.cpp diff --git a/src/Acid.Cam.v2.OpenCV4.Linux.pro b/src/Acid.Cam.v2.OpenCV4.Linux.pro index 895b2fc..a93d97c 100644 --- a/src/Acid.Cam.v2.OpenCV4.Linux.pro +++ b/src/Acid.Cam.v2.OpenCV4.Linux.pro @@ -16,5 +16,5 @@ QMAKE_CXXFLAGS += `pkg-config acidcam opencv4 sdl2 --cflags` RESOURCES += qresource.qrc QMAKE_CFLAGS_ISYSTEM = -I # Input -HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h gl_display.h controller.h -SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp gl_display.cpp controller.cpp +HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h gl_display.h controller.h color_range.h slitscan_win.h +SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp gl_display.cpp controller.cpp color_range.cpp slitscan_win.cpp diff --git a/src/Acid.Cam.v2.OpenCV4.pro b/src/Acid.Cam.v2.OpenCV4.pro index c307170..77cac4f 100644 --- a/src/Acid.Cam.v2.OpenCV4.pro +++ b/src/Acid.Cam.v2.OpenCV4.pro @@ -16,5 +16,5 @@ QMAKE_CXXFLAGS += `pkg-config acidcam opencv4 sdl2 --cflags` RESOURCES += qresource.qrc QMAKE_CFLAGS_ISYSTEM = -I # Input -HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h gl_display.h controller.h -SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp gl_display.cpp controller.cpp +HEADERS += main_window.h new_dialog.h plugin.h qtheaders.h select_image.h display_window.h playback_thread.h search_box.h goto_window.h chroma_window.h user_define.h dl-man.h image_window.h options_window.h gl_display.h controller.h color_range.h slitscan_win.h +SOURCES += main.cpp main_window.cpp new_dialog.cpp plugin.cpp select_image.cpp display_window.cpp playback_thread.cpp search_box.cpp goto_window.cpp chroma_window.cpp user_define.cpp dl-man.cpp image_window.cpp options_window.cpp gl_display.cpp controller.cpp color_range.cpp slitscan_win.cpp diff --git a/src/main_window.cpp b/src/main_window.cpp index 5333d74..d198c94 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -137,6 +137,7 @@ AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) { pref_window->setPlayback(playback); color_range_window = new ColorRangeWindow(this); + slit_win = new SlitScanWindow(this); QObject::connect(playback, SIGNAL(procImage(QImage)), this, SLOT(updateFrame(QImage))); QObject::connect(playback, SIGNAL(stopRecording()), this, SLOT(stopRecording())); @@ -550,8 +551,15 @@ void AC_MainWindow::createMenu() { show_range = new QAction(tr("Show Range"), this); show_range->setShortcut(tr("Ctrl+1")); controls_menu->addAction(show_range); + + show_slit = new QAction(tr("Show SlitScan"), this); + show_slit->setShortcut(tr("Ctrl+2")); + controls_menu->addAction(show_slit); connect(show_range, SIGNAL(triggered()), this, SLOT(showRange())); + + connect(show_slit, SIGNAL(triggered()), this, SLOT(showSlit())); + reset_filters = new QAction(tr("Reset Filters"), this); reset_filters->setShortcut(tr("Ctrl+R")); @@ -621,6 +629,10 @@ void AC_MainWindow::resetIndex() { frame_index = 0; } +void AC_MainWindow::showSlit() { + slit_win->show(); +} + void AC_MainWindow::clear_subfilter() { int crow = custom_filters->currentRow(); if(crow >= 0) { diff --git a/src/main_window.h b/src/main_window.h index 9cc3458..5807712 100644 --- a/src/main_window.h +++ b/src/main_window.h @@ -22,6 +22,7 @@ #include "gl_display.h" #include "controller.h" #include "color_range.h" +#include "slitscan_win.h" class SearchWindow; @@ -67,6 +68,7 @@ public: QAction *cycle_custom; QAction *show_glDisplay; QAction *show_range; + QAction *show_slit; QTimer *joy_timer; double speed_actions[7]; QRadioButton *filter_single, *filter_custom; @@ -142,6 +144,7 @@ public slots: void setCustomCycle_Menu(); void next_filter(); void prev_filter(); + void showSlit(); private: void createControls(); void createMenu(); @@ -155,6 +158,7 @@ private: ImageWindow *image_window; GotoWindow *goto_window; OptionsWindow *pref_window; + SlitScanWindow *slit_win; ColorRangeWindow *color_range_window; cv::VideoCapture capture_camera, capture_video; cv::VideoWriter writer; diff --git a/src/slitscan_win.cpp b/src/slitscan_win.cpp new file mode 100644 index 0000000..d652808 --- /dev/null +++ b/src/slitscan_win.cpp @@ -0,0 +1,63 @@ +#include"slitscan_win.h" + +SlitScanWindow::SlitScanWindow(QWidget *parent) : QDialog(parent) { + + setFixedSize(400, 140); + + QLabel *label1 = new QLabel("Width: ", this); + label1->setGeometry(5,5,50,25); + s_width = new QLineEdit("640", this); + s_width->setGeometry(60,5,100,25); + + QLabel *label2 = new QLabel("Height: ", this); + label2->setGeometry(170,5,50,25); + s_height = new QLineEdit("480", this); + s_height->setGeometry(220,5,100,25); + + QLabel *label3 = new QLabel("Slit Height: ", this); + label3->setGeometry(5,35,50,25); + s_frames = new QLineEdit("480", this); + s_frames->setGeometry(60,35,100,25); + + QLabel *label4 = new QLabel("Repeat: ", this); + label4->setGeometry(170,35,50,25); + s_repeat = new QLineEdit("1", this); + s_repeat->setGeometry(220,35,100,25); + + QLabel *label5 = new QLabel("Delay: ", this); + label5->setGeometry(5,65,50,25); + s_delay = new QLineEdit("0", this); + s_delay->setGeometry(60,65,100,25); + + QLabel *label6 = new QLabel("Wait: ", this); + label6->setGeometry(170,65,50,25); + s_wait = new QLineEdit("2", this); + s_wait->setGeometry(220,65,100,25); + + s_set = new QPushButton("Set", this); + s_set->setGeometry(5,90,100, 25); + + connect(s_set, SIGNAL(clicked()), this, SLOT(setValues())); +} + +void SlitScanWindow::setValues() { + + int w = atoi(s_width->text().toStdString().c_str()); + int h = atoi(s_height->text().toStdString().c_str()); + int f = atoi(s_frames->text().toStdString().c_str()); + int r = atoi(s_repeat->text().toStdString().c_str()); + int d = atoi(s_delay->text().toStdString().c_str()); + int wa = atoi(s_wait->text().toStdString().c_str()); + + if(w > 0 && h > 0 && f > 0 && r >= 0 && d >= 0 && wa >= 0) { + ac::slitScanSet(f, w, h, r, d, wa); + QMessageBox::information(this, "Values set", "Values set"); + + } else { + QMessageBox::information(this, "Requires at least greater than zero input", "Input invalid"); + } + + + + +} diff --git a/src/slitscan_win.h b/src/slitscan_win.h new file mode 100644 index 0000000..0f4a6f6 --- /dev/null +++ b/src/slitscan_win.h @@ -0,0 +1,21 @@ +#ifndef __SLITSCAN_H__ +#define __SLITSCAN_H__ + +#include"qtheaders.h" + +class SlitScanWindow : public QDialog { +Q_OBJECT + +public: + SlitScanWindow(QWidget *parent = 0); + + QLineEdit *s_width, *s_height, *s_frames, *s_repeat, *s_delay, *s_wait; + QPushButton *s_set; + +public slots: + void setValues(); + + +}; +#endif +