diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-07-17 15:38:31 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-07-17 15:38:31 +0100 |
| commit | 9cf113df8b50c0c6f5132d3bd8b803db5332d9e6 (patch) | |
| tree | b7dbdf0aa80b2dc3b45eb031ceb7e04582e2d9e4 /rotord/cvimage.cpp | |
| parent | 7e3657d7783b7a6cdb48719d17ec3ac381dd8ae7 (diff) | |
glitchy blend modes
Diffstat (limited to 'rotord/cvimage.cpp')
| -rw-r--r-- | rotord/cvimage.cpp | 14 |
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; |
