flowsamples 0.46.0

A set of sample 'flow' programs
flow = "render"

[[input]]
name = "filename"
type = "string"

[[input]]
name = "size"
type = "array/number"

[[input]]
name = "bounds"
type = "array/array/number"

[[input]]
name = "pixel"
type = "array/number" # Workaround

# Convert a pixel coordinates ot a point in the imaginary space
[[process]]
alias = "p2p"
source = "pixel_to_point/pixel_to_point"

# Buffer and Loop back the bounds for each pixel
[[process]]
alias = "buffer_bounds"
source = "lib://flowstdlib/data/buffer"

[[connection]]
from = "input/bounds"
to = "buffer_bounds"

[[connection]]
from = "buffer_bounds"
to = "buffer_bounds"

[[connection]]
from = "buffer_bounds"
to = "p2p/bounds"

# Buffer and Loop back the size for each pixel
[[process]]
alias = "buffer_size"
source = "lib://flowstdlib/data/buffer"

[[connection]]
from = "input/size"
to = "buffer_size"

[[connection]]
from = "buffer_size"
to = "buffer_size"

[[connection]]
from = "buffer_size"
to = "p2p/size"

[[connection]]
from = "input/pixel"
to = "p2p/pixel"

# function to render a pixel in the imaginary space to a value
[[process]]
alias = "p2v"
source = "escapes/escapes"

# Output of p2p is a [pixel, point] pair -> pass it to render
[[connection]]
from = "p2p"
to = "p2v/pixel_point"

# An image buffer to accumulate the results
[[process]]
source = "context://image/image_buffer"

# connect up the image buffer with filename and size - buffering them for each pixel
[[process]]
alias = "filename_buffer"
source = "lib://flowstdlib/data/buffer"

[[connection]]
from = "input/filename"
to = "filename_buffer"

[[connection]]
from = "filename_buffer"
to = "filename_buffer"

[[connection]]
from = "filename_buffer"
to = "image_buffer/filename"

[[process]]
alias = "size_buffer"
source = "lib://flowstdlib/data/buffer"

[[connection]]
from = "input/size"
to = "size_buffer"

[[connection]]
from = "size_buffer"
to = "size_buffer"

[[connection]]
from = "size_buffer"
to = "image_buffer/size"

# send each pixel from [pixel, value] pair from p2v to the image buffer
[[connection]]
from = "p2v/0"
to = "image_buffer/pixel"

# send each value from [pixel, value] pair from p2v to the image buffer
[[connection]]
from = "p2v/1"
to = "image_buffer/value"