| 1 | 
greg | 
2.5 | 
/* RCSid $Id: rpaint.h,v 2.4 2003/06/07 00:54:58 schorsch Exp $ */ | 
| 2 | 
greg | 
1.1 | 
/* | 
| 3 | 
  | 
  | 
 *  rpaint.h - header file for image painting. | 
| 4 | 
greg | 
2.2 | 
 */ | 
| 5 | 
schorsch | 
2.4 | 
#ifndef _RAD_RPAINT_H_ | 
| 6 | 
  | 
  | 
#define _RAD_RPAINT_H_ | 
| 7 | 
  | 
  | 
#ifdef __cplusplus | 
| 8 | 
  | 
  | 
extern "C" { | 
| 9 | 
  | 
  | 
#endif | 
| 10 | 
greg | 
1.1 | 
 | 
| 11 | 
  | 
  | 
#include  "driver.h" | 
| 12 | 
  | 
  | 
 | 
| 13 | 
  | 
  | 
#include  "view.h" | 
| 14 | 
  | 
  | 
 | 
| 15 | 
  | 
  | 
typedef short  COORD;           /* an image coordinate */ | 
| 16 | 
  | 
  | 
 | 
| 17 | 
  | 
  | 
typedef struct pnode { | 
| 18 | 
  | 
  | 
        struct pnode  *kid;             /* children */ | 
| 19 | 
  | 
  | 
        COORD  x, y;                    /* position */ | 
| 20 | 
  | 
  | 
        COLOR  v;                       /* value */ | 
| 21 | 
  | 
  | 
}  PNODE;                       /* a paint node */ | 
| 22 | 
  | 
  | 
 | 
| 23 | 
  | 
  | 
                                /* child ordering */ | 
| 24 | 
  | 
  | 
#define  DL             0               /* down left */ | 
| 25 | 
  | 
  | 
#define  DR             1               /* down right */ | 
| 26 | 
  | 
  | 
#define  UL             2               /* up left */ | 
| 27 | 
  | 
  | 
#define  UR             3               /* up right */ | 
| 28 | 
  | 
  | 
 | 
| 29 | 
  | 
  | 
#define  newptree()     (PNODE *)calloc(4, sizeof(PNODE)) | 
| 30 | 
  | 
  | 
 | 
| 31 | 
  | 
  | 
typedef struct { | 
| 32 | 
  | 
  | 
        COORD  l, d, r, u;              /* left, down, right, up */ | 
| 33 | 
  | 
  | 
}  RECT;                        /* a rectangle */ | 
| 34 | 
  | 
  | 
 | 
| 35 | 
  | 
  | 
extern PNODE  ptrunk;           /* the base of the image tree */ | 
| 36 | 
  | 
  | 
 | 
| 37 | 
  | 
  | 
extern VIEW  ourview;           /* current view parameters */ | 
| 38 | 
  | 
  | 
extern VIEW  oldview;           /* previous view parameters */ | 
| 39 | 
greg | 
1.2 | 
extern int  hresolu, vresolu;   /* image resolution */ | 
| 40 | 
greg | 
1.1 | 
 | 
| 41 | 
  | 
  | 
extern int  greyscale;          /* map colors to brightness? */ | 
| 42 | 
  | 
  | 
 | 
| 43 | 
  | 
  | 
extern int  pdepth;             /* image depth in current frame */ | 
| 44 | 
  | 
  | 
extern RECT  pframe;            /* current frame rectangle */ | 
| 45 | 
  | 
  | 
 | 
| 46 | 
  | 
  | 
extern double  exposure;        /* exposure for scene */ | 
| 47 | 
  | 
  | 
 | 
| 48 | 
  | 
  | 
extern struct driver  *dev;     /* driver functions */ | 
| 49 | 
  | 
  | 
 | 
| 50 | 
greg | 
2.2 | 
                                /* defined in rview.c */ | 
| 51 | 
  | 
  | 
extern void     devopen(char *dname); | 
| 52 | 
  | 
  | 
extern void     devclose(void); | 
| 53 | 
  | 
  | 
extern void     printdevices(void); | 
| 54 | 
  | 
  | 
extern void     fillreserves(void); | 
| 55 | 
  | 
  | 
extern void     freereserves(void); | 
| 56 | 
  | 
  | 
extern void     command(char *prompt); | 
| 57 | 
  | 
  | 
extern void     rsample(void); | 
| 58 | 
  | 
  | 
extern int      refine(PNODE *p, int xmin, int ymin, | 
| 59 | 
  | 
  | 
                                int xmax, int ymax, int pd); | 
| 60 | 
  | 
  | 
                                /* defined in rv2.c */ | 
| 61 | 
  | 
  | 
extern void     getframe(char *s); | 
| 62 | 
  | 
  | 
extern void     getrepaint(char *s); | 
| 63 | 
  | 
  | 
extern void     getview(char *s); | 
| 64 | 
  | 
  | 
extern void     lastview(char *s); | 
| 65 | 
  | 
  | 
extern void     saveview(char *s); | 
| 66 | 
  | 
  | 
extern void     loadview(char *s); | 
| 67 | 
  | 
  | 
extern void     getaim(char *s); | 
| 68 | 
  | 
  | 
extern void     getmove(char *s); | 
| 69 | 
  | 
  | 
extern void     getrotate(char *s); | 
| 70 | 
  | 
  | 
extern void     getpivot(char *s); | 
| 71 | 
  | 
  | 
extern void     getexposure(char *s); | 
| 72 | 
  | 
  | 
extern int      getparam(char *str, char *dsc, int typ, void *p); | 
| 73 | 
  | 
  | 
extern void     setparam(char *s); | 
| 74 | 
  | 
  | 
extern void     traceray(char *s); | 
| 75 | 
  | 
  | 
extern void     writepict(char *s); | 
| 76 | 
  | 
  | 
                                /* defined in rv3.c */ | 
| 77 | 
  | 
  | 
extern int      getrect(char *s, RECT *r); | 
| 78 | 
  | 
  | 
extern int      getinterest(char *s, int direc, FVECT vec, double *mp); | 
| 79 | 
  | 
  | 
extern float    *greyof(COLOR col); | 
| 80 | 
  | 
  | 
extern void     paint(PNODE *p, int xmin, int ymin, int xmax, int ymax); | 
| 81 | 
  | 
  | 
extern void     newimage(void); | 
| 82 | 
  | 
  | 
extern void     redraw(void); | 
| 83 | 
  | 
  | 
extern void     repaint(int xmin, int ymin, int xmax, int ymax); | 
| 84 | 
  | 
  | 
extern void     paintrect(PNODE *p, int xmin, int ymin, | 
| 85 | 
  | 
  | 
                                int xmax, int ymax, RECT *r); | 
| 86 | 
  | 
  | 
extern PNODE    *findrect(int x, int y, PNODE *p, RECT *r, int pd); | 
| 87 | 
  | 
  | 
extern void     scalepict(PNODE *p, double sf); | 
| 88 | 
  | 
  | 
extern void     getpictcolrs(int yoff, COLR *scan, PNODE *p, | 
| 89 | 
  | 
  | 
                        int xsiz, int ysiz); | 
| 90 | 
  | 
  | 
extern void     freepkids(PNODE *p); | 
| 91 | 
  | 
  | 
extern void     newview(VIEW *vp); | 
| 92 | 
  | 
  | 
extern void     moveview(double angle, double elev, double mag, FVECT vc); | 
| 93 | 
  | 
  | 
extern void     pcopy(PNODE *p1, PNODE *p2); | 
| 94 | 
  | 
  | 
extern void     zoomview(VIEW *vp, double zf); | 
| 95 | 
  | 
  | 
 | 
| 96 | 
schorsch | 
2.4 | 
 | 
| 97 | 
  | 
  | 
#ifdef __cplusplus | 
| 98 | 
  | 
  | 
} | 
| 99 | 
greg | 
2.2 | 
#endif | 
| 100 | 
schorsch | 
2.4 | 
#endif /* _RAD_RPAINT_H_ */ | 
| 101 | 
  | 
  | 
 |