mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-18 12:50:07 +01:00
now works with reset filters
This commit is contained in:
@@ -313,6 +313,10 @@ void AC_MainWindow::createMenu() {
|
|||||||
controls_showvideo->setShortcut(tr("Ctrl+V"));
|
controls_showvideo->setShortcut(tr("Ctrl+V"));
|
||||||
controls_menu->addAction(controls_showvideo);
|
controls_menu->addAction(controls_showvideo);
|
||||||
|
|
||||||
|
reset_filters = new QAction(tr("Reset Filters"), this);
|
||||||
|
reset_filters->setShortcut(tr("Ctrl+R"));
|
||||||
|
controls_menu->addAction(reset_filters);
|
||||||
|
|
||||||
controls_showvideo->setEnabled(false);
|
controls_showvideo->setEnabled(false);
|
||||||
controls_showvideo->setCheckable(true);
|
controls_showvideo->setCheckable(true);
|
||||||
|
|
||||||
@@ -323,6 +327,7 @@ void AC_MainWindow::createMenu() {
|
|||||||
connect(controls_setimage, SIGNAL(triggered()), this, SLOT(controls_SetImage()));
|
connect(controls_setimage, SIGNAL(triggered()), this, SLOT(controls_SetImage()));
|
||||||
connect(controls_setkey, SIGNAL(triggered()), this, SLOT(controls_SetKey()));
|
connect(controls_setkey, SIGNAL(triggered()), this, SLOT(controls_SetKey()));
|
||||||
connect(controls_showvideo, SIGNAL(triggered()), this, SLOT(controls_ShowVideo()));
|
connect(controls_showvideo, SIGNAL(triggered()), this, SLOT(controls_ShowVideo()));
|
||||||
|
connect(reset_filters, SIGNAL(triggered()), this, SLOT(controls_Reset()));
|
||||||
connect(clear_images, SIGNAL(triggered()), this, SLOT(controls_Clear()));
|
connect(clear_images, SIGNAL(triggered()), this, SLOT(controls_Clear()));
|
||||||
connect(combo_rgb, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_SetIndex(int)));
|
connect(combo_rgb, SIGNAL(currentIndexChanged(int)), this, SLOT(cb_SetIndex(int)));
|
||||||
controls_pause->setText(tr("Pause"));
|
controls_pause->setText(tr("Pause"));
|
||||||
@@ -674,6 +679,10 @@ void AC_MainWindow::controls_ShowVideo() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::controls_Reset() {
|
||||||
|
playback->reset_filters();
|
||||||
|
}
|
||||||
|
|
||||||
void AC_MainWindow::file_Exit() {
|
void AC_MainWindow::file_Exit() {
|
||||||
QApplication::exit(0);
|
QApplication::exit(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
QComboBox *color_maps, *filters;
|
QComboBox *color_maps, *filters;
|
||||||
QMenu *file_menu, *controls_menu, *help_menu;
|
QMenu *file_menu, *controls_menu, *help_menu;
|
||||||
QAction *file_exit, *file_new_capture, *file_new_video;
|
QAction *file_exit, *file_new_capture, *file_new_video;
|
||||||
QAction *controls_snapshot, *controls_pause, *controls_step, *controls_stop, *controls_setimage,*controls_setkey,*controls_showvideo, *clear_images;
|
QAction *controls_snapshot, *controls_pause, *controls_step, *controls_stop, *controls_setimage,*controls_setkey,*controls_showvideo, *clear_images, *reset_filters;
|
||||||
QAction *help_about;
|
QAction *help_about;
|
||||||
QRadioButton *filter_single, *filter_custom;
|
QRadioButton *filter_single, *filter_custom;
|
||||||
|
|
||||||
@@ -51,6 +51,7 @@ public slots:
|
|||||||
void controls_ShowVideo();
|
void controls_ShowVideo();
|
||||||
void controls_SetKey();
|
void controls_SetKey();
|
||||||
void controls_Clear();
|
void controls_Clear();
|
||||||
|
void controls_Reset();
|
||||||
void help_About();
|
void help_About();
|
||||||
void updateFrame(QImage img);
|
void updateFrame(QImage img);
|
||||||
void stopRecording();
|
void stopRecording();
|
||||||
|
|||||||
@@ -105,6 +105,15 @@ void Playback::setOptions(bool n, int c) {
|
|||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Playback::reset_filters() {
|
||||||
|
mutex.lock();
|
||||||
|
if(ac::reset_alpha == false) {
|
||||||
|
ac::reset_alpha = true;
|
||||||
|
}
|
||||||
|
ac::frames_released = true;
|
||||||
|
mutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
void Playback::setColorOptions(int b, int g, int s) {
|
void Playback::setColorOptions(int b, int g, int s) {
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
bright_ = b;
|
bright_ = b;
|
||||||
@@ -143,6 +152,8 @@ void Playback::setDisplayed(bool shown) {
|
|||||||
|
|
||||||
void Playback::drawEffects(cv::Mat &frame) {
|
void Playback::drawEffects(cv::Mat &frame) {
|
||||||
if(ac::set_color_map > 0) ac::ApplyColorMap(frame);
|
if(ac::set_color_map > 0) ac::ApplyColorMap(frame);
|
||||||
|
ac::frames_released = false;
|
||||||
|
ac::reset_alpha = false;
|
||||||
if(bright_ > 0) {
|
if(bright_ > 0) {
|
||||||
ac::setBrightness(frame, 1.0, bright_);
|
ac::setBrightness(frame, 1.0, bright_);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public:
|
|||||||
void drawFilter(cv::Mat &frame, std::pair<int, int> &filter);
|
void drawFilter(cv::Mat &frame, std::pair<int, int> &filter);
|
||||||
void drawEffects(cv::Mat &frame);
|
void drawEffects(cv::Mat &frame);
|
||||||
void filterFade(cv::Mat &frame, std::pair<int, int> &filter1, std::pair<int, int> &filter2, double alpha);
|
void filterFade(cv::Mat &frame, std::pair<int, int> &filter1, std::pair<int, int> &filter2, double alpha);
|
||||||
|
void reset_filters();
|
||||||
signals:
|
signals:
|
||||||
void procImage(const QImage image);
|
void procImage(const QImage image);
|
||||||
void stopRecording();
|
void stopRecording();
|
||||||
|
|||||||
Reference in New Issue
Block a user