#lang scribble/doc
@(require scribble/manual
(for-label scheme "tiles.ss" teachpack/htdp/image))
@title{Tiles Teachpack}
@defmodule[tiles]
@section{This teachpack}
The @bold{tiles} teachpack provides a variety of functions for combining and
manipulating images. Imagine that each image were on a ceramic tile;
you would expect to be able to put two tiles together side by side, or
one above another, or rotate a tile, etc. That's exactly what this
teachpack provides.
@defproc[(image-above (img1 image?) (img2 image?) ...) image?]
Combines two or more images into one, putting the first above the second (above the third, ...).
@defproc[(image-above-align-right (img1 image?) (img2 image?) ...) image?]
Just like image-above, but lines up the right-hand edges of all the images.
@defproc[(image-above-align-left (img1 image?) (img2 image?) ...) image?]
Just like image-above, but lines up the left-hand edges of all the images.
@defproc[(image-above-align-center (img1 image?) (img2 image?) ...) image?]
Just like image-above, but lines up the centers of all the images.
@defproc[(image-beside (img1 image?) (img2 image?) ...) image?]
Combines two or more images into one, putting the first to the left of the second
(to the left of the third, ...).
@defproc[(image-beside-align-top (img1 image?) (img2 image?) ...) image?]
Just like image-beside, but lines up the top edges of all the images.
@defproc[(image-beside-align-bottom (img1 image?) (img2 image?) ...) image?]
Just like image-beside, but lines up the bottom edges of all the images.
@defproc[(image-beside-align-center (img1 image?) (img2 image?) ...) image?]
Just like image-beside, but lines up the centers of all the images.
@defproc[(reflect-vert (img image?)) image?]
Flips an image top-to-botom.
@defproc[(reflect-horiz (img image?)) image?]
Flips an image left-to-right.
@defproc[(reflect-main-diag (img image?)) image?]
Flips an image from top-right to bottom-left, leaving the top-left and bottom-right unchanged.
@defproc[(reflect-other-diag (img image?)) image?]
Flips an image from top-left to bottom-right, leaving the top-right and bottom-left unchanged.
@defproc[(rotate-cw (img image?)) image?]
Rotates an image 90 degrees clockwise.
@defproc[(rotate-ccw (img image?)) image?]
Rotates an image 90 degrees counterclockwise.
@defproc[(rotate-180 (img image?)) image?]
Rotates an image 180 degrees around its center.
@;{
image-above-align-center
image-beside-align-center
;}
@defproc[(show-pinhole (img image?)) image?]
Overlays a small black dot at the pinhole of the given image, so you can
see where it is. (This function will go away when pinholes go away....)
@defproc[(crop-top (img image?) (pixels natural-number/c)) image?]
Chops off the specified number of pixels from the top of the image.
@defproc[(crop-bottom (img image?) (pixels natural-number/c)) image?]
Chops off the specified number of pixels from the bottom of the image.
@defproc[(crop-left (img image?) (pixels natural-number/c)) image?]
Chops off the specified number of pixels from the left side of the image.
@defproc[(crop-right (img image?) (pixels natural-number/c)) image?]
Chops off the specified number of pixels from the right side of the image.
@section{Functions from image.ss}
Since anybody using these functions will almost certainly also want to
use other image-creation and image-manipulation functions, this
teachpack @italic{includes} the standard teachpack @bold{image.ss}.
That is, if you have @bold{tiles.ss} loaded, you don't also need
@bold{image.ss} (and you're better off not loading it).
@; @include-section{image.ss}