a guest Jun 16th, 2012 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # Dataflow chaining is the combination of more than 2 functions.
- # This is how the data flows in this example code:
- getWebcamImage -> addFilters -> showOnScreen
- # This class symbolizes our image data which is a simple integer in this case
- my.data = rand(-100, 100)
- return my.data
- data newData
- my.data = newData
- # Capture one frame
- return WebcamImage()
- # Process image
- addFilters image
- source = image.data
- image.data = source + rand(-100, 100)
- return image
- # Show it on the screen
- showOnScreen image
- print image.data
- # Theoretically you can create a main loop now.
- # To demonstrate the data flow I'm just going to do this 10 times:
- for i = 1 to 10
RAW Paste Data