INDIGO GRAPHIC SYSTEMS T A B L E O F C O N T E N T S 1. COMPRESSED IMAGE FORMAT ................................... 1 1.1. Data Bytes .............................................. 2 1.2. The Control Code Byte ................................... 3 2. Example ................................................... 4 1. COMPRESSED IMAGE FORMAT The compressed image data consists of four-byte words. The MSByte contains the op-code which defines the type of data contained by the other three bytes. Data format: D31 D24 D23 D16 D15 D8 D7 D0 control byte2 byte1 byte0 Byte0 is the first byte of the word to be decompressed and plotted. Byte2 is the last one. Each compressed line begins in a new word. 1.1. Data Bytes The Data Bytes may contain 3 types of data: RASTER : The byte contains uncompressed image data. The least significant bit of a RASTER byte is the first to be plotted. RUNLENGTH : The value of the data byte represents the number of bytes in the runlength (zeroes or ones). REPEAT RASTER : The value in the data byte represents the number of times the previous data byte (which must be a RASTER byte) is to be repeated. For example : a RASTER that appears 100 times will be compressed as the RASTER byte itself followed by 99 in the next data byte. PI COMMAND : The byte contains either EOL (End Of Line) or EOI (End Of Image) command. This byte is always the last data byte in its word. bit 7 - not used bit 6 - not used bit 5 - not used bit 4 - not used bit 3 - not used bit 2 - not used bit 1 - EOL bit 0 - EOI 1.2. The Control Code Byte The Control Code Byte defines the type of data in each data byte. bit 7 - C1 bit 6 - C0 bit 5 - O/Z_REP2 bit 4 - O/Z_REP1 bit 3 - O/Z_REP0 bit 2 - RL/RAS2 bit 1 - RL/RAS1 bit 0 - RL/RAS0 C1,C0 - 00 - Data Byte 0 contains PI_COMMAND 01 - " " 1 " " 10 - " " 2 " " 11 - No data byte contains PI_COMMAND RL/RASi - 1 - Data byte i contains a runlength 0 - " " " " " raster O/Z_REPi - 0 - if RL/RASi=1 then Data byte i contains a runlength of zeroes else Data byte i is a regular RASTER 1 - if RL/RASi=1 then Data byte i contains a runlength of ones else Data byte i is a REPEAT RASTER 2. Example Lets take for example the following image raster line: 00000000 00000000 00000000 00000000 11111111 11111111 11111111 10101010 10101010 10101010 00001111 This line containes: 1. A RUNLENGTH of 4 bytes of zeroes. 2. A RUNLENGTH of 3 bytes of ones. 3. Three repetetive identical RASTER bytes. 4. One different RASTER byte. The hexadecimal compressed raster format is following: control byte2 byte1 byte0 11010011 01010101 00000011 00000100 10X01X00 00000000 11110000 00000010 MSB LSB Note that: 1. X means "DONT CARE" 2. A RASTER byte appears in the compressed raster format as "lsb first". 3. The compression ratio in this case is not very good but it becomes better when the RUNLENGTHs are longer. EDDI LITVAK .