Microcom 466 User Manual

Page 62

Advertising
background image

Downloadable Graphic Images

Chapter 6

466 Operators Manual

56

<rotation> <count> <image data>

Where:
<slot number> is a slot number, 1 through 255 (in ASCII). Note: The 466 uses the same TCI
for fonts and graphics. They are both accessed by using a TCI of 8. Therefore a font and a
graphic cannot have the same CGN number.

<rotation> is an 8-bit integer, 0 for an upright font and 1 for a 90-degree rotated image.

<count> is a 32-bit integer, least significant byte first. This is number of uncompressed bytes
that the image uses, not the number of bytes that will actually be transmitted. Due to
compression, the number of bytes transmitted will normally be less than this number.

<image data> is the compressed binary image. Refer to section 6.3 for a detailed description
of this data.

Compression Algorithm
The binary data that make up the image file is a run-length compressed version of the image
data described in section 6.2. Bytes with a value of 0h or FFh are followed by another byte
indicating the number of times that value is repeated.

For example, suppose the original (uncompressed) image file has a sequence of bytes like
this: (all values are in hexadecimal)
00 01 02 03 04 00 00 00 00 00 00 FF FD FF FF FF FF FF 00 FF

The encoded result would look like this:
00 00 01 02 03 04 00 05 FF 00 FD FF 04 00 00 FF 00

Here's the interpretation:
00 - the first byte is 00
00 - count of 0 - the previous 00 byte is not repeated
01 - a 01 byte
02 - a 02 byte
03 - a 03 byte
04 - a 04 byte
00 - another 00 byte in the file
05 - count of 5 - insert 5 more 00 bytes (total of 6 in sequence)
FF - a FF byte
00 - count of 0 - the previous FF byte is not repeated
FD - a FD byte
FF - another FF byte
04 - count of 4 - insert 4 more FF bytes (total of 5 in sequence)
00 - another 00 bytes
00 - count of 0 - the previous 00 byte is not repeated
FF - another FF byte
00 - count of 0 - the previous FF byte is not repeated.

The compression scheme is slightly inefficient for single occurrences of 0h or FFh, causing
these to occupy 2 bytes each. However, most image bitmaps include large areas of either
blank space (which is coded as large numbers of 0h bytes) or black space (coded as large
numbers of FFh bytes).

Advertising