Calamus Raster Graphic file format: Difference between revisions
Jump to navigation
Jump to search
>Lp m (moved Calamus Raster Graphic to Calamus Raster Graphic file fomat: For consistency) |
>Lp m (updated info) |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 24: | Line 24: | ||
To decompress: Code byte (N) Instructions | To decompress: Code byte (N) Instructions | ||
N <= 127 Emit the next N+1 bytes literally. | N <= 127 Emit the next N+1 bytes literally. | ||
N >= 128 Emit the next byte N | N >= 128 Emit the next byte N-127 times. | ||
After decompression, pixels are in left-to-right, top-to-bottom order. The format is | After decompression, pixels are in left-to-right, top-to-bottom order. The format is | ||
8 pixels per byte, most significant bit first, white is 0. Rows are padded to the next | 8 pixels per byte, most significant bit first, white is 0. Rows are padded to the next | ||
byte boundary. | byte boundary. | ||
Additional information: | |||
After the compressed data is 2 extra bytes. The purpose of these extra bytes is | |||
unknown. They can be safely ignored. Values encountered: | |||
$FFFF | |||
$0D0A (EC-Paint always writes this value) | |||
</pre> | </pre> | ||
Back to [[ST Picture Formats]] | Back to [[ST Picture Formats]] | ||
Latest revision as of 21:57, 30 January 2017
Calamus Raster Graphic *.CRG
10 bytes file id [”CALAMUSCRG”]
1 word version? [$03E8]
1 word version? [$0002]
1 long file size, minus 24
1 word code for the page size? [$0080]
1 long image width in pixels
1 long image height in pixels
1 long unknown [varies]
1 byte unknown [$01]
1 byte unknown [$00]
1 long unknown [$FFFFFFFF]
1 long size of compressed image data in bytes
--------
42 bytes total for header
?? monochrome image adata
RLE compression scheme: The compressed data consists of a code byte, followed by one or
more data bytes, followed by another code byte, and so on.
To decompress: Code byte (N) Instructions
N <= 127 Emit the next N+1 bytes literally.
N >= 128 Emit the next byte N-127 times.
After decompression, pixels are in left-to-right, top-to-bottom order. The format is
8 pixels per byte, most significant bit first, white is 0. Rows are padded to the next
byte boundary.
Additional information:
After the compressed data is 2 extra bytes. The purpose of these extra bytes is
unknown. They can be safely ignored. Values encountered:
$FFFF
$0D0A (EC-Paint always writes this value)
Back to ST Picture Formats