mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-05 14:30:03 +01:00
updated
This commit is contained in:
@@ -129,11 +129,12 @@ void ChromaWindow::createControls() {
|
||||
void ChromaWindow::setImage() {
|
||||
QString fileName = QFileDialog::getOpenFileName(this,tr("Open Image"),".", tr("Image Files (*.png *.jpg *.bmp *.tiff)"));
|
||||
if(fileName != "") {
|
||||
color_replace_image = cv::imread(fileName.toStdString());
|
||||
cv::Mat color_replace_image = cv::imread(fileName.toStdString());
|
||||
if(color_replace_image.empty()) {
|
||||
QMessageBox::information(this, "Error", "Could not open image file...");
|
||||
} else {
|
||||
select_image_path->setText(fileName);
|
||||
main_window->playback->setChromaImage(color_replace_image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define __CHROMAKEY__H_
|
||||
|
||||
#include "qtheaders.h"
|
||||
|
||||
#include "main_window.h"
|
||||
|
||||
class ChromaWindow : public QDialog {
|
||||
Q_OBJECT
|
||||
@@ -13,6 +13,8 @@ public:
|
||||
void setEditFromColor(int val, QColor color);
|
||||
void enableKey(bool op);
|
||||
void showGL();
|
||||
AC_MainWindow *main_window;
|
||||
|
||||
public slots:
|
||||
void openColorSelectRange();
|
||||
void openColorSelectTolerance();
|
||||
|
||||
@@ -165,6 +165,7 @@ AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) {
|
||||
filters->setCurrentIndex(cindex);
|
||||
chroma_window = new ChromaWindow(this);
|
||||
chroma_window->hide();
|
||||
chroma_window->main_window = this;
|
||||
define_window = new DefineWindow(this);
|
||||
define_window->hide();
|
||||
define_window->main_window = this;
|
||||
@@ -187,7 +188,7 @@ AC_MainWindow::AC_MainWindow(QWidget *parent) : QMainWindow(parent) {
|
||||
}
|
||||
|
||||
bool AC_MainWindow::checkAdd(QString str) {
|
||||
const char *ex[] = { "Zoom", "AcidShuffleMedian", "MatrixColorBlur", "AlphaBlendArrayExpand", "Zoom", "ImageXorSmooth", "SketchFilter", "SlideSub", "Histogram", "Desktop","MultiVideo","Solo", "Bars", "BilateralFilter", "BilateralFilterFade", "BoxFilter", "CurrentDesktopRect", "HorizontalTrailsInter", "IntertwineAlpha", "IntertwineAlphaBlend", "IntertwineVideo640", "RandomAlphaBlendFilter", "RandomOrigFrame", "RectangleGlitch", "SquareSwap64x32", "VideoColorMap", 0};
|
||||
const char *ex[] = { "ExpandSquareVertical", "DistortPixelate128", "Zoom", "AcidShuffleMedian", "MatrixColorBlur", "AlphaBlendArrayExpand", "Zoom", "ImageXorSmooth", "SketchFilter", "SlideSub", "Histogram", "Desktop","MultiVideo","Solo", "Bars", "BilateralFilter", "BilateralFilterFade", "BoxFilter", "CurrentDesktopRect", "HorizontalTrailsInter", "IntertwineAlpha", "IntertwineAlphaBlend", "IntertwineVideo640", "RandomAlphaBlendFilter", "RandomOrigFrame", "RectangleGlitch", "SquareSwap64x32", "VideoColorMap", 0};
|
||||
|
||||
std::string val = str.toStdString();
|
||||
for(int i = 0; ex[i] != 0; ++i)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "slitscan_win.h"
|
||||
|
||||
class SearchWindow;
|
||||
class ChromaWindow;
|
||||
|
||||
class AC_MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
@@ -79,6 +80,9 @@ public:
|
||||
void setOptionString(std::string op, std::string value);
|
||||
void setProcMode(int index);
|
||||
bool checkAdd(QString str);
|
||||
|
||||
Playback *playback;
|
||||
|
||||
public slots:
|
||||
void showRange();
|
||||
void chk_Joystick();
|
||||
@@ -145,6 +149,7 @@ public slots:
|
||||
void next_filter();
|
||||
void prev_filter();
|
||||
void showSlit();
|
||||
|
||||
private:
|
||||
void createControls();
|
||||
void createMenu();
|
||||
@@ -169,7 +174,6 @@ private:
|
||||
QString output_directory;
|
||||
bool take_snapshot;
|
||||
unsigned long file_pos, frame_index;
|
||||
Playback *playback;
|
||||
VideoMode programMode;
|
||||
void buildVector(std::vector<FilterValue> &v);
|
||||
bool loading;
|
||||
|
||||
@@ -407,6 +407,10 @@ void Playback::run() {
|
||||
blend_image = blend_image_copy.clone();
|
||||
blend_image_copy_set = false;
|
||||
}
|
||||
if(chroma_image_set) {
|
||||
color_replace_image = chroma_image.clone();
|
||||
chroma_image_set = false;
|
||||
}
|
||||
mutex.unlock();
|
||||
|
||||
cv::Mat temp_frame;
|
||||
@@ -625,6 +629,13 @@ void Playback::setImage(const cv::Mat &frame) {
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
void Playback::setChromaImage(cv::Mat &frame) {
|
||||
mutex.lock();
|
||||
chroma_image = frame.clone();
|
||||
chroma_image_set = true;
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
void Playback::setFadeFilter(bool f) {
|
||||
mutex.lock();
|
||||
fadefilter = f;
|
||||
|
||||
@@ -22,6 +22,8 @@ private:
|
||||
QMutex mutex, mutex_shown, mutex_add;
|
||||
QWaitCondition condition;
|
||||
cv::Mat frame;
|
||||
cv::Mat chroma_image;
|
||||
std::atomic<bool> chroma_image_set;
|
||||
std::atomic<double> frame_rate;
|
||||
std::atomic<bool> recording;
|
||||
cv::VideoCapture capture;
|
||||
@@ -105,6 +107,7 @@ public:
|
||||
unsigned long calcMem();
|
||||
void setCustomCycle(bool b);
|
||||
void setCustomCycleDelay(int delay);
|
||||
void setChromaImage(cv::Mat &frame);
|
||||
signals:
|
||||
void procImage(const QImage image);
|
||||
void stopRecording();
|
||||
|
||||
@@ -18,7 +18,7 @@ SearchWindow::SearchWindow(QWidget *parent) : QDialog(parent) {
|
||||
|
||||
|
||||
bool SearchWindow::checkAdd(QString str) {
|
||||
const char *ex[] = { "Zoom", "AcidShuffleMedian", "MatrixColorBlur", "AlphaBlendArrayExpand", "Zoom", "ImageXorSmooth", "SketchFilter", "SlideSub", "Histogram", "Desktop","MultiVideo","Solo", "Bars", "BilateralFilter", "BilateralFilterFade", "BoxFilter", "CurrentDesktopRect", "HorizontalTrailsInter", "IntertwineAlpha", "IntertwineAlphaBlend", "IntertwineVideo640", "RandomAlphaBlendFilter", "RandomOrigFrame", "RectangleGlitch", "SquareSwap64x32", "VideoColorMap", 0};
|
||||
const char *ex[] = { "ExpandSquareVertical", "DistortPixelate128", "Zoom", "AcidShuffleMedian", "MatrixColorBlur", "AlphaBlendArrayExpand", "Zoom", "ImageXorSmooth", "SketchFilter", "SlideSub", "Histogram", "Desktop","MultiVideo","Solo", "Bars", "BilateralFilter", "BilateralFilterFade", "BoxFilter", "CurrentDesktopRect", "HorizontalTrailsInter", "IntertwineAlpha", "IntertwineAlphaBlend", "IntertwineVideo640", "RandomAlphaBlendFilter", "RandomOrigFrame", "RectangleGlitch", "SquareSwap64x32", "VideoColorMap", 0};
|
||||
|
||||
std::string val = str.toStdString();
|
||||
for(int i = 0; ex[i] != 0; ++i)
|
||||
|
||||
Reference in New Issue
Block a user