From 0ead709016950ea93e2881cb4e56dbe78a97a320 Mon Sep 17 00:00:00 2001
From: Matthias Felleisen
Date: Tue, 18 Jul 2006 14:39:50 +0000
Subject: [PATCH] typos in image
svn: r3750
---
collects/teachpack/htdp/Docs/image.thtml | 155 ++++++++++++-----------
1 file changed, 79 insertions(+), 76 deletions(-)
diff --git a/collects/teachpack/htdp/Docs/image.thtml b/collects/teachpack/htdp/Docs/image.thtml
index ef141a23cf..f6a8aaffd9 100644
--- a/collects/teachpack/htdp/Docs/image.thtml
+++ b/collects/teachpack/htdp/Docs/image.thtml
@@ -1,64 +1,69 @@
{ (define LIBNAME "Images")
(include "head.tinc") }
-This teachpack provides primitives for constructing and manipulating
+This teachpack provides primitives for constructing and manipulating
images. Basic images are created as outlines or solid shapes. Additional
-primitives allow for the composition of images.
+primitives allow for the composition of images.
-Data definition:
+
Data definition:
-;; Mode is one of the following two symbols or strings:
+;; {(idx Mode)} is one of the following two symbols or strings:
;; -- 'solid
;; -- 'outline
;; -- "solid"
;; -- "outline"
-
-
-Interpretation: 'solid
is used for creating solid basic
-shapes; 'outline
is used for creating outlines of basic
-shapes. Strings are used in an analogous manner.
+
+;; Interpretation: 'solid
is used for creating solid basic
+;; shapes; 'outline
is used for creating outlines of basic
+;; shapes. Strings are used in an analogous manner.
+
Data definition:
-;; Color is one of:
+(define-struct color (red blue green))
+;; A CS is a structure: (make-color N N N)
+;; where N is between 0 and 255.
+
+;; {(idx Color)} is one of:
;; -- a color symbol, e.g., 'blue
;; -- a color string, e.g., "blue"
-;; -- a color struct, e.g., (make-color 0 0 255), which also denotes blue.
+;; -- a CS, e.g., (make-color 0 0 255), which also denotes blue.
+
+;; Interpretation: Color
arguments are used to paint the shapes
+;; or their outlines. See below for more information about color structs.
-Interpretation: Color
arguments are used to paint the shapes
-or their outlines. See below for more information about color structs.
The following predicate precisely specifies what a valid image color is:
-The following functions create basic shapes (Image
):
+The first group of functions creates basic shapes (Image
):
@@ -71,30 +76,30 @@ created from line
and text
, which have pinholes
at the top left. When in doubt you can always find out where the pinhole is
and even place it somewhere else:
The next group of functions build images from images:
Two more properties of images are useful for image manipulations: their
width and height. The two functions for extracting these properties are:
-{(idx image-width)}
: Image -> Int
+{(idx image-width)} : Image -> Int
to obtain an Image's width in pixels
-{(idx image-height)}
: Image -> Int
+{(idx image-height)} : Image -> Int
to obtain an image's height in pixels
+Data definition:
+
+
+;; List-of-color is one of:
+;; -- empty
+;; -- (cons Color List-of-color)
+
+
+Interpretation: represents a sequence of colors
+
+It is possible to extract an image's colors and pixels and to create images
+from a list of colors:
+
+{(idx image->color-list)} : Image -> List-of-color
+ to convert an image to a list of colors
+
+{(idx color-list->image)} : List-of-color Nat Nat Nat Nat -> Image
+ to convert a list of colors to an image with the given
+ width and height, and pinhole coordinates (the pinhole
+ coordinates are with respect to the top-left of the image).
+
+
+
The shrink functions trim an image by eliminating extraneous pixels.
-{(idx shrink-tl)}
: Image Int Int -> Image
+{(idx shrink-tl)} : Image Int Int -> Image
to shrink the image, starting from the top-left corner. The
two numbers indicate how many pixels to save.
The pinhole of the resulting image is in the middle of the image.
-{(idx shrink-tr)}
: Image Int Int -> Image
+{(idx shrink-tr)} : Image Int Int -> Image
to shrink the image, starting from the top-right corner. The
two numbers indicate how many pixels to save.
The pinhole of the resulting image is in the middle of the image.
-{(idx shrink-bl)}
: Image Int Int -> Image
+{(idx shrink-bl)} : Image Int Int -> Image
to shrink the image, starting from the bottom-left corner. The
two numbers indicate how many pixels to save.
The pinhole of the resulting image is in the middle of the image.
-{(idx shrink-br)}
: Image Int Int -> Image
+
+{(idx shrink-br)} : Image Int Int -> Image
to shrink the image, starting from the bottom-right corner. The
two numbers indicate how many pixels to save.
The pinhole of the resulting image is in the middle of the image.
-{(idx shrink)}
: Image Int Int Int Int -> Image
+{(idx shrink)} : Image Int Int Int Int -> Image
to shrink an image around its pinhole. The numbers are the
pixels to save to left, above, to the right, and below the
pinhole, respectively. The pixel directly on the pinhole is
always saved.
-
-
-The next functions separate an image into its consitiuent colors and
-combine pixels together to build an image.
-
-{(idx image->color-list)}
: image -> list-of-color
- to convert an image to a list of colors
-
-{(idx color-list->image)}
: list-of-color int int int int -> image
- to convert a list of colors to an image with the given
- width and height, and pinhole coordinates (the pinhole
- coordinates are with respect to the top-left of the image).
-{(idx make-color)}
: int int int -> color
- to construct a color
-{(idx color?)}
: anything -> boolean
- to determine if its input is a color
-{(idx color-red)}
: color -> int
- to extract the red component of a color
-{(idx color-green)}
: color -> int
- to extract the green component of a color
-{(idx color-blue)}
: color -> int
- to extract the blue component of a color
-
-
-Like the last group of functions, these functions separate
-an image into its consitiuent colors and combine pixels
-together to build an image, but these provide alpha-channel
-information as well. Alpha channels are a measure of
-transparency; 0 indicates fully opaque and 255 indicates
-fully transparent.
+The last group of functions extracts the consitiuent colors from an image
+and combine colors into an image, but the functions provide alpha-channel
+information as well. Alpha channels are a measure of transparency; 0
+indicates fully opaque and 255 indicates fully transparent.
-{(idx image->alpha-color-list)}
: image -> list-of-alpha-color
+{(idx image->alpha-color-list)} : image -> list-of-alpha-color
to convert an image to a list of alpha colors
-{(idx alpha-color-list->image)}
: list-of-alpha-color int int int int -> image
+{(idx alpha-color-list->image)} : list-of-alpha-color int int int int -> image
to convert a list of alpha colors to an image with the given
width and height, and pinhole coordinates (the pinhole
coordinates are with respect to the top-left of the image).
-{(idx make-alpha-color)}
: int int int int -> color
+{(idx make-alpha-color)} : int int int int -> color
to construct an alpha color
-{(idx alpha-color?)}
: anything -> boolean
+{(idx alpha-color?)} : anything -> boolean
to determine if its input is a color
-{(idx alpha-color-alpha)}
: color -> int
+{(idx alpha-color-alpha)} : color -> int
to extract the alpha value of a color
-{(idx alpha-color-red)}
: color -> int
+{(idx alpha-color-red)} : color -> int
to extract the red component of a color
-{(idx alpha-color-green)}
: color -> int
+{(idx alpha-color-green)} : color -> int
to extract the green component of a color
-{(idx alpha-color-blue)}
: color -> int
+{(idx alpha-color-blue)} : color -> int
to extract the blue component of a color"