summaryrefslogtreecommitdiff
path: root/rotord/cvimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/cvimage.cpp')
-rw-r--r--rotord/cvimage.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/rotord/cvimage.cpp b/rotord/cvimage.cpp
index 5402a8e..a82c1ec 100644
--- a/rotord/cvimage.cpp
+++ b/rotord/cvimage.cpp
@@ -33,7 +33,19 @@ namespace Rotor {
else {
for (int i=0;i<w*h*3;i++){
//creates rainbow overload, openCV doesn't do this
- RGBdata[i]=(unsigned char)(((int)other.RGBdata[i]+(int)RGBdata[i]));
+ rgb.data[i]=(unsigned char)(((int)other.rgb.data[i]+(int)rgb.data[i]));
+ }
+ }
+ return *this;
+ }
+ Image & Image::divide_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;
+ }
+ else {
+ for (int i=0;i<w*h*3;i++){
+ //creates rainbow overload, openCV doesn't do this
+ rgb/=other.rgb; //does funny glitchy stuff
}
}
return *this;