[plt-scheme] 2htdp/image

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Nov 16 20:47:58 EST 2009

On Mon, Nov 16, 2009 at 7:24 PM, Todd O'Bryan <toddobryan at gmail.com> wrote:
> Robby,
> I just started looking at the new image2e teachpack and it looks
> great. The extra triangles, polygons, etc. are especially welcome.
> However, is there any reason you set out to break backwards compatibility?
> For example, the new overlay method draws front to back whereas the
> old one did back to front.

This was an often requested change. So was the lack of pinholes.

> The new one also lines pictures up on the
> top right corner whereas the old one used pinholes, which for most
> images were in the center. Having the new versions of overlay and
> overlay/xy do roughly what the old ones did seems like it would make
> adoption fairly painless, so if they could default to back to front
> and line up on centers, I'd be really happy.

Lining up on the upper-left was the "default" for scenes, which is why
I did it that way.

Have you tried porting any of the old code to compare what is really better?

> Ditto with beside and above--any way those could default to use
> centers, since that's often the most reasonable way to line up images?
> Then beside-places and above-places would be available for other
> choices.
> I'm also missing image->color-list, color-list->image,
> image->alpha-color-list, and alpha-color-list->image. Were you
> planning to add them or no?

It isn't possible to write color-list->image anymore, but I was
planning to add color-list->bitmap and image->color-list eventually,

> Since we'll be using images before we've gotten to polymorphic
> functions, can you provide image=? and image=~? so students don't get
> a whiff of equal? and equal~? before they should?

Sure. I can make image=? work on the new library (and add image=~? if
it isn't there).

> Finally, there are a few functions that Stephen Bloch's tiles
> teachpack provides that would be nice:
> rotate-cw
> rotate-ccw
> rotate-180
>  (these are nice because students can flip things around before
> knowing how to use any kinds of arguments other than images)

I'm not a big fan of the first two names there, since they seem like
they should take other arguments (cw and ccw sound like directions,
not amounts). Any other suggestions?

> reflect-vert
> reflect-horiz
> reflect-main-diag
> reflect-other-diag
>  (I don't think you have reflection in there, yet)

I do plan to add reflection.

> crop-top
> crop-bottom
> crop-left
> crop-right
>  (really nice for cutting off parts and putting back together)

These are not easy. Specifically, handling cropping is easy in the old
library (which is what Bloch's library builds on) but in the current
one you have to consider equality and cropping makes that tricky (the
set of images you can make is not closed under cropping). So I had not
planned to add them.


Posted on the users mailing list.