summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rotord/cvimage.cpp9
-rw-r--r--rotord/cvimage.h1
-rwxr-xr-xrotord/rotor.h5
3 files changed, 15 insertions, 0 deletions
diff --git a/rotord/cvimage.cpp b/rotord/cvimage.cpp
index a82c1ec..c18c585 100644
--- a/rotord/cvimage.cpp
+++ b/rotord/cvimage.cpp
@@ -26,6 +26,15 @@ namespace Rotor {
}
return *this;
}
+ Image & Image::operator^=(const Image &other) {
+ if (other.w!=w||other.h!=h) {
+ cerr<<"Rotor: cannot add images with different sizes! (wanted "<<w<<"x"<<h<<", got "<<other.w<<"x"<<other.h<<")"<<endl;
+ }
+ else {
+ rgb^=other.rgb;
+ }
+ return *this;
+ }
Image & Image::add_wrap(const Image &other) {
if (other.w!=w||other.h!=h) {
cerr<<"Rotor: cannot add images with different sizes! (wanted "<<w<<"x"<<h<<", got "<<other.w<<"x"<<other.h<<")"<<endl;
diff --git a/rotord/cvimage.h b/rotord/cvimage.h
index a8a7a09..44cbca8 100644
--- a/rotord/cvimage.h
+++ b/rotord/cvimage.h
@@ -160,6 +160,7 @@ namespace Rotor {
//believe these still work, don't know if these optimisations are better than opencvs..
Image & operator+=(const Image &other);
Image & operator*=(const Image &other);
+ Image & operator^=(const Image &other);
Image & alpha_blend(const Image &other);
Image & alpha_blend_cv(const Image &other);
Image & alpha_merge(const Image &other);
diff --git a/rotord/rotor.h b/rotord/rotor.h
index 1b68f2b..293d3fa 100755
--- a/rotord/rotor.h
+++ b/rotord/rotor.h
@@ -1012,6 +1012,7 @@ namespace Rotor {
#define BLEND_alpha 4
#define BLEND_screen_wrap 5
#define BLEND_multiply_wrap 6
+ #define BLEND_xor 7
class Blend: public Image_node {
public:
Blend(){image=nullptr;};
@@ -1026,6 +1027,7 @@ namespace Rotor {
if (_mode=="alpha") mode=BLEND_alpha;
if (_mode=="screen_wrap") mode=BLEND_screen_wrap;
if (_mode=="multiply_wrap") mode=BLEND_multiply_wrap;
+ if (_mode=="xor") mode=BLEND_xor;
};
void link_params() {
for (auto p:parameter_inputs){
@@ -1049,6 +1051,9 @@ namespace Rotor {
case BLEND_multiply:
(*image)*=(*(((Image_node*)image_inputs[1]->connection)->get_output(frame)));
break;
+ case BLEND_xor:
+ (*image)^=(*(((Image_node*)image_inputs[1]->connection)->get_output(frame)));
+ break;
case BLEND_alpha:
(*image)=(*image).alpha_blend(*(((Image_node*)image_inputs[1]->connection)->get_output(frame)));
break;