[comp.sys.apollo] GPR Bitmap File format

ferguson@BKNLVMS.BITNET (12/10/87)

We're trying to load Amiga IFF color bitmaps and convert them into
Apollo GPR color bitmaps for display on our Apollos. Does anyone
know the exact file format of GPR bitmaps or of GMF bitmap files,
or where to find these specifications? Thanks very much,

Scott Ferguson
Bucknell University
ferguson@bknlvms.bitnet

oj@apollo.uucp (Ellis Oliver Jones) (12/19/87)

In article <8712091529.AA02789@ELI.CS.YALE.EDU> ferguson@BKNLVMS.BITNET writes:
>Does anyone know the exact file format of [color] GPR bitmaps...?

The exact internal format is (obviously) around here someplace,
but it's not very pleasant to work with.  Have you tried gpr_$open_bitmap_file ?
It allows you to specify the parameters of a bitmap file, then create it.
You get back (indirectly) a bunch of good stuff such as the location
of the storage, the number of bytes per line, etc. Once you have the
storage_offset and the bytes_per_line, you can scribble away into the
bitmap.   If you init GPR in no_display mode, you can write a bitmap
file without even disturbing your screen.

This works for multibit pixels at SR9.7 (and beyond...)  
Enjoy. /oj

Here are some of the relevant items from /sys/ins/gpr.ins.pas

            { external bitmap group header descriptor }
        gpr_$bmf_group_header_t =
            RECORD
            n_sects         : integer16;   <- you set this to 1
            pixel_size      : integer16;   <- you set this 1-32 (to 8 for pseudocolor)
            allocated_size  : integer16;   <- you set this to zero, it comes back w ACTUAL bits/pixel
            bytes_per_line  : integer16;   <- you set this to zero...GPR sets it for you )
            bytes_per_sect  : integer32;   <- ditto
            storage_offset  : univ_ptr;    <- ditto
            END;

            { array of external bitmap group header descriptors }
        gpr_$bmf_group_header_array_t =
            ARRAY [0..gpr_$max_bmf_group] OF gpr_$bmf_group_header_t;

...
{ GPR_$OPEN_BITMAP_FILE obtains access to an external bitmap }

PROCEDURE gpr_$open_bitmap_file (
              IN     access     : gpr_$access_mode_t;
              IN     filename   : UNIV name_$pname_t;   { pathname of bitmap file }
              IN     namesize   : integer;              { length of file name }
              IN OUT version    : gpr_$version_t;
              IN OUT size       : gpr_$offset_t;        { x,y size of bitmap }
              IN OUT groups     : integer;
              IN OUT g_headers  : gpr_$bmf_group_header_array_t;
              IN     attribs    : gpr_$attribute_desc_t;{ attributes bitmap is to have }
              OUT    bitmap     : gpr_$bitmap_desc_t;   { returned bitmap descriptor   }
              OUT    created    : boolean;              { TRUE if we created the file  }
              OUT    status     : status_$t 
          );EXTERN;