The partial iterated function systems are stored in files, with the format as described in class (See class notes for 4/7). The first line of the file contains the number of range region columns, the number of range region rows, the size in pixels of the range regions, and the size in pixels of the domain regions. Following this there should be one line in the file for each range region. Each line should have the integer row and column position of the upper left corner of the corresponding domain, followed by values for the contrast and brightness constants for that region. Here are a couple of example compressed files that you can download and use to test your decompression program: Example 1 (the same as the example in the class notes of 4/7), Example 2, Example 3.
The decompression program should ask the user for the name of the compressed file and the number of iterations to perform (usually the image settles down by 10 iterations or so). Read the file, decompress the image, and save the image in a bitmap file.
The compression program should ask the user for the name of the bitmap file and create and save a PIFS file to represent it in compressed form.
If you need more of a challange:
write
and read
functions in ofstream
and ifstream
. This makes your files significantly shorter.