functional image synthesis. pan an image synthesis “language” images are functions continuous...

16
Functional Image Synthesis

Upload: ashly-stowe

Post on 01-Apr-2015

227 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Functional Image Synthesis

Page 2: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Pan

• An image synthesis “language”

• Images are functions

• Continuous and infinite

• Embedded in a functional host language

• Reusable optimizing compiler

Page 3: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Examples

Page 4: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

What’s an image?

• Assignment of color to points:

R2 Color

• Infinite, but color may be transparent

• Useful generalization:

R2

Page 5: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Expressing functions

• Use -calculus (Church, Curry, etc):

• Or, non-anonymously:

• Currying isomorphism:

( )

Good for partial application

Page 6: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Spatial transforms

Page 7: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Images

Page 8: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Higher-order functions

Apply filter “about” a point:

Page 9: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Examples

Page 10: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Programming example

Page 11: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Another

Page 12: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Some details

Page 13: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Another

Page 14: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Implementation

• An “embedded language”, but compiled.

• Programs manipulate expression trees.

• Almost transparent, via overloading.

• Automatic full inlining.

• Simplification via smart constructors.

• First-order CSE and loop hoisting.

• Easy to reuse for new “language”.

Page 15: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

More examples

Page 16: Functional Image Synthesis. Pan An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable

Conclusions

• Modular & efficient image synthesis• DSL design & implementation technique:

– Simple, computable semantics– Embed in functional host language– Reusable optimizer & code generator

• To try: sound, 3D, …• Freely available – try it out:

http://research.microsoft.com/~conal/pan