diff options
Diffstat (limited to 'rotord/src/cvimage.cpp')
| -rw-r--r-- | rotord/src/cvimage.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rotord/src/cvimage.cpp b/rotord/src/cvimage.cpp index 74a21dd..8f2c181 100644 --- a/rotord/src/cvimage.cpp +++ b/rotord/src/cvimage.cpp @@ -138,6 +138,18 @@ namespace Rotor { //} return *this; } + Image & Image::overlay(cv::Mat &other){ + if (other.w!=w||other.h!=h) { + cerr<<"Rotor: cannot overlay images with different sizes! (wanted "<<w<<"x"<<h<<", got "<<other.w<<"x"<<other.h<<")"<<endl; + //why not?? + } + else { + for (int i=0;i<h*w*3;i++) { + rgb.data[i]=pixels.overlsy[rgb.data[i]][other.rgb.data[i]]; + } + } + return *this; + } Image & Image::operator=(const Image &other) { //can be optimised? was trying to use other.data.clone() setup(other.w,other.h); |
