I would like to create a command line application that generates jpg images using Quil. I plan to write a couple of generic image processing functions to mix and match (some fn drawing shapes and some manipulating the pixel array).
A simple example of what I would like to do is create one function that draws a circle then a second function that applies a dither algorithm to the pixel array.
(defn draw-circle [x y] ...) ;; e.g. internally uses Quil draw functions.
(defn apply-dither [pixels] ...) ;; e.g. internally uses Quil color functions on the pixels array.
(defn draw []
(draw-circle 100 100)
(apply-dither (pixels))
...)
(defsketch sketch
:draw draw)
What is causing me a bit of grief is all Quil functions seems to only run within a sketch macro. This means that my own functions using the Quil functions internally in turn cannot be directly called (must be called from a draw function triggered by a sketch macro), making debugging and running them individually from the repl harder/impossible.
How do I go about creating and debugging such generic functions? Am I stuck having sketch call functions on my behalf or is there another way?
There is also the possibility that Quil isn't the right tool for my project. I'm considering directly using java / processing classes.
My development environment is Emacs + Cider.
Thanks