00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __FBIO_H__
00034 #define __FBIO_H__
00035
00036 #ifdef USE_PROTOTYPES
00037 # define FB_ARGS(args) args
00038 #else
00039 # define FB_ARGS(args) ()
00040 #endif
00041
00042 #ifndef FB_EXPORT
00043 # if defined(_WIN32) && !defined(__CYGWIN__) && defined(BRLCAD_DLL)
00044 # ifdef FB_EXPORT_DLL
00045 # define FB_EXPORT __declspec(dllexport)
00046 # else
00047 # define FB_EXPORT __declspec(dllimport)
00048 # endif
00049 # else
00050 # define FB_EXPORT
00051 # endif
00052 #endif
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 typedef unsigned char RGBpixel[3];
00067
00068 #define RED 0
00069 #define GRN 1
00070 #define BLU 2
00071
00072
00073
00074
00075
00076
00077
00078
00079 typedef struct {
00080 unsigned short cm_red[256];
00081 unsigned short cm_green[256];
00082 unsigned short cm_blue[256];
00083 } ColorMap;
00084
00085
00086 #define PIXEL_NULL (unsigned char *) 0
00087 #define RGBPIXEL_NULL (unsigned char *) 0
00088 #define COLORMAP_NULL (ColorMap *) 0
00089 #define FBIO_NULL (FBIO *) 0
00090
00091 #define FB_MAGIC 0xfbfb00fb
00092 #define FB_CK_FBIO(_p) FB_CKMAG(_p, FB_MAGIC, "FBIO" )
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 typedef struct FBIO_ {
00105 long if_magic;
00106
00107 int (*if_open)FB_ARGS((struct FBIO_ *ifp, char *file, int width, int height));
00108 int (*if_close)FB_ARGS((struct FBIO_ *ifp));
00109 int (*if_clear)FB_ARGS((struct FBIO_ *ifp, unsigned char *pp));
00110 int (*if_read)FB_ARGS((struct FBIO_ *ifp, int x, int y, unsigned char *pp, int count));
00111 int (*if_write)FB_ARGS((struct FBIO_ *ifp, int x, int y, const unsigned char *pp, int count));
00112 int (*if_rmap)FB_ARGS((struct FBIO_ *ifp, ColorMap *cmap));
00113 int (*if_wmap)FB_ARGS((struct FBIO_ *ifp, const ColorMap *cmap));
00114 int (*if_view)FB_ARGS((struct FBIO_ *ifp, int xcent, int ycent, int xzoom, int yzoom));
00115 int (*if_getview)FB_ARGS((struct FBIO_ *ifp, int *xcent, int *ycent, int *xzoom, int *yzoom));
00116 int (*if_setcursor)FB_ARGS((struct FBIO_ *ifp, const unsigned char *bits, int xb, int yb, int xo, int yo));
00117 int (*if_cursor)FB_ARGS((struct FBIO_ *ifp, int mode, int x, int y));
00118 int (*if_getcursor)FB_ARGS((struct FBIO_ *ifp, int *mode, int *x, int *y));
00119 int (*if_readrect)FB_ARGS((struct FBIO_ *ifp, int xmin, int ymin, int width, int height, unsigned char *pp));
00120 int (*if_writerect)FB_ARGS((struct FBIO_ *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp));
00121 int (*if_bwreadrect)FB_ARGS((struct FBIO_ *ifp, int xmin, int ymin, int width, int height, unsigned char *pp));
00122 int (*if_bwwriterect)FB_ARGS((struct FBIO_ *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp));
00123 int (*if_poll)FB_ARGS((struct FBIO_ *ifp));
00124 int (*if_flush)FB_ARGS((struct FBIO_ *ifp));
00125 int (*if_free)FB_ARGS((struct FBIO_ *ifp));
00126 int (*if_help)FB_ARGS((struct FBIO_ *ifp));
00127 char *if_type;
00128 int if_max_width;
00129 int if_max_height;
00130
00131 char *if_name;
00132 int if_width;
00133 int if_height;
00134 int if_selfd;
00135
00136 int if_fd;
00137 int if_xzoom;
00138 int if_yzoom;
00139 int if_xcenter;
00140 int if_ycenter;
00141 int if_cursmode;
00142 int if_xcurs;
00143 int if_ycurs;
00144 unsigned char *if_pbase;
00145 unsigned char *if_pcurp;
00146 unsigned char *if_pendp;
00147 int if_pno;
00148 int if_pdirty;
00149 long if_pixcur;
00150 long if_ppixels;
00151 int if_debug;
00152
00153 union {
00154 char *p;
00155 long l;
00156 } u1, u2, u3, u4, u5, u6;
00157 } FBIO;
00158
00159
00160 #ifdef IF_REMOTE
00161 FB_EXPORT extern FBIO remote_interface;
00162 #endif
00163
00164 #ifdef IF_ADAGE
00165 FB_EXPORT extern FBIO adage_interface;
00166 #endif
00167
00168 #ifdef IF_SUN
00169 FB_EXPORT extern FBIO sun_interface;
00170 #endif
00171
00172 #if defined(IF_SGI)
00173 FB_EXPORT extern FBIO sgi_interface;
00174 #endif
00175
00176 #ifdef IF_OGL
00177 FB_EXPORT extern FBIO ogl_interface;
00178 #endif
00179
00180 #ifdef IF_WGL
00181 FB_EXPORT extern FBIO wgl_interface;
00182 #endif
00183
00184 #ifdef IF_RAT
00185 FB_EXPORT extern FBIO rat_interface;
00186 #endif
00187
00188 #ifdef IF_UG
00189 FB_EXPORT extern FBIO ug_interface;
00190 #endif
00191
00192 #ifdef IF_X
00193 FB_EXPORT extern FBIO X24_interface;
00194 FB_EXPORT extern FBIO X_interface;
00195 #endif
00196
00197 #ifdef IF_PTTY
00198 FB_EXPORT extern FBIO ptty_interface;
00199 #endif
00200
00201 #ifdef IF_AB
00202 FB_EXPORT extern FBIO abekas_interface;
00203 #endif
00204
00205 #ifdef IF_TS
00206 FB_EXPORT extern FBIO ts_interface;
00207 #endif
00208
00209 #ifdef IF_TK
00210 FB_EXPORT extern FBIO tk_interface;
00211 #endif
00212
00213
00214
00215 FB_EXPORT extern FBIO debug_interface, disk_interface, stk_interface;
00216 FB_EXPORT extern FBIO memory_interface, null_interface;
00217
00218 #endif
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229