Back to index

radiance  4R0+20100331
rpaint.h
Go to the documentation of this file.
00001 /* RCSid $Id: rpaint.h,v 2.9 2008/09/05 19:45:41 greg Exp $ */
00002 /*
00003  *  rpaint.h - header file for image painting.
00004  */
00005 #ifndef _RAD_RPAINT_H_
00006 #define _RAD_RPAINT_H_
00007 
00008 #include  "driver.h"
00009 #include  "view.h"
00010 
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014 
00015 typedef short  COORD;              /* an image coordinate */
00016 
00017 typedef struct pnode {
00018        struct pnode  *kid;         /* children */
00019        COORD  x, y;                /* position */
00020        COORD  xmin, ymin, xmax, ymax;     /* rectangle */
00021        COLOR  v;                   /* value */
00022 }  PNODE;                   /* a paint node */
00023 
00024                             /* child ordering */
00025 #define  DL          0             /* down left */
00026 #define  DR          1             /* down right */
00027 #define  UL          2             /* up left */
00028 #define  UR          3             /* up right */
00029 
00030 #define  newptree()  (PNODE *)calloc(4, sizeof(PNODE))
00031 
00032 typedef struct {
00033        COORD  l, d, r, u;          /* left, down, right, up */
00034 }  RECT;                    /* a rectangle */
00035 
00036 extern PNODE  ptrunk;              /* the base of the image tree */
00037 
00038 extern VIEW  ourview;              /* current view parameters */
00039 extern VIEW  oldview;              /* previous view parameters */
00040 extern int  hresolu, vresolu;      /* image resolution */
00041 
00042 extern int  newparam;              /* parameter setting changed */
00043 
00044 extern char  *dvcname;             /* output device name */
00045 
00046 extern char  rifname[];            /* rad input file name */
00047 
00048 extern int  psample;        /* pixel sample size */
00049 extern double  maxdiff;            /* max. sample difference */
00050 
00051 extern int  greyscale;             /* map colors to brightness? */
00052 
00053 extern int  pdepth;         /* image depth in current frame */
00054 extern RECT  pframe;        /* current frame rectangle */
00055 
00056 extern double  exposure;    /* exposure for scene */
00057 
00058 extern struct driver  *dev; /* driver functions */
00059 
00060 extern int  nproc;          /* number of processes */
00061 
00062                             /* defined in rview.c */
00063 extern void   devopen(char *dname);
00064 extern void   devclose(void);
00065 extern void   printdevices(void);
00066 extern void   command(char *prompt);
00067 extern void   rsample(void);
00068 extern int    refine(PNODE *p, int pd);
00069                             /* defined in rv2.c */
00070 extern void   getframe(char *s);
00071 extern void   getrepaint(char *s);
00072 extern void   getview(char *s);
00073 extern void   lastview(char *s);
00074 extern void   saveview(char *s);
00075 extern void   loadview(char *s);
00076 extern void   getfocus(char *s);
00077 extern void   getaim(char *s);
00078 extern void   getmove(char *s);
00079 extern void   getrotate(char *s);
00080 extern void   getpivot(char *s);
00081 extern void   getexposure(char *s);
00082 extern int    getparam(char *str, char *dsc, int typ, void *p);
00083 extern void   setparam(char *s);
00084 extern void   traceray(char *s);
00085 extern void   writepict(char *s);
00086                             /* defined in rv3.c */
00087 extern int    getrect(char *s, RECT *r);
00088 extern int    getinterest(char *s, int direc, FVECT vec, double *mp);
00089 extern float  *greyof(COLOR col);
00090 extern int    paint(PNODE *p);
00091 extern int    waitrays(void);
00092 extern void   newimage(char *s);
00093 extern void   redraw(void);
00094 extern void   repaint(int xmin, int ymin, int xmax, int ymax);
00095 extern void   paintrect(PNODE *p, RECT *r);
00096 extern PNODE  *findrect(int x, int y, PNODE *p, int pd);
00097 extern void   compavg(PNODE *p);
00098 extern void   scalepict(PNODE *p, double sf);
00099 extern void   getpictcolrs(int yoff, COLR *scan, PNODE *p,
00100                      int xsiz, int ysiz);
00101 extern void   freepkids(PNODE *p);
00102 extern void   newview(VIEW *vp);
00103 extern void   moveview(double angle, double elev, double mag, FVECT vc);
00104 extern void   pcopy(PNODE *p1, PNODE *p2);
00105 extern void   zoomview(VIEW *vp, double zf);
00106 
00107 
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111 #endif /* _RAD_RPAINT_H_ */
00112