Skip to content

terryspitz/panbrowser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Description While at Microsoft Research, Conal Elliott wrote a paper describing Functional Images: images and effects created from the application of functions, and christened them Pan. PanBrowser implements a number of Pan functions in F#, and integrates them into a C# user interface.

Gallery

| Stripes with Caustic | Boxes with Caustic | Tiletext with Caustic | Rotors | | | | | | | bumpSwirl | another bumpSwirl | star swirl | herringbone with caustic | | | | | | | rainbowRings with flower | | | | | ![](Home_butterfly or bat.png) | | | |

GUI Features

Images and Transforms can only be written in the F# source code and compiled, but images and transforms can have parameters varied at runtime and can be composed:

  • Selection of images and transforms (currently only one transform, but planned to be multiple)
  • Sliders to set parameters to the functions
  • Standard scale, rotate and translation sliders for pre- and post-transformed image
  • Button to Save image
  • Background rendering of successively higher resolution images up to four-times oversampled (antialiased)
  • 3D Images and transforms - using a marching cubes algorithm to plot an outline or iso-surface
  • Trackball to rotate 3D images Planned features
  • Gallery feature to display multiple images, transforms or combinations of settings
  • Animation features to allow settings to be varied continuously - possible make this a screen-saver mode
  • Runtime editing and compilation of new images/transforms

Example Image Functions

For example, here's a Mandlebrot set in F#/Pan:

//an image is a function that takes a Point (x,y) and returns a bool or Color
let mandlebrot p =
	let rec checkMand z i =
		if i > 200 then black
		else if (distFromOrigin z) > 2.0 then
			intToColor i
		else 
			checkMand (addp (complex2 z) p) (i+1)  // recurse with z=z^2 + p
	in checkMand origin 0

And here's how you turn it inside-out:

let polarTransform xf = toPolar >> xf >> fromPolar

//a Transform is a function that takes an image function and returns a new image function
//so F# type is (Point -> 'a) -> Point -> 'a  
let radialInvert = 
    let invert (r, th) = ( 1.0/r, th ) in
    transformImage (polarTransform invert)

See Also: ExampleImages; Sliders

Inspired by

Great Graphics sites

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published