aboutsummaryrefslogtreecommitdiff
path: root/Plugins/rgbcopy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/rgbcopy.cpp')
-rw-r--r--Plugins/rgbcopy.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/Plugins/rgbcopy.cpp b/Plugins/rgbcopy.cpp
new file mode 100644
index 0000000..b226e23
--- /dev/null
+++ b/Plugins/rgbcopy.cpp
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <string.h>
+#include "plugin.h"
+#include "pixels.h"
+
+void perform_copy(_frame f1, _frame f2, _args a)
+{
+ pixels p1(f1), p2(f2);
+ char *t;
+ short r=0, g=0, b=0;
+
+ if(!a.s) return;
+
+ if(strstr(a.s, "r") || strstr(a.s, "R")) r=1;
+ if(strstr(a.s, "g") || strstr(a.s, "G")) g=1;
+ if(strstr(a.s, "b") || strstr(a.s, "B")) b=1;
+
+ while(!p1.eof()&&!p2.eof())
+ {
+ p2.putrgb(
+ r ? p1.red() : p2.red(),
+ g ? p1.green() : p2.green(),
+ b ? p1.blue() : p2.blue()
+ );
+ p1.next();
+ p2.next();
+ }
+}