home *** CD-ROM | disk | FTP | other *** search
- typedef unsigned char uBYTE;
- typedef unsigned long dim;
-
- #define BaseW ((dim)768)
- #define BaseH ((dim)512)
-
- #define SECSIZE 0x800
-
-
-
- #define SeHead 2
- #define L_Head (1+SeHead)
-
- #define SeBase16 18
- #define L_Base16 (1+SeBase16)
-
- #define SeBase4 72
- #define L_Base4 (1+SeBase4)
-
- #define SeBase 288
- #define L_Base (1+SeBase)
-
-
-
-
-
-
- enum ERRORS { E_NONE,E_READ,E_WRITE,E_INTERN,E_ARG,E_OPT,E_MEM,E_HUFF,
- E_SEQ,E_SEQ1,E_SEQ2,E_SEQ3,E_SEQ4,E_SEQ5,E_SEQ6,E_SEQ7,E_POS,E_IMP, E_TCANT };
-
- enum TURNS { T_NONE,T_RIGHT,T_LEFT };
-
- enum SIZES { S_UNSPEC,S_Base16,S_Base4,S_Base,S_4Base,S_16Base,S_Over };
-
- /* Default taken when no size parameter given */
- #define S_DEFAULT S_Base16
-
- struct _implane
- {dim mwidth,mheight,
- iwidth,iheight;
- uBYTE *im;
- };
- typedef struct _implane implane;
-
-
- enum ERRORS readplain();
- void planealloc();
- void interpolate();
- void readhqt();
- void decode();
-
- /* copied from hpcdtoppm.h (0.4) */
- enum CORR { C_UNSPEC,C_LINEAR,C_DARK,C_BRIGHT,C_NeXT };
- /* color.c - copied from version 0.4 */
- extern void colconvert();
- /* main_var04.c - this allows pCD.app to plug in color.c */
- extern void init_hpcd_04();
- extern void mainSetGammaCorr(); /* type CORR */
- extern void mainSetSharpit(); /* type BOOL */
-
-
- static uBYTE sbuffer[SECSIZE];
-
- static FILE *fin=0;
- #define SEEK(x) { if (fseek(fin,((x) * SECSIZE),0)) error(E_READ);}
-
- #define EREADBUF {if(READBUF < 1) error(E_READ);}
-
- #define SKIP(n) { if (fseek(fin,(n),1)) error(E_READ);}
- #define SKIPr(n) { if (fseek(fin,(n),1)) return(E_READ);}
-
- #define READBUF fread(sbuffer,sizeof(sbuffer),1,fin)
- /* Alternate version of READBUF for some NeXT processing: */
- #define READBUF_NeXT fread(sbuffer,sizeof(sbuffer),1,NeXT_fin)
-
- #define xTRIF(x,u,o,a,b,c) ((x)<(u)? (a) : ( (x)>(o)?(c):(b) ))
- #define xNORM(x) x=TRIF(x,0,255,0,x,255)
- #define NORM(x) { if(x<0) x=0; else if (x>255) x=255;}
-
- #define melde(x)
-
- /* format of some of the records on a photo CD */
- /* ph0 = header overview (from Hugo Burm) */
- struct ph0
- {
- char id0[8];
- uBYTE www1[2];
- short num_thumbs;
- uBYTE www2[(SECSIZE-12)];
- };
-
- /* ph1 = not completely sure of the format of this yet */
- struct ph1
- {char id1[8];
- char ww1[14];
- char id2[20];
- char id3[4*16+4];
- short ww2;
- char id4[20];
- char ww3[2*16+1];
- char id5[4*16];
- char idx[11*16];
- } ;
-
-