home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
INCLUDE
/
COLMDECL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-04-23
|
2KB
|
56 lines
/*
colmdecl.h 10/19/88
% driver functions and other things that need attending to
By Ted.
OWL 1.2
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.
3/28/90 jmd ansi-fied
*/
/* -------------------------------------------------------------------------- */
typedef unsigned opixval; /* pixel value (index into a colormap) */
typedef byte olevel; /* rgb level */
typedef struct _orgb {
olevel rgb[3];
} orgb_struct; /* red, green, blue triplet */
typedef enum _orgbi {ORED=0, OGREEN=1, OBLUE=2} orgbi;
#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(opixval firstpix, unsigned nentries);
extern void ocolmap_Close(ocolmap_type cmap);
extern void ocolmap_set(ocolmap_type dcmap, ocolmap_type scmap);
extern orgb_struct *ocolmap_entry(ocolmap_type colmap, opixval opix);
extern void ocolmap_setpixrgb(ocolmap_type cmap, opixval ipix, olevel red, olevel green, olevel blue);
extern boolean ocolmap_samecolor(ocolmap_type scmap, opixval scolor, ocolmap_type dcmap, opixval dcolor);
extern boolean ocolmap_getcolor(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])
/* -------------------------------------------------------------------------- */