readPgm
const func PRIMITIVE_WINDOW: readPgm (inout file: pgmFile)
-
Reads a PGM (portable graymap) image file into a pixmap.
- Parameters:
- pgmFile - File that contains a PGM image.
- Returns:
- A pixmap with the PGM image, or PRIMITIVE_WINDOW.value if the file does not contain a PGM magic number.
- Raises:
- RANGE_ERROR - The file is not in the PGM file format.
readPgm
const func PRIMITIVE_WINDOW: readPgm (in string: pgmFileName)
-
Reads a PGM file with the given pgmFileName into a pixmap.
- Parameters:
- pgmFileName - Name of the PGM file.
- Returns:
- A pixmap with the PGM image, or PRIMITIVE_WINDOW.value if the file cannot be opened or does not contain a PGM magic number.
- Raises:
- RANGE_ERROR - The file is not in the PGM file format.
str
const func string: str (in PRIMITIVE_WINDOW: pixmap, PGM)
-
Converts a pixmap into a string in PGM format.
- Parameters:
- pixmap - Pixmap to be converted.
- Returns:
- a string with data in PGM format.