Revision: | 1.2 |
Committed: | Wed Nov 30 21:26:39 2011 UTC (12 years, 5 months ago) by greg |
Branch: | MAIN |
CVS Tags: | rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad4R2, rad4R2P1, rad5R3, HEAD |
Changes since 1.1: | +3 -1 lines |
Log Message: | Added check for negative green channel |
# | Content |
---|---|
1 | { RCSid $Id$ } |
2 | { |
3 | Compute difference between luminance of two images. |
4 | Display towards red where first image is brighter, |
5 | and towards blue where second image is brighter. |
6 | |
7 | 29 August 1991 |
8 | } |
9 | l1=li(1); l2=li(2); |
10 | pos(x):if(x,x,0); |
11 | avg=(l1+l2)/2; |
12 | dif=(l1-l2)/2; |
13 | ro=avg+dif; |
14 | go=pos(avg-dif*dif/2); |
15 | bo=avg-dif; |