Category : C Source Code
Archive   : IMAGE.ZIP
Filename : IMAGE.DOC

 
Output of file : IMAGE.DOC contained in archive : IMAGE.ZIP
WATCOM C Graphics Library Image Format
======================================

The graphics images used by the _getimage and _putimage functions
have the following format:

The first six bytes of the image are a header describing the size
of the image. This header is defined as:

struct image_header {
short numxpixels;
short numypixels;
short bp;
};

The numxpixels and numypixels define the size of the image.
The bp field is either the number of bits per pixel used to
store the image (modes 4, 6, 11, 17, 19, 256, 257, 259, 261),
or the number of bit-planes of data (modes 13, 14, 15, 16,
18, 258, 260).

The remainder of the image consists of the actual image data
stored a row at a time. Each row of data starts on a byte
boundary. The length of a row of data is given by the following
formula:

len = ( ( numxpixels * bp + 7 ) / 8 ); // modes 4, 6, 11, 17, 19
or
len = ( ( numxpixels + 7 ) / 8 ) * bp; // modes 13, 14, 15, 16, 18

In modes 4, 6, 11, 17, and 19, pixels are packed into the bytes
of the row of data. In mode 4 (2 bits per pixel) for instance,
the data in the image looks like

7 0
xxxxxxxx

³³³³³³ÀÀ 1st pixel
³³³³ÀÀ 2nd pixel
³³ÀÀ 3rd pixel
ÀÀ 4th pixel

In modes 13, 14, 15, 16, and 18, the data in each row is stored
a bit-plane at a time. Each bit-plane of each row starts on a
byte boundary. The bit-planes are stored with the highest numbered
plane first, and bit-plane 0 last. Each pixel value is made up by
taking a bit from each bit-plane.

aaaaaaaabbbbbbbbccccccccdddddddd
   
³ ³ ³ bit-plane 0
³ ³ bit-plane 1
³ bit-plane 2
bit-plane 3


  3 Responses to “Category : C Source Code
Archive   : IMAGE.ZIP
Filename : IMAGE.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/