Hi Daniel, I have a functional bitmap library[1] as a part of my CSS engine. This library is inspired by the official pict-lib and flomap(images-lib), and handles bitmap% directly. I don't think it is efficient enough since every functional operation creates another bitmap%.
Here I recommend you to take a look at the flomap, it is written in typed racket and represents high precision bitmap objects with flvector, composition and transformation should therefore efficient. You just need to convert the flomap struct into a bitmap% instance when drawing(you might need to take care of the backing scale). The basic composition is simple, you can write your own version within a day, but the performance ceiling may relate to Racket instead of algorithms you picked(since algorithms are already simple enough). If performance is really a problem, you may want to write your own library with Racket Futures. [1]https://github.com/wargrey/css/tree/master/bitmap On Wed, Apr 26, 2017 at 12:09 PM, Daniel Prager <daniel.a.pra...@gmail.com> wrote: > Much as I enjoy making images using 2htdp/image it does get a tad slow as > complexity increases. > > I currently have a program in which I generate images in 2htdp/image and > translate them into bitmap%s per racket/gui and render on canvas%'s via a > dc. > > Speed has become sluggish and I'm going to need to move away from > 2htdp/image to address this. > > A typical image is built up out of lots of above, beside, overlay, square, > and triangle calls. > > Does anyone have a "clever" way to do this programatically (rather than a > manual re-write with lots of absolute calculations replacing heights and > widths)? > > Many thanks > > Dan > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.