added new ac.h/ac.cpp and changed version number

This commit is contained in:
lostjared
2018-03-09 07:44:20 -08:00
parent b00cbd3e13
commit c311418e99
4 changed files with 12 additions and 5 deletions

View File

@@ -45,7 +45,7 @@
// Acid Cam namespace // Acid Cam namespace
namespace ac { namespace ac {
const std::string version="2.3.3"; const std::string version="2.3.4";
// variables // variables
unsigned int swapColor_r = 0, swapColor_g = 0, swapColor_b = 0; 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 isNegative = false, noRecord = false, pass2_enabled = false, blendW = false, slide_Show = false, slide_Rand = false, strobe_It = false, switch_Back = false, blur_First = false;
@@ -95,6 +95,7 @@ namespace ac {
inline void procPos(int &direction, double &pos, double &pos_max, const double max_size = 15); inline void procPos(int &direction, double &pos, double &pos_max, const double max_size = 15);
std::unordered_map<std::string, int> filter_map; std::unordered_map<std::string, int> filter_map;
bool color_map_set = false; bool color_map_set = false;
DrawFunction custom_callback = 0;
} }
// globals // globals
@@ -5297,9 +5298,15 @@ void ac::BlendWithSource(cv::Mat &frame) {
ac::pass2_alpha = 0.50; // set to 50% ac::pass2_alpha = 0.50; // set to 50%
Pass2Blend(frame);// call Pass2 function Pass2Blend(frame);// call Pass2 function
} }
void ac::setCustom(DrawFunction f) {
custom_callback = f;
}
// call custom fitler defined elsewhere // call custom fitler defined elsewhere
void ac::custom(cv::Mat &frame) { void ac::custom(cv::Mat &frame) {
custom_filter(frame); if(custom_callback != 0)
custom_callback(frame);
} }

View File

@@ -118,7 +118,6 @@ namespace ac {
inline T rol(T x, unsigned int m) { inline T rol(T x, unsigned int m) {
return (x << m) | (x >> (sizeof(T)*8 -m)); return (x << m) | (x >> (sizeof(T)*8 -m));
} }
// Acid Cam Filter Function prototypes // Acid Cam Filter Function prototypes
void SelfAlphaBlend(cv::Mat &frame); void SelfAlphaBlend(cv::Mat &frame);
void SelfScale(cv::Mat &frame); void SelfScale(cv::Mat &frame);
@@ -284,6 +283,7 @@ namespace ac {
void NoFilter(cv::Mat &frame); void NoFilter(cv::Mat &frame);
void BlendWithSource(cv::Mat &frame); void BlendWithSource(cv::Mat &frame);
void plugin(cv::Mat &frame); void plugin(cv::Mat &frame);
void setCustom(DrawFunction f);
// color maps // color maps
void ApplyColorMap(cv::Mat &frame); void ApplyColorMap(cv::Mat &frame);
@@ -359,6 +359,5 @@ namespace ac {
} }
// custom filter function, must be defined in program so it will link // custom filter function, must be defined in program so it will link
extern ac::ParticleEmiter emiter; extern ac::ParticleEmiter emiter;
extern void custom_filter(cv::Mat &frame);
#endif #endif

View File

@@ -11,6 +11,7 @@
#include<sys/stat.h> #include<sys/stat.h>
std::unordered_map<std::string, std::pair<int, int>> filter_map; std::unordered_map<std::string, std::pair<int, int>> filter_map;
void custom_filter(cv::Mat &);
const char *filter_names[] = { "AC Self AlphaBlend", "Reverse Self AlphaBlend", const char *filter_names[] = { "AC Self AlphaBlend", "Reverse Self AlphaBlend",
"Opposite Self AlphaBlend", "AC2 Distort", "Reverse Distort", "Opposite Distort", "Opposite Self AlphaBlend", "AC2 Distort", "Reverse Distort", "Opposite Distort",

View File

@@ -7,7 +7,7 @@
#ifndef _QT_HEADERS__ #ifndef _QT_HEADERS__
#define _QT_HEADERS__ #define _QT_HEADERS__
#define ac_version "v1.02" #define ac_version "v1.03"
#include<QApplication> #include<QApplication>
#include<QMainWindow> #include<QMainWindow>