From f7fcf8cdea57a043b99d90549407195ea1148042 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 16 Jul 2013 15:55:57 +0100 Subject: alpha not yet working --- rotord/cvimage.cpp | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) (limited to 'rotord/cvimage.cpp') diff --git a/rotord/cvimage.cpp b/rotord/cvimage.cpp index 3a070a9..2130fc6 100644 --- a/rotord/cvimage.cpp +++ b/rotord/cvimage.cpp @@ -3,7 +3,6 @@ using namespace std; namespace Rotor { - //believe these still work, don't know if these optimisations are better than opencvs.. Image & Image::operator+=(const Image &other) { if (other.w!=w||other.h!=h) { cerr<<"Rotor: cannot add images with different sizes! (wanted "< ichans,ochans; + //vector compchans; + //cv::split(rgb,ichans); + //cv::split(other.rgb,ochans); + //uint8_t b=0xFF; + //cv::Mat iA=b-other.alpha; + //cv::Mat iA=cv::Mat(h,w,CV_8UC1); + //for (int i=0;i>8)+((((int)other.rgb.data[i])*((int)other.alpha.data[i/3])>>8))); + + } + } + + return *this; + } + Image & Image::alpha_merge(const Image &other) { + //converts the incoming image to monochrome and inserts it into the alpha channel of this image + if (other.w!=w||other.h!=h) { + cerr<<"Rotor: cannot merge alpha with different size! (wanted "<