diff --git a/src/ac.cpp b/src/ac.cpp index 961a76a..e208689 100644 --- a/src/ac.cpp +++ b/src/ac.cpp @@ -45,7 +45,7 @@ // Acid Cam namespace namespace ac { - const std::string version="2.3.3"; + const std::string version="2.3.4"; // 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; @@ -95,6 +95,7 @@ namespace ac { inline void procPos(int &direction, double &pos, double &pos_max, const double max_size = 15); std::unordered_map filter_map; bool color_map_set = false; + DrawFunction custom_callback = 0; } // globals @@ -5297,9 +5298,15 @@ void ac::BlendWithSource(cv::Mat &frame) { ac::pass2_alpha = 0.50; // set to 50% Pass2Blend(frame);// call Pass2 function } + +void ac::setCustom(DrawFunction f) { + custom_callback = f; +} + // call custom fitler defined elsewhere void ac::custom(cv::Mat &frame) { - custom_filter(frame); + if(custom_callback != 0) + custom_callback(frame); } diff --git a/src/ac.h b/src/ac.h index d061f29..592530f 100644 --- a/src/ac.h +++ b/src/ac.h @@ -118,7 +118,6 @@ namespace ac { inline T rol(T x, unsigned int m) { return (x << m) | (x >> (sizeof(T)*8 -m)); } - // Acid Cam Filter Function prototypes void SelfAlphaBlend(cv::Mat &frame); void SelfScale(cv::Mat &frame); @@ -284,6 +283,7 @@ namespace ac { void NoFilter(cv::Mat &frame); void BlendWithSource(cv::Mat &frame); void plugin(cv::Mat &frame); + void setCustom(DrawFunction f); // color maps void ApplyColorMap(cv::Mat &frame); @@ -359,6 +359,5 @@ namespace ac { } // custom filter function, must be defined in program so it will link extern ac::ParticleEmiter emiter; -extern void custom_filter(cv::Mat &frame); #endif diff --git a/src/main_window.cpp b/src/main_window.cpp index bc720b9..cd4006d 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -11,6 +11,7 @@ #include std::unordered_map> filter_map; +void custom_filter(cv::Mat &); const char *filter_names[] = { "AC Self AlphaBlend", "Reverse Self AlphaBlend", "Opposite Self AlphaBlend", "AC2 Distort", "Reverse Distort", "Opposite Distort", diff --git a/src/qtheaders.h b/src/qtheaders.h index 772470e..3fb8110 100644 --- a/src/qtheaders.h +++ b/src/qtheaders.h @@ -7,7 +7,7 @@ #ifndef _QT_HEADERS__ #define _QT_HEADERS__ -#define ac_version "v1.02" +#define ac_version "v1.03" #include #include