home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / xloadimg.zip / xloadimage.4.1 / fbm.h < prev    next >
Text File  |  1993-10-21  |  2KB  |  47 lines

  1. /*****************************************************************
  2.  * fbm.h: FBM Library 0.9 (Beta Test)  07-Mar-89  Michael Mauldin
  3.  *
  4.  * Copyright (C) 1989 by Michael Mauldin.  Permission is granted to
  5.  * use this file in whole or in part provided that you do not sell it
  6.  * for profit and that this copyright notice is retained unchanged.
  7.  *
  8.  * fbm.h: Fuzzy Bitmap Definition
  9.  *
  10.  *****************************************************************/
  11.  
  12. typedef unsigned char BYTE;    /* 8 bits unsigned        */
  13.  
  14. # define FBM_MAX_TITLE        80        /* For title and credits */
  15.  
  16. # define BIG            1        /* msb first byte order */
  17. # define LITTLE            0        /* lsb first byte order */
  18.  
  19. #define FBMIN_SUCCESS       0   /* success */
  20.  
  21. #define FBMIN_ERR_BAD_SD   -1   /* bad screen descriptor */
  22. #define FBMIN_ERR_BAD_SIG  -2   /* bad signature */
  23. #define FBMIN_ERR_EOD      -3   /* unexpected end of raster data */
  24. #define FBMIN_ERR_EOF      -4   /* unexpected end of input stream */
  25. #define FBMIN_ERR_FAO      -5   /* file already open */
  26. #define FBMIN_ERR_IAO      -6   /* image already open */
  27. #define FBMIN_ERR_NFO      -7   /* no file open */
  28. #define FBMIN_ERR_NIO      -8   /* no image open */
  29.  
  30. # define FBM_MAGIC    "%bitmap"
  31.  
  32. /* FBM bitmap headers in files (null terminated 12 character ascii strings) */
  33. typedef struct fbm_filehdr_struct {
  34.     char    magic[8];        /* 2 bytes FBM_MAGIC number */
  35.     char    cols[8];        /* Width in pixels */
  36.     char    rows[8];        /* Height in pixels */
  37.     char    planes[8];        /* Depth (1 for B+W, 3 for RGB) */
  38.     char    bits[8];        /* Bits per pixel */
  39.     char    physbits[8];        /* Bits to store each pixel */
  40.     char    rowlen[12];        /* Length of a row in bytes */
  41.     char    plnlen[12];        /* Length of a plane in bytes */
  42.     char    clrlen[12];        /* Length of colormap in bytes */
  43.     char    aspect[12];        /* ratio of Y to X of one pixel */
  44.     char    title[FBM_MAX_TITLE];    /* Null terminated title */
  45.     char    credits[FBM_MAX_TITLE];    /* Null terminated credits */
  46. } FBMFILEHDR;
  47.