Back to index

radiance  4R0+20100331
rhdisp.h
Go to the documentation of this file.
00001 /* RCSid: $Id: rhdisp.h,v 3.16 2004/01/01 11:21:55 schorsch Exp $ */
00002 /*
00003  * Header for holodeck display drivers.
00004  */
00005 #ifndef _RAD_RHDISP_H_
00006 #define _RAD_RHDISP_H_
00007 
00008 #include "color.h"
00009 
00010 #ifdef __cplusplus
00011 extern "C" {
00012 #endif
00013 
00014                             /* display requests */
00015 #define DR_NOOP             0             /* to release from vain DR_ATTEN */
00016 #define DR_BUNDLE    1             /* lone bundle request */
00017 #define DR_ATTEN     2             /* request for attention */
00018 #define DR_SHUTDOWN  3             /* shutdown request */
00019 #define DR_NEWSET    4             /* new bundle set */
00020 #define DR_ADDSET    5             /* add to current set */
00021 #define DR_ADJSET    6             /* adjust set quantities */
00022 #define DR_DELSET    7             /* delete from current set */
00023 #define DR_KILL             8             /* kill rtrace process(es) */
00024 #define DR_RESTART   9             /* restart rtrace */
00025 #define DR_CLOBBER   10            /* clobber holodeck */
00026 #define DR_VIEWPOINT 11            /* set desired eye position */
00027 
00028                             /* server responses */
00029 #define DS_BUNDLE    32            /* computed bundle */
00030 #define DS_ACKNOW    33            /* acknowledge request for attention */
00031 #define DS_SHUTDOWN  34            /* end process and close connection */
00032 #define DS_ADDHOLO   35            /* register new holodeck */
00033 #define DS_STARTIMM  36            /* begin immediate bundle set */
00034 #define DS_ENDIMM    37            /* end immediate bundle set */
00035 #define DS_OUTSECT   38            /* render from outside sections */
00036 #define DS_EYESEP    39            /* eye separation distance */
00037 
00038 /*
00039  * Normally, the server channel has priority, with the display process
00040  * checking it frequently for new data.  However, when the display process
00041  * makes a request for attention (DR_ATTEN), the server will finish its
00042  * current operations and flush its buffers, sending an acknowledge
00043  * message (DS_ACKNOW) when it's done.  This then allows the
00044  * display process to send a long request to the holodeck server.
00045  * Priority returns to normal after the following request.
00046  */
00047 
00048 #ifndef BIGREQSIZ
00049 #define BIGREQSIZ    512           /* big request size (bytes) */
00050 #endif
00051 
00052 typedef struct {
00053        int16  type;         /* message type */
00054        int32  nbytes;              /* number of additional bytes */
00055 } MSGHEAD;           /* message head */
00056 
00057 /*
00058  * The display process is started with three arguments.  The first argument
00059  * is the short name of the holodeck file, appropriate for window naming, etc.
00060  * The second and third arguments are the file descriptor numbers assigned to
00061  * the server's standard output and input, respectively.  The stdin and stdout
00062  * of the display process are used for normal communication with the server,
00063  * and are connected to pipes going each way.  It is entirely appropriate
00064  * for the display process to borrow the server's stdin and stdout for reading
00065  * and writing user commands from the list in rhdriver.h.  If standard input
00066  * is not available for reading, then a descriptor of -1 will be passed.
00067  * The standard output will always be available for writing, though it
00068  * may go to /dev/null.
00069  */
00070 
00071 
00072        /* rhdisp.c */
00073 extern void serv_request(int type, int nbytes, char *p);
00074 extern int serv_result(void);
00075        /* rhdisp2.c */
00076 extern int beam_sync(int all);
00077 extern void beam_init(int fresh);
00078 //extern int16 * beam_view(VIEW *vn, int hr, int vr);
00079        /* rhdisp2.c, rhdisp3.c */
00080 extern void gridlines(void (*f)(FVECT wp[2]));
00081        /* rhd_ctab.c */
00082 extern int new_ctab(int ncolors);
00083 extern int get_pixel(BYTE rgb[3], void (*set_pixel)(int h, int r, int g, int b));
00084 
00085 
00086 #ifdef __cplusplus
00087 }
00088 #endif
00089 #endif /* _RAD_RHDISP_H_ */
00090