draw7.h
0000#ifndef _DRAW7
0001#define _DRAW7
0002/**********************************
0003
0004 pixmap
0005
0006**********************************/
0007
0008/*****************************************
0009
0010 type of pixmap
0011 0 : 1-bit B&W (0=black, 1=white)
0012 1 : 4-bit grayscale
0013 2 : 8-bit grayscale
0014 3 : 16-bit color
0015 4 : 24-bit color
0016 5 : reserved (32-bit color?)
0017 6 : 2-bit indexed
0018 7 : 4-bit indexed
0019 8 : 8-bit indexed (non-standard color table)
0020 9 : 8-bit indexed (standard color table)
0021
0022 color in color table
0023 RGB 24 bit
0024
0025 a row of indices rounded to the byte boundary
0026
0027*******************************************/
0028
0029typedef struct pixmap{
0030 int size; /* total size of the struct */
0031 int type;
0032 int wid;
0033 int hei;
0034 int refx;
0035 int refy;
0036 int refz;
0037 int rowbytes;
0038 int idxlen; /* index color table in the first part of data[] */
0039 unsigned char *pixdata; /* beginning of pixel data in the second part of data[] */
0040 char data[0];
0041} PixMap;
0042
0043PixMap *pcreate(int type,int wid,int hei);
0044
0045int pdestroy(PixMap *p);
0046
0047int putpix(PixMap *p,int x,int y,int r,int g,int b);
0048
0049int putpix16(PixMap *p,int x,int y,int l);
0050
0051int putpix32(PixMap *p,int x,int y,int l);
0052
0053int putpixid(PixMap *p,int x,int y,int id);
0054
0055int getpix(PixMap *p,int x,int y,int *r,int *g,int *b);
0056
0057int getpix32(PixMap *p,int x,int y);
0058
0059int getpixid(PixMap *p,int x,int y);
0060
0061int StdColor1(int r1,int g1,int b1);
0062
0063int cnvtype(PixMap *s,PixMap *d,int pref);
0064
0065#endif
0066