home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / COLMDECL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  2.1 KB  |  57 lines

  1. /*
  2.     colmdecl.h    10/19/88
  3.  
  4.     % driver functions and other things that need attending to
  5.  
  6.     By Ted.
  7.  
  8.     OWL 1.1
  9.     Copyright (c) 1988, by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.     
  15.      1/95/89 jmd    added missing arg_ macros
  16.      5/09/89 ted    Changed Alloc/Free terms to Open/Close.
  17. */
  18.  
  19. /* -------------------------------------------------------------------------- */
  20. typedef unsigned opixval;    /* pixel value (index into a colormap) */
  21. typedef byte olevel;            /* rgb level */
  22.  
  23. typedef struct {
  24.     olevel     rgb[3];
  25. } orgb_struct;                    /* red, green, blue triplet */
  26.  
  27.  
  28. typedef enum {ORED=0, OGREEN=1, OBLUE=2} orgbi;
  29. #ifdef LC        /* for lattice compiler enum bug */
  30. #    define orgbi int
  31. #endif
  32.  
  33. #define ocolmap_struct(n)            \
  34.             struct {opixval firstpix; unsigned nentries; orgb_struct rgbs[n];}
  35.  
  36. typedef ocolmap_struct(1) *ocolmap_type;
  37. /* -------------------------------------------------------------------------- */
  38.  
  39. /* ocolmap.c */
  40. extern ocolmap_type ocolmap_Open(_arg2(opixval firstpix, unsigned nentries));
  41. extern void            ocolmap_Close(_arg1(ocolmap_type cmap));
  42. extern void            ocolmap_set(_arg2(ocolmap_type dcmap, ocolmap_type scmap));
  43. extern orgb_struct *ocolmap_entry(_arg2(ocolmap_type colmap, opixval opix));
  44. extern void            ocolmap_setpixrgb(_arg5(ocolmap_type cmap, opixval ipix, olevel red, olevel green, olevel blue));
  45. extern boolean        ocolmap_samecolor(_arg4(ocolmap_type scmap, opixval scolor, ocolmap_type dcmap, opixval dcolor));
  46. extern boolean         ocolmap_getcolor(_arg4(ocolmap_type scmap, opixval scolor, ocolmap_type dcmap, opixval dcolor));
  47. /* -------------------------------------------------------------------------- */
  48.  
  49. #define ocolmap_GetSize(nentries)                    \
  50.     (sizeof(ocolmap_struct(1)) + ((nentries)-1) * sizeof(orgb_struct))
  51.  
  52. #define ocolmap_pixred(cmap, ipix)        (ocolmap_entry(cmap, ipix)->rgb[ORED])
  53. #define ocolmap_pixgreen(cmap, ipix)    (ocolmap_entry(cmap, ipix)->rgb[OGREEN])
  54. #define ocolmap_pixblue(cmap, ipix)        (ocolmap_entry(cmap, ipix)->rgb[OBLUE])
  55. /* -------------------------------------------------------------------------- */
  56.  
  57.