~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/tv/tv.h

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)Tv structures etc
  2   */
  3 
  4 #ifndef TV_HEADS_DEFINED
  5 #define TV_HEADS_DEFINED
  6 
  7 #include <tina/math.h>
  8 #define TV_SCREEN_REPAINT 1
  9 #define TV_SCREEN_REPAINT_IF_SMALLER 2
 10 #define TV_SCREEN_NO_REPAINT 3
 11 
 12 #define CMAPLOOKUPCOLORSBASE 256
 13 #define CMAPLOOKUPGREYSBASE 0
 14 #define CMAPLOOKUPNUMBEROFCOLORS 256
 15 #define CMAPLOOKUPNUMBEROFGREYS 256
 16 #define CMAPLOOKUPSIZE (CMAPLOOKUPNUMBEROFGREYS + CMAPLOOKUPNUMBEROFCOLORS)
 17 
 18 #ifndef __STRICT_ANSI__
 19 #define const
 20 #endif /* __STRICT_ANSI__ */
 21 
 22 typedef void *(*voidStarFn) ();
 23 typedef int Tina_pixel;
 24 typedef struct rgb
 25 {
 26     Ts_id ts_id;                /* Tina structure identifier */
 27     unsigned short red;         /* range: 0 - 256 */
 28     unsigned short green;       /* range: 0 - 256 */
 29     unsigned short blue;        /* range: 0 - 256 */
 30 }       Rgb;
 31 #define RGB_SWAP_STRING "kkk"
 32 typedef struct tina_color
 33 {
 34     Ts_id ts_id;                /* Tina structure identifier */
 35     Tina_pixel pixel;
 36     unsigned short red;         /* range: 0 - 0XFFFF */
 37     unsigned short green;       /* range: 0 - 0XFFFF */
 38     unsigned short blue;        /* range: 0 - 0XFFFF */
 39 }       Tina_color;
 40 #define TINA_COLOR_SWAP_STRING ".kkk"
 41 
 42 #define TINA_COLOR_ARRAY_CREATE(_size) ((Tina_color *) ralloc((unsigned)(_size) * sizeof (Tina_color)))
 43 #define RGB_ARRAY_CREATE(_size) ((Rgb *) ralloc((unsigned)(_size) * sizeof (Rgb)))
 44 #define TINA_PIXEL_ARRAY_CREATE(_size) ((Tina_pixel *) ralloc((unsigned)(_size) * sizeof (Tina_pixel)))
 45 
 46 typedef enum cmap_model
 47 {
 48     cmap_model_gs, cmap_model_col, cmap_model_rgb, cmap_model_unknown
 49 }       Cmap_model;
 50 
 51 typedef enum cmap_kind
 52 {
 53     cmap_type_dynamic, cmap_type_static, cmap_type_unknown
 54 }       Cmap_kind;
 55 
 56 typedef struct cmap_data_visible
 57 {
 58     Ts_id ts_id;                /* Tina structure identifier */
 59     /* Visible at tv level */
 60     Cmap_model model;           /* cmap_model_gs, cmap_model_col,
 61                                  * cmap_model_rgb */
 62     Cmap_kind type;             /* cmap_type_dynamic, cmap_type_static */
 63     int     ncells;             /* ncells of colormap */
 64     int     nplanes;            /* no of cmap planes */
 65     Tina_pixel base;            /* first used colormap entry */
 66     Tina_pixel std_lut[CMAPLOOKUPSIZE]; /* standard tina LUT */
 67     Tina_pixel overlay_mask;    /* xor mask for overlay */
 68     int     color_bits;         /* number of bits of color */
 69     int     color_lut[CMAPLOOKUPNUMBEROFGREYS]; /* col val look up */
 70 }       Cmap_data_visible;
 71 #define CMAP_DATA_VISIBLE_SWAP_STRING "iiii.0[.].i0[i]"
 72 
 73 typedef struct tv_mouse
 74 {
 75     Ts_id ts_id;                /* Tina structure identifier */
 76     char    name[32];
 77 
 78     char    left_name[32];
 79     void    (*left_down) ();
 80     void    (*left_drag) ();
 81     void    (*left_up) ();
 82 
 83     char    middle_name[32];
 84     void    (*middle_down) ();
 85     void    (*middle_drag) ();
 86     void    (*middle_up) ();
 87 
 88     char    right_name[32];
 89     void    (*right_down) ();
 90     void    (*right_drag) ();
 91     void    (*right_up) ();
 92 }       Tv_mouse;
 93 #define TV_MOUSE_SWAP_STRING "32[c]32[c]www32[c]www32[c]www"
 94 
 95 typedef struct tv_pick
 96 {
 97     Ts_id ts_id;                /* Tina structure identifier */
 98     char    name[32];
 99 
100     List   *picklist;
101     void   *(*closest) ();
102     void    (*highlight) ();
103     void    (*draw) ();
104     void    (*func) ();
105     void    (*free) ();
106     Bool    do_repaint;
107 }       Tv_pick;
108 #define TV_PICK_SWAP_STRING "32[c]pwwwwwi"
109 
110 typedef struct tv_draw
111 {
112     Ts_id ts_id;                /* Tina structure identifier */
113     /**Draw options**/
114     Bool    overlay_on;
115     int     color;
116     int     op;
117     int     linewidth;
118     int     linestyle;
119     char    font_name[STRING128];
120 }       Tv_draw;
121 #define TV_DRAW_SWAP_STRING "iiiii0[c]"
122 
123 typedef struct tv_zbuff
124 {
125     Ts_id ts_id;                /* Tina structure identifier */
126     Imrect *z;
127     double  zmin, zmax;
128     Bool    backdraw;
129     int (*color)();
130     double (*shade)();
131 }       Tv_zbuff;
132 #define TV_ZBUFF_SWAP_STRING "pggi.."
133 
134 typedef struct tv
135 {
136     Ts_id ts_id;                /* Tina structure identifier */
137     char    label[32];
138 
139     /**clone number**/
140     int     clone;
141 
142     /**current tv_screen owned by tv**/
143     void   *tv_screen;
144 
145     /**camera initialisation**/
146     void    (*init) ();
147 
148     /**display scaling**/
149     int     width;
150     int     height;
151     float   cx, cy;
152     float   scalex, scaley;
153 
154     /**3D projection**/
155     int     proj3type;
156     struct vec3 centre3;
157     float   radius3;
158     struct vec3 ex3, ey3, ez3;
159     float   pscale;
160     struct vec3 pcentre;
161     Bool    axis_set;
162     struct vec3 axis;
163     struct ipos (*proj3) ();
164     void    (*ray3) ();
165     struct vec3 (*backproj3) ();
166 
167     /**2D projection**/
168     struct vec2 centre2;
169     float   radius2;
170     struct vec2 ex2, ey2;
171     struct ipos (*proj2) ();
172     struct vec2 (*backproj2) ();
173 
174     /**Draw options**/
175     Bool    overlay_on;
176     Tina_pixel color;
177     int     op;
178     int     linewidth;
179     int     linestyle;
180     char    font_name[STRING128];
181 
182     /**draw option stack**/
183     List   *draw;
184 
185     /**mouse activity**/
186     int     activity;
187 
188     /**zoom functionality**/
189     int     zoomlevel;
190 
191     /**mouse functions**/
192     struct tv_mouse mouse;
193     void    (*mouse_reset) ();
194 
195     /**pick functions**/
196     struct tv_pick pick;
197     void    (*pick_reset) ();
198 
199     /**region of interest**/
200     Vec2    ul, lr;
201 
202     /**repaint functions**/
203     int     paint_mode;
204     void    (*fulldraw) ();
205     void    (*skeldraw) ();
206     void   *drawdata;
207 
208     /**animation**/
209     List *movie;
210 
211     /** fast image redraw **/
212     Bool    backsave;
213     void    (*backdraw) ();
214     void   *background;
215 
216     /* Colormap info. */
217             Bool(*cmap_create_fn) ();   /* Function to create & fill
218                                          * colormap & fill in
219                                          * cmap_data_visible */
220     Cmap_data_visible *cmap_data_visible;       /* Visible part of
221                                                  * Cmap_data (defined in
222                                                  * tv_screen.h) */
223 
224     /* Z-buffer option * */
225     Tv_zbuff *zbuff;
226 
227     /* message function and data associated with tv */
228     void    (*message_fn) ();
229     void   *message_data;
230 
231     /* name function and data associated with tv */
232     void    (*header_fn) ();
233     void   *header_data;
234 }       Tv;
235 #define TV_SWAP_STRING "32[c]ipwiiffffitftttftitwwwtfttwwi.iii0[c]piitwtwttiwwppiwp..p.pwpwp"
236 
237 typedef struct tv_closest
238 {
239     Ts_id ts_id;                /* Tina structure identifier */
240     Tv *tv;
241     Ipos pos;
242     void *ptr;
243     int type;
244     float sep;
245 } Tv_closest;
246 #define TV_CLOSEST_SWAP_STRING "ptpif"
247 
248 #define ZOOM     1
249 #define ROI      2
250 #define PICK     3
251 #define MOUSE    4
252 #define POLYROI  5
253 #define POINT    6
254 #define GLOBAL   7 
255 
256 #define ORTH    1
257 #define PERSP   2
258 
259 #define IMZOOM  1
260 #define ZOOM2   2
261 #define ZOOM3   3
262 #define ZOOMAF  4
263 #define ZOOMGR  5
264 
265 #define FULL_PAINT    1
266 #define SKEL_PAINT    2
267 #define FULL_REPAINT  3
268 
269 #define BAD_STATE     1
270 #define WAIT_STATE    2
271 #define LEFT_DOWN     3
272 #define MIDDLE_DOWN   4
273 #define RIGHT_DOWN    5
274 #define LEFT_DRAG     6
275 #define MIDDLE_DRAG   7
276 #define RIGHT_DRAG    8
277 #define LEFT_UP       9
278 #define MIDDLE_UP     10
279 #define RIGHT_UP      11
280 #define MOUSE_NAME    12
281 #define LEFT_NAME     13
282 #define MIDDLE_NAME   14
283 #define RIGHT_NAME    15
284 
285 #define PICK_DOMAIN    1
286 #define PICK_CLOSEST   2
287 #define PICK_HIGHLIGHT 3
288 #define PICK_DRAW      4
289 #define PICK_FUNC      5
290 #define PICK_FREE      6
291 #define PICK_NAME      7
292 #define PICK_REPAINT   8
293 
294 /*
295 #define BKGRND          (CMAPLOOKUPCOLORSBASE )
296 #define BLACK           (CMAPLOOKUPCOLORSBASE + 1)
297 #define BLUE            (CMAPLOOKUPCOLORSBASE + 2)
298 #define RED             (CMAPLOOKUPCOLORSBASE + 3)
299 #define YELLOW          (CMAPLOOKUPCOLORSBASE + 4)
300 #define GREEN           (CMAPLOOKUPCOLORSBASE + 5)
301 #define WHITE           (CMAPLOOKUPCOLORSBASE + 6)
302 #define AUBERGINE       (CMAPLOOKUPCOLORSBASE + 7)
303 #define AVOCADO         (CMAPLOOKUPCOLORSBASE + 8)
304 #define BABY_BLUE       (CMAPLOOKUPCOLORSBASE + 9)
305 #define BABY_PINK       (CMAPLOOKUPCOLORSBASE + 10)
306 #define BROWN           (CMAPLOOKUPCOLORSBASE + 11)
307 #define CHOCOLATE       (CMAPLOOKUPCOLORSBASE + 12)
308 #define COFFEE          (CMAPLOOKUPCOLORSBASE + 13)
309 #define CYAN            (CMAPLOOKUPCOLORSBASE + 14)
310 #define DARK_GREEN      (CMAPLOOKUPCOLORSBASE + 15)
311 #define DARK_SLATE      (CMAPLOOKUPCOLORSBASE + 16)
312 #define GOLD            (CMAPLOOKUPCOLORSBASE + 17)
313 #define HELIOTROPE      (CMAPLOOKUPCOLORSBASE + 18)
314 #define INDIAN_RED      (CMAPLOOKUPCOLORSBASE + 19)
315 #define IVORY           (CMAPLOOKUPCOLORSBASE + 20)
316 #define MAGENTA         (CMAPLOOKUPCOLORSBASE + 21)
317 #define ORANGE          (CMAPLOOKUPCOLORSBASE + 22)
318 #define PALE_GREEN      (CMAPLOOKUPCOLORSBASE + 23)
319 #define PLUM            (CMAPLOOKUPCOLORSBASE + 24)
320 #define SALMON          (CMAPLOOKUPCOLORSBASE + 25)
321 #define SLATE           (CMAPLOOKUPCOLORSBASE + 26)
322 #define VIOLET          (CMAPLOOKUPCOLORSBASE + 27)
323 #define WHEAT           (CMAPLOOKUPCOLORSBASE + 28)
324 */
325 
326 /* Externs defined in X11/globals.c */
327 #ifdef _PCC
328 /* Tina named colors */
329 extern __declspec(dllimport) int aubergine;
330 extern __declspec(dllimport) int avocado;
331 extern __declspec(dllimport) int baby_blue;
332 extern __declspec(dllimport) int baby_pink;
333 extern __declspec(dllimport) int bkgrnd;
334 extern __declspec(dllimport) int black;
335 extern __declspec(dllimport) int blue;
336 extern __declspec(dllimport) int brown;
337 extern __declspec(dllimport) int chocolate;
338 extern __declspec(dllimport) int coffee;
339 extern __declspec(dllimport) int cyan;
340 extern __declspec(dllimport) int dark_green;
341 extern __declspec(dllimport) int dark_slate;
342 extern __declspec(dllimport) int gold;
343 extern __declspec(dllimport) int green;
344 extern __declspec(dllimport) int heliotrope;
345 extern __declspec(dllimport) int indian_red;
346 extern __declspec(dllimport) int ivory;
347 extern __declspec(dllimport) int magenta;
348 extern __declspec(dllimport) int orange;
349 extern __declspec(dllimport) int pale_green;
350 extern __declspec(dllimport) int plum;
351 extern __declspec(dllimport) int red;
352 extern __declspec(dllimport) int salmon;
353 extern __declspec(dllimport) int slate;
354 extern __declspec(dllimport) int violet;
355 extern __declspec(dllimport) int wheat;
356 extern __declspec(dllimport) int white;
357 extern __declspec(dllimport) int yellow;
358 extern __declspec(dllimport) int ntina_colors;
359 
360 extern __declspec(dllimport) int rop_copy;
361 extern __declspec(dllimport) int rop_null;
362 extern __declspec(dllimport) int line_solid;
363 extern __declspec(dllimport) int line_dashed;
364 extern __declspec(dllimport) int rop_xor;
365 
366 #else
367 
368 /* Tina named colors */
369 extern const int aubergine;
370 extern const int avocado;
371 extern const int baby_blue;
372 extern const int baby_pink;
373 extern const int bkgrnd;
374 extern const int black;
375 extern const int blue;
376 extern const int brown;
377 extern const int chocolate;
378 extern const int coffee;
379 extern const int cyan;
380 extern const int dark_green;
381 extern const int dark_slate;
382 extern const int gold;
383 extern const int green;
384 extern const int heliotrope;
385 extern const int indian_red;
386 extern const int ivory;
387 extern const int magenta;
388 extern const int orange;
389 extern const int pale_green;
390 extern const int plum;
391 extern const int red;
392 extern const int salmon;
393 extern const int slate;
394 extern const int violet;
395 extern const int wheat;
396 extern const int white;
397 extern const int yellow;
398 extern const int ntina_colors;
399 
400 extern const int rop_copy;
401 extern const int rop_null;
402 extern const int line_solid;
403 extern const int line_dashed;
404 extern const int rop_xor;
405 #endif
406 
407 #define IN_TV(tv, pos) \
408  (ipos_x(pos) >= 0 && ipos_x(pos) < (tv)->width && \
409   ipos_y(pos) >= 0 && ipos_y(pos) < (tv)->height)
410 
411 typedef struct tv_patch
412 {
413     Ts_id ts_id;                /* Tina structure identifier */
414     int filler1;
415     double  u[3], v[3];
416     int     flag[3][3];
417     Ipos    pos[3][3];
418     int     z[3][3];
419     int filler2;
420     double     g[3][3];
421 }       Tv_patch;
422 #define TV_PATCH_SWAP_STRING "3[g]3[g]9[i]9[t]9[i]9[g]"
423 
424 /* 3D structures temporarily here */
425 typedef struct cylinder
426 {
427     Ts_id ts_id;                /* Tina structure identifier */
428     Vec3    centre;
429     Vec3    ex, ey, ez;
430     int filler;
431     double  radius, length;
432 }       Cylinder;
433 #define CYLINDER_SWAP_STRING "ttttgg"
434  
435 typedef struct quadric
436 {
437     Ts_id ts_id;                /* Tina structure identifier */
438     Vec3    centre;
439     Mat3    s;
440     Mat3    g;
441 }       Quadric;
442 #define QUADRIC_SWAP_STRING "ttt"
443  
444 typedef struct torus
445 {
446     Ts_id ts_id;                /* Tina structure identifier */
447     Vec3    centre;
448     Vec3    ex, ey, ez;
449     int filler;
450     double  r1, r2;
451 }       Torus;
452 #define TORUS_SWAP_STRING "ttttgg"
453 
454 typedef struct ruled
455 {
456     Ts_id ts_id;                /* Tina structure identifier */
457     Vec3    p1, p2, p3, p4;
458 }       Ruled;
459 #define RULED_SWAP_STRING "tttt"
460  
461 typedef struct quad3
462 {
463     Ts_id ts_id;                /* Tina structure identifier */
464     Vec3    p1, p2, p3, p4;
465     Vec3 n;
466 }       Quad3;
467 #define QUAD3_SWAP_STRING "ttttt"
468  
469 typedef enum {DT_BW, DT_COLOR, DT_ONE_BIT_PER_PIXEL} Dump_type;
470 #endif                          /* TV_HEADS_DEFINED */
471 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.