mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-16 20:00:01 +01:00
now supports color key images with 255,0,255 as the color key (only pixels that are 255,0,255) are drawn
This commit is contained in:
@@ -152,7 +152,11 @@ void Playback::drawEffects(cv::Mat &frame) {
|
||||
if(saturation_ > 0) {
|
||||
ac::setSaturation(frame, saturation_);
|
||||
}
|
||||
|
||||
if(colorkey_set == true && !color_image.empty()) {
|
||||
cv::Mat cframe = frame.clone();
|
||||
cv::Vec3b well_color(255,0,255);
|
||||
ac::filterColorKeyed(well_color, ac::orig_frame, cframe, frame);
|
||||
}
|
||||
}
|
||||
|
||||
void Playback::drawFilter(cv::Mat &frame, std::pair<int, int> &filter) {
|
||||
@@ -245,6 +249,15 @@ Playback::~Playback() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void Playback::Clear() {
|
||||
mutex.lock();
|
||||
blend_set = false;
|
||||
colorkey_set = false;
|
||||
blend_image.release();
|
||||
color_image.release();
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
void Playback::Stop() {
|
||||
stop = true;
|
||||
alpha = 0;
|
||||
@@ -280,6 +293,13 @@ void Playback::setImage(const cv::Mat &frame) {
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
void Playback::setColorKey(const cv::Mat &image) {
|
||||
mutex.lock();
|
||||
colorkey_set = true;
|
||||
color_image = image;
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
void Playback::filterFade(cv::Mat &frame, std::pair<int, int> &filter1, std::pair<int, int> &filter2, double alpha) {
|
||||
unsigned int h = frame.rows; // frame height
|
||||
unsigned int w = frame.cols;// framew idth
|
||||
|
||||
Reference in New Issue
Block a user