Functional Image Synthesis Pan An image synthesis language

  • Slides: 16
Download presentation
Functional Image Synthesis

Functional Image Synthesis

Pan • • • An image synthesis “language” Images are functions Continuous and infinite

Pan • • • An image synthesis “language” Images are functions Continuous and infinite Embedded in a functional host language Reusable optimizing compiler

Examples

Examples

What’s an image? • Assignment of color to points: R 2 Color • Infinite,

What’s an image? • Assignment of color to points: R 2 Color • Infinite, but color may be transparent • Useful generalization: R 2 a

Expressing functions • Use l-calculus (Church, Curry, etc): • Or, non-anonymously: • Currying isomorphism:

Expressing functions • Use l-calculus (Church, Curry, etc): • Or, non-anonymously: • Currying isomorphism: (a b) g a (b g ) Good for partial application

Spatial transforms

Spatial transforms

Images

Images

Higher-order functions Apply filter “about” a point:

Higher-order functions Apply filter “about” a point:

Examples

Examples

Programming example

Programming example

Another

Another

Some details

Some details

Another

Another

Implementation • An “embedded language”, but compiled. • Programs manipulate expression trees. • Almost

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”.

More examples

More examples

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

Conclusions • Modular & efficient image synthesis • DSL design & implementation technique: – Simple, computable semantics – Embed in functional host language – Reusable optimizer & code generator • To try: sound, 3 D, … • Freely available – try it out: http: //research. microsoft. com/~conal/pan