home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
vis-ftp.cs.umass.edu
/
vis-ftp.cs.umass.edu.tar
/
vis-ftp.cs.umass.edu
/
pub
/
Software
/
universal_plane_file_format
/
llvs_plane.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-29
|
4KB
|
103 lines
/* -*-c-mode-*- */
/*------------------------------------------------------
* LLVS_PLANE.H - Header file for "universal" plane file I/O functions
* Robert Heller Created on Mon Jul 10 08:39:12 1989
* Last mod -
*--------------------------------------------------------
* Contents:
*--------------------------------------------------------
* (c) Copyright 1989 by The University of Massachusetts
*------------------------------------------------------*/
/* some basic types: */
typedef unsigned char llvs_ubyte; /* unsigned bytes (8-bits) */
typedef long int llvs_integer; /* long integer (32-bits (4-bytes), 2's complement) */
typedef float llvs_single_float; /* 32-bit floating point (native format) */
typedef short int llvs_half_integer; /* short integer (16-bits (2-bytes), 2's complement) */
/* primary header record: LLVS Plane files start with these 32 bytes */
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, etc.) */
#define LLVS_HIGH_BYTE_FIRST 1 /* high byte first (680x0, Spark, etc.) */
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, etc.) */
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;
/* this next record is the AList. It is text (printed rep. of a Common LISP ALIST) and
variable length */
/* next is the size record record */
typedef struct {
llvs_integer datatype_again; /* plane data type (redundant) */
llvs_integer row_dimension; /* plane row dimension */
llvs_integer col_dimension; /* plane col dimension */
} LLVS_PLANE_SIZE_HEADER;
/* The data comes next */
#define BLOCKSIZE 512 /* I/O Buffer size */
/*------- system dependent stuff ----------*/
/* VAX implies VAX/VMS and VAX/Ultrix (same hardware for both) */
#ifdef VAX
#define LLVS_NATIVE_BYTE_SEX LLVS_LOW_BYTE_FIRST
#define LLVS_NATIVE_FLOATFMT LLVS_DEC_SINGLE_FLOAT
#endif
/* SUN implies both Sun 3 (68020/68881(2)) and Sun 4 (SPARK) */
#ifdef SUN
#define LLVS_NATIVE_BYTE_SEX LLVS_HIGH_BYTE_FIRST
#define LLVS_NATIVE_FLOATFMT LLVS_IEEE_SINGLE_FLOAT
#endif
/* SEQUENT is a 80386/80387 UNIX system */
#ifdef SEQUENT
#define LLVS_NATIVE_BYTE_SEX LLVS_LOW_BYTE_FIRST
#define LLVS_NATIVE_FLOATFMT LLVS_IEEE_SINGLE_FLOAT
#endif
/* This is for documentation only - C won't be used on the Explorer */
#ifdef EXPLORER
#define LLVS_NATIVE_BYTE_SEX LLVS_LOW_BYTE_FIRST
#define LLVS_NATIVE_FLOATFMT LLVS_IEEE_SINGLE_FLOAT
#endif
/* MIPS implies other MIPS-based systems */
#ifdef MIPS
#define LLVS_NATIVE_BYTE_SEX LLVS_HIGH_BYTE_FIRST
#define LLVS_NATIVE_FLOATFMT LLVS_IEEE_SINGLE_FLOAT
#endif
#ifdef DECSTATION
#define LLVS_NATIVE_BYTE_SEX LLVS_LOW_BYTE_FIRST
#define LLVS_NATIVE_FLOATFMT LLVS_IEEE_SINGLE_FLOAT
#endif