ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/filt.cal
Revision: 1.2
Committed: Wed Nov 21 18:10:45 2018 UTC (5 years, 5 months ago) by greg
Branch: MAIN
CVS Tags: rad5R3
Changes since 1.1: +1 -0 lines
Log Message:
Added missing RCSid tag

File Contents

# User Rev Content
1 greg 1.2 { RCSid $Id$ }
2 greg 1.1 {
3     Filter Kernal set-up for pcomb.
4    
5     5/22/92 Greg Ward
6    
7     Usage:
8     pcomb -x xres -y yres -f kern.cal -f filt.cal input.pic > output.pic
9    
10     The file "kern.cal" must define the constant function kern(x,y), which
11     describes how the kernal behaves as a function of offset in x and y
12     (measured in fractional pixels in the destination image).
13     }
14     hmag : xres/xmax;
15     vmag : yres/ymax;
16     step : (hmag+vmag)/8;
17     hsum(xmin,xmax,y) : if(step/2+xmin-xmax, 0,
18     kern(xmin+step/2,y) + hsum(xmin+step,xmax,y));
19     sum(xmin,ymin,xmax,ymax) : if(step/2+ymin-ymax, 0,
20     hsum(xmin,xmax,ymin+step/2) + sum(xmin,ymin+step,xmax,ymax));
21     k(ox,oy) : sum(ox-hmag/2,oy-vmag/2,ox+hmag/2,oy+vmag/2);
22     K00 : k(-1,-1); K01 : k(-1, 0); K02 : k(-1, 1);
23     K10 : k( 0,-1); K11 : k( 0, 0); K12 : k( 0, 1);
24     K20 : k( 1,-1); K21 : k( 1, 0); K22 : k( 1, 1);
25     sumtotal : K00+K01+K02+K10+K11+K12+K20+K21+K22;
26    
27     f(p) = ( K00*p(1,-1,-1) + K01*p(1,-1, 0) + K02*p(1,-1, 1) +
28     K10*p(1, 0,-1) + K11*p(1, 0, 0) + K12*p(1, 0, 1) +
29     K20*p(1, 1,-1) + K21*p(1, 1, 0) + K22*p(1, 1, 1) ) / sumtotal;
30    
31     ro = f(ri);
32     go = f(gi);
33     bo = f(bi);