The Plane File Header

This structure is defined in the file llvs_plane.h.

/* some basic types: */

typedef unsigned char llvs_ubyte;    /* unsigned bytes
                                       (8-bits) */
typedef long int llvs_integer;       /* long integer
                                        (32-bits) */
typedef float llvs_single_float;     /* 32-bit floating
                                        point */
typedef short int llvs_half_integer; /* short integer
                                        (16-bits) */

/* primary header record: LLVS Plane files start with this */

typedef struct {
    llvs_ubyte ptype;           /* datatype of plane */
#define LLVS_PLF_BIT   0        /* bit type */
#define LLVS_PLF_BYTE  1        /* unsigned byte type */
#define LLVS_PLF_SHORT 2        /* signed 16 bit type */
#define LLVS_PLF_INT   3        /* integer type */
#define LLVS_PLF_FLOAT 4        /* float type */
    llvs_ubyte bsex;            /* byte sex (byte order) */
#define LLVS_LOW_BYTE_FIRST 0   /* low byte first 
                                   (VAX, 80x86) */
#define LLVS_HIGH_BYTE_FIRST 1  /* high byte first
                                  (680x0, Spark) */
    llvs_ubyte floatfmt;        /* floating point format */
#define LLVS_DEC_SINGLE_FLOAT 0 /* DEC 32-bit floating point
                                   format (PDP-11, VAX) */
#define LLVS_IEEE_SINGLE_FLOAT 1 /* IEEE 32-bit floating 
                                    point format (Sun, 
                                    Sequent, Spark, TI
                                    LISPM) */
    llvs_ubyte reserved;        /* reserved byte - must be
                                   ZERO at present */
/* the remaining fields are in the format indicated above */
    llvs_integer pl_level;      /* plane level */
    llvs_integer row_location;  /* row offset of plane */
    llvs_integer col_location;  /* column offset of plane */
    union {
        llvs_integer iback;     /* integer background value
                                 */
        llvs_single_float fback; /* floating point background
                                    value */
        } background;      /* plane background value */
    llvs_integer alist_length;  /* length of alist record */
    llvs_integer data_length;   /* length of data + size 
                                   header */
    llvs_integer multi_plane_flag; /* Multi-plane flag - if 0
                                      this is the last/only
                                      plane otherwise, 
                                      additional planes are 
                                      stored after this one.
                                    */
    } LLVS_PLANE_FILE_HEADER;

The first three bytes of this header record describe the format of the plane data: its data type, its ``byte sex'' (byte ordering of multi-byte numerical values), and the floating point number format used for floating point numbers.