Introduction

This manual describes the format used by the VISIONS group to store image data. Image data is stored as ``plane'' files, each of which holds one or more image planes. Image planes are two dimensional arrays of picture elements, know as ``pixels''. There are five types of planes: bit (one bit per pixel), unsigned byte (8 bits per pixel), short integers (16-bits, signed, per pixel), integer (32-bits, signed, per pixel), and floating (32-bit floating point). All of the pixels in a given plane are of the same type. Two data structures are used to hold information about a plane while it is in main memory: a PLANE structure (which points at the pixels themselves) and a PLANE_INFO structure which describes the plane. These structures are defined as follows:1

/*------------------------------------------------------
 *
 *  PLANE
 *    This structure describes the format of a plane passed
 *  to C. Each plane is passed to the C routine as a separate
 *  argument of type PLANE.
 *
 *-------------------------------------------------------
 */

typedef struct {
    int plane_base[1];       /* plane data starts here */
    } PLANE;

/*----------------------------------------------------------
 *
 *  PLANE_INFO
 *   Other information is available for each plane. This
 *  information is passed in an array of PLANE_INFO[MAXPLANE].
 *  The Lisp function BUILD-PLANE-INFO-VECTOR-C may be used to
 *  build the array. The background-value is passed as a C 
 *  float value if the plane is a floating point plane, C int
 *  type otherwise.
 *
 *----------------------------------------------------------
 */

/* plane info struct */
typedef struct {
    long int datatype;      /* data type */
#define LLVS_BIT   0        /* bit type */
#define LLVS_BYTE  1        /* unsigned byte type */
#define LLVS_SHORT 2        /* signed 16 bit type */
#define LLVS_INT   3        /* integer type */
#define LLVS_FLOAT 4        /* float type */
#define FLOAT 4             /* float type */
    long int level;         /* plane level */
    long int row_location;  /* row location */
    long int column_location; /* column location */
    long int row_dimension; /* row dimension */
    long int column_dimension; /* column dimension */
    union {
        long int fixnum;    /* background value */
        float flonum;       /* dito, but as a flonum */
    } background;
    } PLANE_INFO;

Additional information about planes are stored in a Common LISP association list2. The association list is used to store information such as the plane statisics (minimum value, maximum value, etc.) and other user-defined information.

When image planes are written to disk files, this information needs to be preserved in a form that can be read on many different systems, since the one thing all of the various machines have in common is a file system. Planes are written to disk files as four logical records: a plane file header record, an association list record, a plane size record, and a plane data record. The plane file header record is a fixed-length record containing 32 bytes. It defines the plane's type and contains information about how the plane was written (byte sex3, floating point format used), the plane's size, its location, its relative resolution, etc. The association list record contains the plane's association list as ASCII text. The plane size record defines the plane's dimensions. And finally, the plane data record contains the pixel values themselves.