7.3.4. Reading/Writing Run-Length-Encoded Image Files
(lsh/libimage/rle.lsh)


read and write RLE images. RLE images are a compact way of representing binary images by a list of "runs" of black pixels.

7.3.4.0. (rle-read-ubim f white black)
(lsh/libimage/rle.lsh)


read binary image m from RLE file f . code black as black and white as white

7.3.4.1. (rle-read-runs f runs img-dim)
(lsh/libimage/rle.lsh)


((-str-) f):
((-idx2- (-int-)) runs):
((-obj- (img-dim-C)) img-dim):
CREATED: P. Haffner, Feb 98
MODIFIES: <runs> and <img-dim>
RETURNS: ()
DESCRIPTION:
read runs IDX <runs> from RLE file <f>.
dimension 0 of <runs> is the number of runs
dimension 1 of <runs> must be >= 3 with
0: Y position
1: X1 position
2: X2 position
populates object img-dim with both dimensions
See: img-dim-C


EXAMPLE: (setq runs-dim (new img-dim-C 0 0)) (setq runs (int-matrix 1 4)) (a 4th optional dimension for connected componanet analysis)

(rle-read-runs filename runs runs-dim)



7.3.4.2. (rle-write-runs f runs nlin ncol)
(lsh/libimage/rle.lsh)


((-str-) f):
((-idx2- (-int-)) runs):
((-int-) nlin ncol):
CREATED: P. Haffner, Oct 97
DESCRIPTION:
writes <runs> in file <f> as a RLE file.