home *** CD-ROM | disk | FTP | other *** search
- /*
- colmdecl.h 10/19/88
-
- % driver functions and other things that need attending to
-
- By Ted.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
-
- 1/95/89 jmd added missing arg_ macros
- 5/09/89 ted Changed Alloc/Free terms to Open/Close.
- */
-
- /* -------------------------------------------------------------------------- */
- typedef unsigned opixval; /* pixel value (index into a colormap) */
- typedef byte olevel; /* rgb level */
-
- typedef struct {
- olevel rgb[3];
- } orgb_struct; /* red, green, blue triplet */
-
-
- typedef enum {ORED=0, OGREEN=1, OBLUE=2} orgbi;
- #ifdef LC /* for lattice compiler enum bug */
- # define orgbi int
- #endif
-
- #define ocolmap_struct(n) \
- struct {opixval firstpix; unsigned nentries; orgb_struct rgbs[n];}
-
- typedef ocolmap_struct(1) *ocolmap_type;
- /* -------------------------------------------------------------------------- */
-
- /* ocolmap.c */
- extern ocolmap_type ocolmap_Open(_arg2(opixval firstpix, unsigned nentries));
- extern void ocolmap_Close(_arg1(ocolmap_type cmap));
- extern void ocolmap_set(_arg2(ocolmap_type dcmap, ocolmap_type scmap));
- extern orgb_struct *ocolmap_entry(_arg2(ocolmap_type colmap, opixval opix));
- extern void ocolmap_setpixrgb(_arg5(ocolmap_type cmap, opixval ipix, olevel red, olevel green, olevel blue));
- extern boolean ocolmap_samecolor(_arg4(ocolmap_type scmap, opixval scolor, ocolmap_type dcmap, opixval dcolor));
- extern boolean ocolmap_getcolor(_arg4(ocolmap_type scmap, opixval scolor, ocolmap_type dcmap, opixval dcolor));
- /* -------------------------------------------------------------------------- */
-
- #define ocolmap_GetSize(nentries) \
- (sizeof(ocolmap_struct(1)) + ((nentries)-1) * sizeof(orgb_struct))
-
- #define ocolmap_pixred(cmap, ipix) (ocolmap_entry(cmap, ipix)->rgb[ORED])
- #define ocolmap_pixgreen(cmap, ipix) (ocolmap_entry(cmap, ipix)->rgb[OGREEN])
- #define ocolmap_pixblue(cmap, ipix) (ocolmap_entry(cmap, ipix)->rgb[OBLUE])
- /* -------------------------------------------------------------------------- */
-
-