26.01.2015 Views

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

E.4 Gaussian Filter<br />

RtFloat<br />

RiGaussianFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth)<br />

{<br />

x *= 2.0 / xwidth;<br />

y *= 2.0 / ywidth;<br />

return exp(–2.0 * (x*x + y*y));<br />

}<br />

E.5 Sinc Filter<br />

RtFloat<br />

RiSincFilter (RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth)<br />

{<br />

RtFloat s, t;<br />

if (x > –0.001 && x < 0.001)<br />

s = 1.0;<br />

else<br />

s = sin(x)/x;<br />

if (y > –0.001 && y < 0.001)<br />

t = 1.0;<br />

else<br />

t = sin(y)/y;<br />

return s*t;<br />

}<br />

196

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!