mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-13 18:30:02 +01:00
updated add Plugin callback
This commit is contained in:
24
src/ac.cpp
24
src/ac.cpp
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
// Acid Cam namespace
|
// Acid Cam namespace
|
||||||
namespace ac {
|
namespace ac {
|
||||||
const std::string version="2.3.4";
|
const std::string version="2.3.5";
|
||||||
// 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;
|
||||||
@@ -97,6 +97,7 @@ namespace ac {
|
|||||||
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;
|
DrawFunction custom_callback = 0;
|
||||||
|
DrawFunction plugin_func = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// globals
|
// globals
|
||||||
@@ -4831,9 +4832,8 @@ void ac::ScanSwitch(cv::Mat &frame) {
|
|||||||
unsigned int h = frame.rows;// frame height
|
unsigned int h = frame.rows;// frame height
|
||||||
static unsigned int start_index = 0;
|
static unsigned int start_index = 0;
|
||||||
unsigned int index = start_index;
|
unsigned int index = start_index;
|
||||||
cv::Mat temp = frame.clone();
|
for(unsigned int z = 3; z < h-3; ++z) {
|
||||||
for(unsigned int z = 1; z < h-1; ++z) {
|
for(unsigned int i = 3; i < w-3; ++i) {
|
||||||
for(unsigned int i = 1; i < w-1; ++i) {
|
|
||||||
cv::Vec3b &pixel = frame.at<cv::Vec3b>(z, i);
|
cv::Vec3b &pixel = frame.at<cv::Vec3b>(z, i);
|
||||||
switch(index) {
|
switch(index) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -4864,9 +4864,8 @@ void ac::ScanAlphaSwitch(cv::Mat &frame) {
|
|||||||
static unsigned int start_index = 0;
|
static unsigned int start_index = 0;
|
||||||
static double alpha = 1.0, alpha_max = 10.0;
|
static double alpha = 1.0, alpha_max = 10.0;
|
||||||
unsigned int index = start_index;
|
unsigned int index = start_index;
|
||||||
cv::Mat temp = frame.clone();
|
for(unsigned int z = 3; z < h-3; ++z) {
|
||||||
for(unsigned int z = 1; z < h-1; ++z) {
|
for(unsigned int i = 3; i < w-3; ++i) {
|
||||||
for(unsigned int i = 1; i < w-1; ++i) {
|
|
||||||
cv::Vec3b &pixel = frame.at<cv::Vec3b>(z, i);
|
cv::Vec3b &pixel = frame.at<cv::Vec3b>(z, i);
|
||||||
switch(index) {
|
switch(index) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -5423,5 +5422,14 @@ void ac::setCustom(DrawFunction f) {
|
|||||||
void ac::custom(cv::Mat &frame) {
|
void ac::custom(cv::Mat &frame) {
|
||||||
if(custom_callback != 0)
|
if(custom_callback != 0)
|
||||||
custom_callback(frame);
|
custom_callback(frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ac::setPlugin(DrawFunction f) {
|
||||||
|
plugin_func = f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ac::plugin(cv::Mat &frame) {
|
||||||
|
if(plugin_func != 0) {
|
||||||
|
plugin_func(frame);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
src/ac.h
2
src/ac.h
@@ -289,6 +289,7 @@ namespace ac {
|
|||||||
void plugin(cv::Mat &frame);
|
void plugin(cv::Mat &frame);
|
||||||
// set Custom Filter callback function
|
// set Custom Filter callback function
|
||||||
void setCustom(DrawFunction f);
|
void setCustom(DrawFunction f);
|
||||||
|
void setPlugin(DrawFunction f);
|
||||||
// color maps
|
// color maps
|
||||||
void ApplyColorMap(cv::Mat &frame);
|
void ApplyColorMap(cv::Mat &frame);
|
||||||
// color correction
|
// color correction
|
||||||
@@ -299,6 +300,7 @@ namespace ac {
|
|||||||
void filterFade(cv::Mat &frame, int filter1, int filter2, double alpha);
|
void filterFade(cv::Mat &frame, int filter1, int filter2, double alpha);
|
||||||
// draw functions / strings
|
// draw functions / strings
|
||||||
extern std::string draw_strings[];
|
extern std::string draw_strings[];
|
||||||
|
extern DrawFunction plugin_func;
|
||||||
extern DrawFunction draw_func[];
|
extern DrawFunction draw_func[];
|
||||||
extern int draw_max;
|
extern int draw_max;
|
||||||
extern bool snapShot;
|
extern bool snapShot;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ void draw_plugin(cv::Mat &frame, int filter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ac::plugin(cv::Mat &) {
|
void plugin_callback(cv::Mat &) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user