| 1 |
< |
/* RCSid: $Id$ */ |
| 1 |
> |
/* RCSid $Id$ */ |
| 2 |
|
/* |
| 3 |
|
* rpaint.h - header file for image painting. |
| 4 |
|
*/ |
| 5 |
+ |
#ifndef _RAD_RPAINT_H_ |
| 6 |
+ |
#define _RAD_RPAINT_H_ |
| 7 |
|
|
| 6 |
– |
/* ==================================================================== |
| 7 |
– |
* The Radiance Software License, Version 1.0 |
| 8 |
– |
* |
| 9 |
– |
* Copyright (c) 1990 - 2002 The Regents of the University of California, |
| 10 |
– |
* through Lawrence Berkeley National Laboratory. All rights reserved. |
| 11 |
– |
* |
| 12 |
– |
* Redistribution and use in source and binary forms, with or without |
| 13 |
– |
* modification, are permitted provided that the following conditions |
| 14 |
– |
* are met: |
| 15 |
– |
* |
| 16 |
– |
* 1. Redistributions of source code must retain the above copyright |
| 17 |
– |
* notice, this list of conditions and the following disclaimer. |
| 18 |
– |
* |
| 19 |
– |
* 2. Redistributions in binary form must reproduce the above copyright |
| 20 |
– |
* notice, this list of conditions and the following disclaimer in |
| 21 |
– |
* the documentation and/or other materials provided with the |
| 22 |
– |
* distribution. |
| 23 |
– |
* |
| 24 |
– |
* 3. The end-user documentation included with the redistribution, |
| 25 |
– |
* if any, must include the following acknowledgment: |
| 26 |
– |
* "This product includes Radiance software |
| 27 |
– |
* (http://radsite.lbl.gov/) |
| 28 |
– |
* developed by the Lawrence Berkeley National Laboratory |
| 29 |
– |
* (http://www.lbl.gov/)." |
| 30 |
– |
* Alternately, this acknowledgment may appear in the software itself, |
| 31 |
– |
* if and wherever such third-party acknowledgments normally appear. |
| 32 |
– |
* |
| 33 |
– |
* 4. The names "Radiance," "Lawrence Berkeley National Laboratory" |
| 34 |
– |
* and "The Regents of the University of California" must |
| 35 |
– |
* not be used to endorse or promote products derived from this |
| 36 |
– |
* software without prior written permission. For written |
| 37 |
– |
* permission, please contact [email protected]. |
| 38 |
– |
* |
| 39 |
– |
* 5. Products derived from this software may not be called "Radiance", |
| 40 |
– |
* nor may "Radiance" appear in their name, without prior written |
| 41 |
– |
* permission of Lawrence Berkeley National Laboratory. |
| 42 |
– |
* |
| 43 |
– |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
| 44 |
– |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 45 |
– |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 46 |
– |
* DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR |
| 47 |
– |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 48 |
– |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 49 |
– |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
| 50 |
– |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 51 |
– |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 52 |
– |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 53 |
– |
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 54 |
– |
* SUCH DAMAGE. |
| 55 |
– |
* ==================================================================== |
| 56 |
– |
* |
| 57 |
– |
* This software consists of voluntary contributions made by many |
| 58 |
– |
* individuals on behalf of Lawrence Berkeley National Laboratory. For more |
| 59 |
– |
* information on Lawrence Berkeley National Laboratory, please see |
| 60 |
– |
* <http://www.lbl.gov/>. |
| 61 |
– |
*/ |
| 62 |
– |
|
| 8 |
|
#include "driver.h" |
| 64 |
– |
|
| 9 |
|
#include "view.h" |
| 10 |
|
|
| 11 |
+ |
#ifdef __cplusplus |
| 12 |
+ |
extern "C" { |
| 13 |
+ |
#endif |
| 14 |
+ |
|
| 15 |
+ |
#ifdef _WIN32 /* stupid Windows name collisions */ |
| 16 |
+ |
#undef COORD |
| 17 |
+ |
#define COORD radCOORD |
| 18 |
+ |
#undef RECT |
| 19 |
+ |
#define RECT radRECT |
| 20 |
+ |
#endif |
| 21 |
+ |
|
| 22 |
|
typedef short COORD; /* an image coordinate */ |
| 23 |
|
|
| 24 |
|
typedef struct pnode { |
| 25 |
|
struct pnode *kid; /* children */ |
| 26 |
|
COORD x, y; /* position */ |
| 27 |
+ |
COORD xmin, ymin, xmax, ymax; /* rectangle */ |
| 28 |
|
COLOR v; /* value */ |
| 29 |
|
} PNODE; /* a paint node */ |
| 30 |
|
|
| 46 |
|
extern VIEW oldview; /* previous view parameters */ |
| 47 |
|
extern int hresolu, vresolu; /* image resolution */ |
| 48 |
|
|
| 49 |
+ |
extern int newparam; /* parameter setting changed */ |
| 50 |
+ |
|
| 51 |
+ |
extern char *dvcname; /* output device name */ |
| 52 |
+ |
|
| 53 |
+ |
extern char rifname[]; /* rad input file name */ |
| 54 |
+ |
|
| 55 |
+ |
extern int psample; /* pixel sample size */ |
| 56 |
+ |
extern double maxdiff; /* max. sample difference */ |
| 57 |
+ |
|
| 58 |
|
extern int greyscale; /* map colors to brightness? */ |
| 59 |
|
|
| 60 |
|
extern int pdepth; /* image depth in current frame */ |
| 64 |
|
|
| 65 |
|
extern struct driver *dev; /* driver functions */ |
| 66 |
|
|
| 67 |
< |
#ifdef NOPROTO |
| 67 |
> |
extern int nproc; /* number of processes */ |
| 68 |
|
|
| 104 |
– |
extern void devopen(); |
| 105 |
– |
extern void devclose(); |
| 106 |
– |
extern void printdevices(); |
| 107 |
– |
extern void fillreserves(); |
| 108 |
– |
extern void freereserves(); |
| 109 |
– |
extern void command(); |
| 110 |
– |
extern void rsample(); |
| 111 |
– |
extern int refine(); |
| 112 |
– |
extern void getframe(); |
| 113 |
– |
extern void getrepaint(); |
| 114 |
– |
extern void getview(); |
| 115 |
– |
extern void lastview(); |
| 116 |
– |
extern void saveview(); |
| 117 |
– |
extern void loadview(); |
| 118 |
– |
extern void getaim(); |
| 119 |
– |
extern void getmove(); |
| 120 |
– |
extern void getrotate(); |
| 121 |
– |
extern void getpivot(); |
| 122 |
– |
extern void getexposure(); |
| 123 |
– |
extern int getparam(); |
| 124 |
– |
extern void setparam(); |
| 125 |
– |
extern void traceray(); |
| 126 |
– |
extern void writepict(); |
| 127 |
– |
extern int getrect(); |
| 128 |
– |
extern int getinterest(); |
| 129 |
– |
extern float *greyof(); |
| 130 |
– |
extern void paint(); |
| 131 |
– |
extern void newimage(); |
| 132 |
– |
extern void redraw(); |
| 133 |
– |
extern void repaint(); |
| 134 |
– |
extern void paintrec(); |
| 135 |
– |
extern PNODE *findrect(); |
| 136 |
– |
extern void scalepict(); |
| 137 |
– |
extern void getpictcolrs(); |
| 138 |
– |
extern void freepkids(); |
| 139 |
– |
extern void newview(); |
| 140 |
– |
extern void moveview(); |
| 141 |
– |
extern void pcopy(); |
| 142 |
– |
extern void zoomview(); |
| 143 |
– |
|
| 144 |
– |
#else |
| 69 |
|
/* defined in rview.c */ |
| 70 |
|
extern void devopen(char *dname); |
| 71 |
|
extern void devclose(void); |
| 72 |
|
extern void printdevices(void); |
| 149 |
– |
extern void fillreserves(void); |
| 150 |
– |
extern void freereserves(void); |
| 73 |
|
extern void command(char *prompt); |
| 74 |
|
extern void rsample(void); |
| 75 |
< |
extern int refine(PNODE *p, int xmin, int ymin, |
| 154 |
< |
int xmax, int ymax, int pd); |
| 75 |
> |
extern int refine(PNODE *p, int pd); |
| 76 |
|
/* defined in rv2.c */ |
| 77 |
|
extern void getframe(char *s); |
| 78 |
|
extern void getrepaint(char *s); |
| 80 |
|
extern void lastview(char *s); |
| 81 |
|
extern void saveview(char *s); |
| 82 |
|
extern void loadview(char *s); |
| 83 |
+ |
extern void getfocus(char *s); |
| 84 |
|
extern void getaim(char *s); |
| 85 |
|
extern void getmove(char *s); |
| 86 |
|
extern void getrotate(char *s); |
| 87 |
|
extern void getpivot(char *s); |
| 88 |
+ |
extern void getorigin(char *s); |
| 89 |
|
extern void getexposure(char *s); |
| 90 |
|
extern int getparam(char *str, char *dsc, int typ, void *p); |
| 91 |
|
extern void setparam(char *s); |
| 95 |
|
extern int getrect(char *s, RECT *r); |
| 96 |
|
extern int getinterest(char *s, int direc, FVECT vec, double *mp); |
| 97 |
|
extern float *greyof(COLOR col); |
| 98 |
< |
extern void paint(PNODE *p, int xmin, int ymin, int xmax, int ymax); |
| 99 |
< |
extern void newimage(void); |
| 98 |
> |
extern int paint(PNODE *p); |
| 99 |
> |
extern int waitrays(void); |
| 100 |
> |
extern void newimage(char *s); |
| 101 |
|
extern void redraw(void); |
| 102 |
|
extern void repaint(int xmin, int ymin, int xmax, int ymax); |
| 103 |
< |
extern void paintrect(PNODE *p, int xmin, int ymin, |
| 104 |
< |
int xmax, int ymax, RECT *r); |
| 105 |
< |
extern PNODE *findrect(int x, int y, PNODE *p, RECT *r, int pd); |
| 103 |
> |
extern void paintrect(PNODE *p, RECT *r); |
| 104 |
> |
extern PNODE *findrect(int x, int y, PNODE *p, int pd); |
| 105 |
> |
extern void compavg(PNODE *p); |
| 106 |
|
extern void scalepict(PNODE *p, double sf); |
| 107 |
|
extern void getpictcolrs(int yoff, COLR *scan, PNODE *p, |
| 108 |
|
int xsiz, int ysiz); |
| 112 |
|
extern void pcopy(PNODE *p1, PNODE *p2); |
| 113 |
|
extern void zoomview(VIEW *vp, double zf); |
| 114 |
|
|
| 115 |
+ |
|
| 116 |
+ |
#ifdef __cplusplus |
| 117 |
+ |
} |
| 118 |
|
#endif |
| 119 |
+ |
#endif /* _RAD_RPAINT_H_ */ |
| 120 |
+ |
|