updated project files etc run qmake again

This commit is contained in:
lostjared
2018-03-06 11:34:05 -08:00
parent 5714f43215
commit 6e4fa79cbd
3 changed files with 47 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ TARGET = Acid_Cam_v2_Qt
QT += core gui widgets
DEPENDPATH += .
INCLUDEPATH += . /usr/include/ /usr/local/include
LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_video
LIBS += -lopencv_contrib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_video
QMAKE_CXXFLAGS += -std=c++11
RESOURCES += qresource.qrc

View File

@@ -47,13 +47,17 @@
#include "ac.h"
#include "fractal.h"
// Acid Cam namespace
namespace ac {
const std::string version="2.3.3";
// variables
unsigned int swapColor_r = 0, swapColor_g = 0, swapColor_b = 0;
bool isNegative = false, noRecord = false, pass2_enabled = false, blendW = false, slide_Show = false, slide_Rand = false, strobe_It = false, switch_Back = false, blur_First = false;
bool images_Enabled = false, fps_force = false,iRev = false;
bool blur_Second = false;
int set_color_map = 0;
cv::Mat orig_frame;
cv::Mat blendW_frame;
cv::Mat image_files[4];
@@ -93,8 +97,10 @@ namespace ac {
double translation_variable = 0.001f, pass2_alpha = 0.75f;
// swap colors inline function
inline void swapColors(cv::Mat &frame, int x, int y);
inline void swapColors_(cv::Mat &frame, int x, int y);
inline void procPos(int &direction, double &pos, double &pos_max, const double max_size = 15);
std::unordered_map<std::string, int> filter_map;
bool color_map_set = false;
}
void ac::fill_filter_map() {
@@ -104,10 +110,17 @@ void ac::fill_filter_map() {
}
// swapColors inline function takes frame and x, y position
inline void ac::swapColors(cv::Mat &frame, int x, int y) {
inline void ac::swapColors(cv::Mat &frame, int y, int x) {
if(in_custom == true) return;
if(color_order == 0 && swapColor_r == 0 && swapColor_g == 0 && swapColor_b == 0) return; // if no swap needed return
cv::Vec3b &cur = frame.at<cv::Vec3b>(x,y);
if(set_color_map > 0 && color_map_set == false) {
return;
}
swapColors_(frame, y, x);
}
inline void ac::swapColors_(cv::Mat &frame, int y, int x) {
cv::Vec3b &cur = frame.at<cv::Vec3b>(y,x);
cur[0] += swapColor_b;
cur[1] += swapColor_g;
cur[2] += swapColor_r;
@@ -137,9 +150,9 @@ inline void ac::swapColors(cv::Mat &frame, int x, int y) {
}
}
// invert pixel in frame at x,y
inline void ac::invert(cv::Mat &frame, int x, int y) {
inline void ac::invert(cv::Mat &frame, int y, int x) {
if(in_custom == true) return;
cv::Vec3b &cur = frame.at<cv::Vec3b>(x,y);// cur pixel
cv::Vec3b &cur = frame.at<cv::Vec3b>(y,x);// cur pixel
cur[0] = ~cur[0]; // bit manipulation sets opposite
cur[1] = ~cur[1];
cur[2] = ~cur[2];
@@ -5262,6 +5275,22 @@ void ac::IncreaseBlendHorizontal(cv::Mat &frame) {
Pass2Blend(frame);
}
void ac::ApplyColorMap(cv::Mat &frame) {
if(set_color_map > 0 && set_color_map < 13) {
cv::Mat output_f1 = frame.clone();
cv::applyColorMap(output_f1, frame, (int)set_color_map-1);
unsigned int w = frame.cols;
unsigned int h = frame.rows;
color_map_set = true;
for(unsigned int z = 0; z < h; ++z) {
for(unsigned int i = 0; i < w; ++i) {
ac::swapColors(frame, z, i);
if(isNegative) ac::invert(frame, z, i);
}
}
color_map_set = false;
}
}
// No Filter
void ac::NoFilter(cv::Mat &) {}
@@ -5273,4 +5302,11 @@ void ac::BlendWithSource(cv::Mat &frame) {
// call custom fitler defined elsewhere
void ac::custom(cv::Mat &frame) {
custom_filter(frame);
}

View File

@@ -85,7 +85,7 @@ extern cv::Mat blend_image;
// acid cam namespace
namespace ac {
// version string
static const std::string version="2.3.2";
extern const std::string version;
extern double translation_variable, pass2_alpha;
extern double alpha, tr;
extern bool isNegative, noRecord,iRev;
@@ -100,6 +100,7 @@ namespace ac {
extern int snapshot_Type;
extern bool in_custom;
extern unsigned int swapColor_r, swapColor_g, swapColor_b;
extern int set_color_map;
inline int GetFX(cv::Mat &frame, int x, int nw);
inline int GetFY(cv::Mat &frame, int y, int nh);
inline void invert(cv::Mat &frame, int x, int y);
@@ -283,6 +284,9 @@ namespace ac {
void NoFilter(cv::Mat &frame);
void BlendWithSource(cv::Mat &frame);
void plugin(cv::Mat &frame);
// color maps
void ApplyColorMap(cv::Mat &frame);
// draw functions / strings
extern std::string draw_strings[];
extern DrawFunction draw_func[];
@@ -290,9 +294,7 @@ namespace ac {
extern bool snapShot;
extern std::unordered_map<std::string, int> filter_map;
void fill_filter_map();
// classes to be used by the filers
// classes to be used by the filters
// Square class to hold broken up cv::Mat
class Square {
public:
@@ -350,11 +352,9 @@ namespace ac {
void movePixels();
// reset
void reset();
private:
Particle **part; // array of pointers for Particles
unsigned int w, h; // frame width/height
};
}
// custom filter function, must be defined in program so it will link