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 361999b..adf4267 100644 --- a/rotord/src/cvimage.cpp +++ b/rotord/src/cvimage.cpp @@ -126,6 +126,18 @@ namespace Rotor { } return *this; } + Image & Image::alpha_from_cv(cv::Mat &other){ + //if (other.w!=w||other.h!=h) { + // cerr<<"Rotor: cannot merge alpha with different size! (wanted "<<w<<"x"<<h<<", got "<<other.w<<"x"<<other.h<<")"<<endl; + //} + //else { + if (other.channels()==1) { + alpha=other; + } + else cv::cvtColor(other,alpha,CV_RGB2GRAY); + //} + return *this; + } Image & Image::operator=(const Image &other) { //can be optimised? was trying to use other.data.clone() setup(other.w,other.h); |
