summaryrefslogtreecommitdiff
path: root/rotord/src/cvimage.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@Adaptics.local>2013-11-05 15:05:23 +0000
committerTim Redfern <tim@Adaptics.local>2013-11-05 15:05:23 +0000
commitb60ef5570f005374e688d62c69017543befca74e (patch)
treeb1af031769b297295fa864a86df0b168a074ed6d /rotord/src/cvimage.cpp
parent8bba898010f1a8f728a0a7e91be93a0671a4efed (diff)
overlay in blend mode
Diffstat (limited to 'rotord/src/cvimage.cpp')
-rw-r--r--rotord/src/cvimage.cpp12
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);