Coder Social home page Coder Social logo

panbrowser's Introduction

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

panbrowser's People

Contributors

terryspitz avatar davidglassborow avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

davidglassborow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.