mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-16 03:39:59 +01:00
updated project
This commit is contained in:
@@ -14,5 +14,5 @@ QMAKE_CXXFLAGS += -std=c++11 `pkg-config acidcam opencv --cflags`
|
|||||||
RESOURCES += qresource.qrc
|
RESOURCES += qresource.qrc
|
||||||
QMAKE_CFLAGS_ISYSTEM = -I
|
QMAKE_CFLAGS_ISYSTEM = -I
|
||||||
# Input
|
# 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
|
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
|
||||||
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
|
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
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ QMAKE_CXXFLAGS += -std=c++11 `pkg-config acidcam opencv4 --cflags`
|
|||||||
RESOURCES += qresource.qrc
|
RESOURCES += qresource.qrc
|
||||||
|
|
||||||
# Input
|
# 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
|
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
|
||||||
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
|
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
|
||||||
|
|||||||
@@ -95,6 +95,9 @@ AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||||||
image_window = new ImageWindow(this);
|
image_window = new ImageWindow(this);
|
||||||
image_window->setPlayback(playback);
|
image_window->setPlayback(playback);
|
||||||
|
|
||||||
|
pref_window = new OptionsWindow(this);
|
||||||
|
pref_window->setPlayback(playback);
|
||||||
|
|
||||||
QObject::connect(playback, SIGNAL(procImage(QImage)), this, SLOT(updateFrame(QImage)));
|
QObject::connect(playback, SIGNAL(procImage(QImage)), this, SLOT(updateFrame(QImage)));
|
||||||
QObject::connect(playback, SIGNAL(stopRecording()), this, SLOT(stopRecording()));
|
QObject::connect(playback, SIGNAL(stopRecording()), this, SLOT(stopRecording()));
|
||||||
QObject::connect(playback, SIGNAL(frameIncrement()), this, SLOT(frameInc()));
|
QObject::connect(playback, SIGNAL(frameIncrement()), this, SLOT(frameInc()));
|
||||||
@@ -354,6 +357,11 @@ void AC_MainWindow::createMenu() {
|
|||||||
file_exit->setShortcut(tr("Ctrl+X"));
|
file_exit->setShortcut(tr("Ctrl+X"));
|
||||||
file_menu->addAction(file_exit);
|
file_menu->addAction(file_exit);
|
||||||
|
|
||||||
|
show_options_window = new QAction(tr("Show Preferences"), this);
|
||||||
|
options->addAction(show_options_window);
|
||||||
|
|
||||||
|
connect(show_options_window, SIGNAL(triggered()), this, SLOT(showPrefWindow()));
|
||||||
|
|
||||||
movement = options->addMenu(tr("Movement"));
|
movement = options->addMenu(tr("Movement"));
|
||||||
in_out_increase = new QAction(tr("Move In, Move Out, Increase"), this);
|
in_out_increase = new QAction(tr("Move In, Move Out, Increase"), this);
|
||||||
in_out_increase->setCheckable(true);
|
in_out_increase->setCheckable(true);
|
||||||
@@ -415,6 +423,7 @@ void AC_MainWindow::createMenu() {
|
|||||||
options->addAction(fade_on);
|
options->addAction(fade_on);
|
||||||
options->addAction(repeat_v);
|
options->addAction(repeat_v);
|
||||||
|
|
||||||
|
|
||||||
connect(fade_on, SIGNAL(triggered()), this, SLOT(setFade()));
|
connect(fade_on, SIGNAL(triggered()), this, SLOT(setFade()));
|
||||||
connect(repeat_v, SIGNAL(triggered()), this, SLOT(repeat_vid()));
|
connect(repeat_v, SIGNAL(triggered()), this, SLOT(repeat_vid()));
|
||||||
connect(clear_image, SIGNAL(triggered()), this, SLOT(clear_img()));
|
connect(clear_image, SIGNAL(triggered()), this, SLOT(clear_img()));
|
||||||
@@ -575,6 +584,9 @@ void AC_MainWindow::noflip_action() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AC_MainWindow::showPrefWindow() {
|
||||||
|
pref_window->show();
|
||||||
|
}
|
||||||
void AC_MainWindow::repeat_vid() {
|
void AC_MainWindow::repeat_vid() {
|
||||||
bool val = repeat_v->isChecked();
|
bool val = repeat_v->isChecked();
|
||||||
playback->enableRepeat(val);
|
playback->enableRepeat(val);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "user_define.h"
|
#include "user_define.h"
|
||||||
#include "dl-man.h"
|
#include "dl-man.h"
|
||||||
#include "image_window.h"
|
#include "image_window.h"
|
||||||
|
#include "options_window.h"
|
||||||
|
|
||||||
class SearchWindow;
|
class SearchWindow;
|
||||||
|
|
||||||
@@ -56,6 +57,7 @@ public:
|
|||||||
QAction *set_newnames;
|
QAction *set_newnames;
|
||||||
QAction *show_fullscreen;
|
QAction *show_fullscreen;
|
||||||
QAction *show_image_window;
|
QAction *show_image_window;
|
||||||
|
QAction *show_options_window;
|
||||||
double speed_actions[7];
|
double speed_actions[7];
|
||||||
QRadioButton *filter_single, *filter_custom;
|
QRadioButton *filter_single, *filter_custom;
|
||||||
void updateList();
|
void updateList();
|
||||||
@@ -121,6 +123,7 @@ public slots:
|
|||||||
void save_CustomFile();
|
void save_CustomFile();
|
||||||
void showFull();
|
void showFull();
|
||||||
void showImageWindow();
|
void showImageWindow();
|
||||||
|
void showPrefWindow();
|
||||||
private:
|
private:
|
||||||
void createControls();
|
void createControls();
|
||||||
void createMenu();
|
void createMenu();
|
||||||
@@ -132,6 +135,7 @@ private:
|
|||||||
DefineWindow *define_window;
|
DefineWindow *define_window;
|
||||||
ImageWindow *image_window;
|
ImageWindow *image_window;
|
||||||
GotoWindow *goto_window;
|
GotoWindow *goto_window;
|
||||||
|
OptionsWindow *pref_window;
|
||||||
cv::VideoCapture capture_camera, capture_video;
|
cv::VideoCapture capture_camera, capture_video;
|
||||||
cv::VideoWriter writer;
|
cv::VideoWriter writer;
|
||||||
unsigned long video_frames;
|
unsigned long video_frames;
|
||||||
|
|||||||
44
src/options_window.cpp
Normal file
44
src/options_window.cpp
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
#include "options_window.h"
|
||||||
|
|
||||||
|
|
||||||
|
OptionsWindow::OptionsWindow(QWidget *parent) : QDialog(parent) {
|
||||||
|
setFixedSize(170, 175);
|
||||||
|
createControls();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionsWindow::createControls() {
|
||||||
|
QLabel *label_x = new QLabel(tr("Thread Count: "), this);
|
||||||
|
label_x->setGeometry(10, 10, 100, 25);
|
||||||
|
op_thread = new QLineEdit("4", this);
|
||||||
|
op_thread->setGeometry(110, 10, 50, 25);
|
||||||
|
QLabel *label_y = new QLabel(tr("Intensity: "), this);
|
||||||
|
label_y->setGeometry(10, 40, 100, 25);
|
||||||
|
op_intensity = new QLineEdit("55", this);
|
||||||
|
op_intensity->setGeometry(110, 40, 50, 25);
|
||||||
|
op_setpref = new QPushButton(tr("Set"), this);
|
||||||
|
op_setpref->setGeometry(10, 135, 100, 25);
|
||||||
|
connect(op_setpref, SIGNAL(clicked()), this, SLOT(setValues()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionsWindow::setValues() {
|
||||||
|
|
||||||
|
int thread_count = atoi(op_thread->text().toStdString().c_str());
|
||||||
|
if(thread_count <= 0) {
|
||||||
|
QMessageBox::information(this, "Error require valid thread count", "Requires Valid Thread Count...");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int intensity = atoi(op_intensity->text().toStdString().c_str());
|
||||||
|
if(intensity <= 0) {
|
||||||
|
QMessageBox::information(this, "Error requires valid intensity", "To set the value you must provide a valid intensity");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playback->setPref(thread_count, intensity);
|
||||||
|
QString text;
|
||||||
|
QTextStream stream(&text);
|
||||||
|
stream << "Thread Count set to: " << thread_count << " and Intensity set to: " << intensity;
|
||||||
|
QMessageBox::information(this, "Pref Value Set", text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionsWindow::setPlayback(Playback *p) {
|
||||||
|
playback = p;
|
||||||
|
}
|
||||||
23
src/options_window.h
Normal file
23
src/options_window.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef __OPTIONS_WINDOW_H__
|
||||||
|
#define __OPTIONS_WINDOW_H__
|
||||||
|
|
||||||
|
#include "qtheaders.h"
|
||||||
|
#include "playback_thread.h"
|
||||||
|
|
||||||
|
class OptionsWindow : public QDialog {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
OptionsWindow(QWidget *parent);
|
||||||
|
void createControls();
|
||||||
|
void setPlayback(Playback *p);
|
||||||
|
public slots:
|
||||||
|
void setValues();
|
||||||
|
private:
|
||||||
|
QLineEdit *op_thread;
|
||||||
|
QLineEdit *op_intensity;
|
||||||
|
QPushButton *op_setpref;
|
||||||
|
Playback *playback;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -126,6 +126,9 @@ void Playback::setCycle(int type, int frame_skip, std::vector<std::string> &v) {
|
|||||||
frame_num = frame_skip;
|
frame_num = frame_skip;
|
||||||
blend_image = cv::imread(v[0]);
|
blend_image = cv::imread(v[0]);
|
||||||
blend_set = true;
|
blend_set = true;
|
||||||
|
static std::random_device r;
|
||||||
|
static auto rng = std::default_random_engine(r());
|
||||||
|
std::shuffle(cycle_values.begin(), cycle_values.end(), rng);
|
||||||
}
|
}
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
}
|
}
|
||||||
@@ -163,6 +166,13 @@ void Playback::setColorOptions(int b, int g, int s) {
|
|||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Playback::setPref(int thread_count, int intense) {
|
||||||
|
mutex.lock();
|
||||||
|
ac::setThreadCount(thread_count);
|
||||||
|
ac::setPixelCollection(intense);
|
||||||
|
mutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
void Playback::setIndexChanged(std::string value) {
|
void Playback::setIndexChanged(std::string value) {
|
||||||
prev_filter = current_filter;
|
prev_filter = current_filter;
|
||||||
current_filter = filter_map[value];
|
current_filter = filter_map[value];
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ public:
|
|||||||
void enableRepeat(bool re);
|
void enableRepeat(bool re);
|
||||||
void setCycle(int type, int frame_skip, std::vector<std::string> &val);
|
void setCycle(int type, int frame_skip, std::vector<std::string> &val);
|
||||||
void setCycle(int type);
|
void setCycle(int type);
|
||||||
|
void setPref(int thread_count, int intense);
|
||||||
signals:
|
signals:
|
||||||
void procImage(const QImage image);
|
void procImage(const QImage image);
|
||||||
void stopRecording();
|
void stopRecording();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#ifndef _QT_HEADERS__
|
#ifndef _QT_HEADERS__
|
||||||
#define _QT_HEADERS__
|
#define _QT_HEADERS__
|
||||||
#define ac_version "v1.44.0"
|
#define ac_version "v1.45.0"
|
||||||
#include<QApplication>
|
#include<QApplication>
|
||||||
#include<QMainWindow>
|
#include<QMainWindow>
|
||||||
#include<QDialog>
|
#include<QDialog>
|
||||||
|
|||||||
Reference in New Issue
Block a user