Image File Transfer

Module ImageIO contains a number of operations for reading images from files and writing images to files (with the exception of the show procedures, no X window interface is needed). The binary versions of the PPM (portable pixel map) file format are used for color, gray scale, and binary images.
TYPE  c_image = RECORD
                  pixel       : grid OF COLOR; 
                  width,height: CARDINAL; 
                END; 
      g_image = RECORD 
                  pixel       : grid OF gray; 
                  width,height: CARDINAL; 
                END; 
      b_image = RECORD 
                  pixel       : grid OF binary;
                  width,height: CARDINAL;
                END;
Read image data from PPM-file (portable pixel map)

PROCEDURE read_c_image (filename: string): c_image; (* color *)
PROCEDURE read_g_image (filename: string): g_image; (* gray *)
PROCEDURE read_b_image (filename: string): b_image; (* binary*)

Write image data to PPM-file (portable pixel map)

PROCEDURE write_c_image (v: c_image; filename: string);
PROCEDURE write_g_image (v: g_image; filename: string);
PROCEDURE write_b_image (v: b_image; filename: string);

Open a new window and display image data

PROCEDURE show_c_image (v: c_image);
PROCEDURE show_g_image (v: g_image);
PROCEDURE show_b_image (v: b_image);


[ Previous Page | Table of Contents | Next Page ]