BITMAP(5)

NAME
bitmap - bitmap header format for mgr bitmaps.

SYNOPSIS
#include "bitmap.h"

DESCRIPTION
There are two styles of bitmaps recognized by MGR, the old machine dependent format, and the new portable format.

Old bitmap files are prepended with a 6 byte ascii header of type old_b_header which contains: 1) a two byte magic number, 2) a 2 byte bitmap width, and 3) a two byte bitmap height. The bitmap data follows the header in raster scan order. There exist three kinds of bitmaps with 1 bit depth/16 bit alignment (zz), 1 bit depth/32 bit alignment (xz) and 8 bit depth/16 bit alignment (zy/xy?).

The new, portable bitmap format consists of an 8 byte ascii header of type b_header containing: 1) a two byte magic number, 2) a 2 byte bitmap width, 3) a two byte bitmap height, a single byte bitmap depth, and 1 reserved byte. The bitmap data follows the header in raster scan order, with each row padded to a 8 bit boundary (yz).

The following macros, defined in bitmap.h may be useful for dealing with bitmap headers:

B_GETOLDHDR(old_b_header,width,height)

B_GETHDR8(b_header,width,height,depth)
    extracts the width, height and depth from the header.

B_PUTOLDHDR(old_b_header,width,height)
    produces a bitmap header for a bitmap width pixel wide and height pixel high, 1 bit deep and 16 bit aligned.

B8_PUTOLDHDR(old_b_header,width,height)
    produces a bitmap header for a bitmap width pixel wide and height pixel high, 8 bit deep and 16 bit aligned.

B_PUTHDR8(b_header,width,height,depth)
    produces a bitmap header for a bitmap width pixel wide and height pixel high with a depth of depth, 8 bi aligned.

B8_ISHDR(old_b_header)

B_ISHDR16(old_b_header)

B_ISHDR32(old_b_header)

B_ISHDR8(b_header)
    returns true if the header is of the checked format.

BS_ISHDR(b_header)
    returns true for a squeezed B_ISHDR8 bitmap.

B_SIZE8(w,h,d)

B_SIZE16(w,h,d)

B_SIZE32(w,h,d)

B8_SIZE(w,h)
    returns size of bitmap data (excluding header) for bitmaps.

NOTES
The existence of two different bitmap formats is unfortunate. The old format should go away when the programs that use it are rewritten.

These bitmap formats are external bitmap formats, the internal represantation may be different.

SEE ALSO
mgr(1)