From ba67bbb2db6327dc0f64eab24bafe5f023ce42ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juha=20Vehvil=C3=A4inen?= Date: Mon, 17 Feb 2003 22:28:16 +0000 Subject: 0.32 svn path=/trunk/Framestein/; revision=418 --- Plugins/merge_additive.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Plugins/merge_additive.cpp (limited to 'Plugins/merge_additive.cpp') diff --git a/Plugins/merge_additive.cpp b/Plugins/merge_additive.cpp new file mode 100644 index 0000000..ee648ef --- /dev/null +++ b/Plugins/merge_additive.cpp @@ -0,0 +1,30 @@ +// +// merge_additive - add color components of two images, until white +// + +#include "plugin.h" +#include "pixels.h" + +INFO("add color components of two images until white"); + +void perform_copy(_frame f1, _frame f2, _args a) +{ + pixels p1(f1), p2(f2); + int r, g, b; + + while(!p1.eof() && !p2.eof()) + { + r = (p1.red() + p2.red()); + g = (p1.green() + p2.green()); + b = (p1.blue() + p2.blue()); + + r = r<256 ? r : 255; + g = g<256 ? g : 255; + b = b<256 ? b : 255; + + p2.putrgb(r, g, b); + + p1.next(); + p2.next(); + } +} -- cgit v1.2.1