I would like to create a command line application that generates jpg images using Quil. I plan to write a couple of common image processing functions for mixing and matching (some forms of fn drawing and some manipulations with an array of pixels).
A simple example of what I would like to do is to create one function that draws a circle, and then a second function that applies a smoothing algorithm to the pixel matrix.
(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)
Which causes me some grief, all Quil functions seem to work only inside the sketch macro. This means that my own functions using the internal Quil functions, in turn, cannot be called directly (they must be called from the drawing function called by the sketch macro), which makes debugging and individually performed from more complicated / impossible.
How do I create and debug such common functions? Am I stuck with thumbnail functions on my behalf or is there another way?
There is also the possibility that Quil is not suitable for my project. I look directly at using java / processing classes.
My development environment is Emacs + Cider.
thank
source
share