From e59d89f39f090f8feb16a48ed150e5ac48c2858f Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Sat, 10 Aug 2024 22:53:12 +0900 Subject: Rename procedures from `image-*` to `pnm-image-*` --- README.md | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 35cbc47..34ec222 100644 --- a/README.md +++ b/README.md @@ -14,93 +14,94 @@ accessing and modifying pixel data. ### Image -#### `(image? x) → boolean` +#### `(pnm-image? x) → boolean` -Returns `#t` if `x` is a valid image object; otherwise, it returns +Returns `#t` if `x` is a valid pnm-image object; otherwise, it returns `#f`. -#### `(image-type image) → 'pbm | 'pgm | 'ppm` +#### `(pnm-image-type pnm-image) → 'pbm | 'pgm | 'ppm` -Returns the type of the given image. +Returns the type of the given pnm-image. - `pbm`: Portable Bit Map - `pgm`: Portable Gray Map - `ppm`: Portable Pixel Map -#### `(image-width image) → integer` +#### `(pnm-image-width pnm-image) → integer` -Returns the width of `image`. +Returns the width of `pnm-image`. -#### `(image-height image) → integer` +#### `(pnm-image-height pnm-image) → integer` -Returns the height of `image`. +Returns the height of `pnm-image`. ### PBM (Portable Bit Map) -#### `(make-pbm-image width height) → ` +#### `(make-pbm-image width height) → ` Returns a new Portable Bit Map (PBM) image with the specified width and height. -#### `(image-maxval pbm-image) → #t` +#### `(pnm-image-maxval pbm-image) → #t` Returns the maximum value for pixel intensity in a PBM image, which is + always `#t` for PBM images, indicating binary values (black and white). -#### `(image-ref pbm-image x y) → boolean` +#### `(pnm-image-ref pbm-image x y) → boolean` Returns the value of the pixel at coordinates `(x, y)` in the specified `image`. The return value is `#t` for a white pixel and `#f` for a black pixel. -#### `(image-set! pbm-image x y b)` +#### `(pnm-image-set! pbm-image x y b)` -Sets the pixel at coordinates `(x, y)` in the specified `image` to +Sets the pixel at coordinates `(x, y)` in the specified `pnm-image` to the boolean value `b`. If `b` is `#t`, the pixel is set to white; if `#f`, it is set to black. ### PGM (Portable PGM Map) -#### `(make-pgm-image width height [maxval]) → ` +#### `(make-pgm-image width height [maxval]) → ` Creates a new Portable Gray Map (PGM) image with the specified width and height. The optional `maxval` parameter defines the maximum pixel intensity, defaulting to 255 if not provided. -#### `(image-maxval pgm-image) → integer` +#### `(pnm-image-maxval pgm-image) → integer` Returns the maximum pixel intensity value for the specified PGM image. -#### `(image-ref pgm-image x y) → integer` +#### `(pnm-image-ref pgm-image x y) → integer` Returns the gray value of the pixel at coordinates `(x, y)` in the specified PGM image. The value is an integer between 0 and `maxval`. -#### `(image-set! pgm-image x y v)` +#### `(pnm-image-set! pgm-image x y v)` Sets the pixel at coordinates `(x, y)` in the specified PGM image to the given integer value `v`, which must be between 0 and `maxval`. ### PPM (Portable PPM Map) -#### `(make-ppm-image width height [maxval]) → ` +#### `(make-ppm-image width height [maxval]) → ` Creates a new Portable Pixel Map (PPM) image with the specified width and height. The optional `maxval` parameter defines the maximum color intensity, defaulting to 255 if not provided. -#### `(image-maxval ppm-image) → integer` +#### `(pnm-image-maxval ppm-image) → integer` Returns the maximum color intensity value for the specified PPM image. -#### `(image-ref ppm-image x y) → (values integer integer integer)` +#### `(pnm-image-ref ppm-image x y) → (values integer integer integer)` Returns the RGB values of the pixel at coordinates `(x, y)` in the specified PPM image as three integers, representing the red, green, and blue components, respectively. -### `(image-set! ppm-image x y r g b)` +### `(pnm-image-set! ppm-image x y r g b)` Sets the pixel at coordinates `(x, y)` in the specified PPM image to the given RGB values `r`, `g`, and `b`, which must be integers between @@ -109,7 +110,7 @@ the given RGB values `r`, `g`, and `b`, which must be integers between ### Reading -#### `(image-read port) → ` +#### `(pnm-image-read port) → ` Reads a PNM image from the specified input `port` and returns the corresponding image object (PBM, PGM, or PPM). @@ -117,14 +118,14 @@ corresponding image object (PBM, PGM, or PPM). ### `(pnm-parse-error? exn) → boolean` Returns `#t` if the exception `exn` is a parse error that occurred -during the execution of the `image-read` procedure; otherwise, it +during the execution of the `pnm-image-read` procedure; otherwise, it returns `#f`. ### Writing -### `(image-write image port)` +### `(pnm-image-write pnm-image port)` -Writes the specified `image` (PBM, PGM, or PPM) to the given output +Writes the specified `pnm-image` (PBM, PGM, or PPM) to the given output `port`. ### Downloading Code with Git -- cgit v1.2.3