Reading and writing binary images

READRAW(filename, rows, cols, bits, endian, skip) Returns the contents of a raw binary image file as a matrix. The binary file is interpreted to contain a rows by cols matrix of bits (8 or 16) per pixel packed integers, in "Little" or "Big" endian format, with skip bytes skipped in the header at the beginning of the file.

WRITERAW(filename, bits, endian) := M or
Dummy := WRITERAW(filename, bits, endian, M) Writes matrix M to raw binary integer image file filename, using either 8 or 16 bits per pixel, in "Little" or "Big" endian storage order. This function can be used either on the right or the left side of the definition operator. When used on the right, you must supply the argument M, the name of the matrix to write to the file. In this case, the function returns 0. When used on the left, do not supply the argument M, but instead place it on the right hand side of the definition.

Arguments: