From 44c13aad4de51fc0d30992f5dccb053669fa29d6 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 17 Jul 2013 12:16:12 +0100 Subject: timed pixelcorps version of alpha_merge is faster than openCV --- rotord/cvimage.cpp | 7 +++---- rotord/cvimage.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'rotord') diff --git a/rotord/cvimage.cpp b/rotord/cvimage.cpp index ca094d3..cb10fdd 100644 --- a/rotord/cvimage.cpp +++ b/rotord/cvimage.cpp @@ -33,8 +33,8 @@ namespace Rotor { } return *this; } - //THESE CAN BE OPTIMISED - LOOK INTO USING OPENCV HERE - Image & Image::alpha_blend(const Image &other) { + //THIS OPENCV VERSION IS SLOWER THAN THE OLDSKOOL VERSION BELOW + Image & Image::alpha_blend_cv(const Image &other) { if (other.w!=w||other.h!=h) { cerr<<"Rotor: cannot blend images with different sizes! (wanted "<>8)+((((int)other.rgb.data[i])*((int)other.alpha.data[i/3]))>>8)); } diff --git a/rotord/cvimage.h b/rotord/cvimage.h index c73ba70..0b767d8 100644 --- a/rotord/cvimage.h +++ b/rotord/cvimage.h @@ -162,7 +162,7 @@ namespace Rotor { Image & operator*=(const Image &other); Image & add_wrap(const Image &other); Image & alpha_blend(const Image &other); - Image & alpha_blend_old(const Image &other); + Image & alpha_blend_cv(const Image &other); Image & alpha_merge(const Image &other); Image & operator*=(const float &amount); Image * operator*(const float &amount); -- cgit v1.2.3