blob: 5f262064f433ea8bf0766fa825ad72fbc382dba8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
//
// fader - fade image according to brightness of another image
//
#include "plugin.h"
#include "pixels.h"
INFO("fade image according to brightness of another image");
void perform_copy(_frame f1, _frame f2, _args a)
{
pixels p1(f1), p2(f2);
byte r, g, b;
while(!p1.eof() && !p2.eof())
{
r = p1.red() * (float)(p2.red() / 255.0);
g = p1.green() * (float)(p2.green() / 255.0);
b = p1.blue() * (float)(p2.blue() / 255.0);
p2.putrgb(r, g, b);
p1.next();
p2.next();
}
}
|