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

Linux Cross Reference
Tina5/tina-tools/tinatool/draw/draw_TvDef.h

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

  1 /**********
  2  *
  3  * Copyright (c) 2003, Division of Imaging Science and Biomedical Engineering,
  4  * University of Manchester, UK.  All rights reserved.
  5  * 
  6  * Redistribution and use in source and binary forms, with or without modification, 
  7  * are permitted provided that the following conditions are met:
  8  * 
  9  *   . Redistributions of source code must retain the above copyright notice, 
 10  *     this list of conditions and the following disclaimer.
 11  *    
 12  *   . Redistributions in binary form must reproduce the above copyright notice,
 13  *     this list of conditions and the following disclaimer in the documentation 
 14  *     and/or other materials provided with the distribution.
 15  * 
 16  *   . Neither the name of the University of Manchester nor the names of its
 17  *     contributors may be used to endorse or promote products derived from this 
 18  *     software without specific prior written permission.
 19  * 
 20  * 
 21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 31  * POSSIBILITY OF SUCH DAMAGE.
 32  *
 33  **********
 34  *
 35  * Program :    TINA
 36  * File    :  $Source: /home/tina/cvs/tina-tools/tinatool/draw/draw_TvDef.h,v $
 37  * Date    :  $Date: 2005/07/03 23:43:56 $
 38  * Version :  $Revision: 1.3 $
 39  * CVS Id  :  $Id: draw_TvDef.h,v 1.3 2005/07/03 23:43:56 paul Exp $
 40  *
 41  * Author  : Legacy TINA
 42  *
 43  * Notes :
 44  *        Tv structures etc
 45  *
 46  *********
 47 */
 48 
 49 #ifndef TINATOOL_DRAW_TV_DEF_HDR
 50 #define TINATOOL_DRAW_TV_DEF_HDR
 51 
 52 #include <tina/math/mathDef.h>
 53 #include <tina/image/imgDef.h>
 54 
 55 #define TV_SCREEN_REPAINT 1
 56 #define TV_SCREEN_REPAINT_IF_SMALLER 2
 57 #define TV_SCREEN_NO_REPAINT 3
 58 
 59 #define CMAPLOOKUPCOLORSBASE 256
 60 #define CMAPLOOKUPGREYSBASE 0
 61 #define CMAPLOOKUPNUMBEROFCOLORS 256
 62 #define CMAPLOOKUPNUMBEROFGREYS 256
 63 #define CMAPLOOKUPSIZE (CMAPLOOKUPNUMBEROFGREYS + CMAPLOOKUPNUMBEROFCOLORS)
 64 
 65 #ifndef __STRICT_ANSI__
 66 #define const
 67 #endif /* __STRICT_ANSI__ */
 68 
 69 /* I think this is only used in the graphics libraries: try taking it out PAB
 70 
 71 typedef void *(*voidStarFn) ();
 72 
 73 */
 74 
 75 typedef int Tina_pixel;
 76 typedef struct rgb
 77 {
 78     Ts_id ts_id;                /* Tina structure identifier */
 79     unsigned short red;         /* range: 0 - 256 */
 80     unsigned short green;       /* range: 0 - 256 */
 81     unsigned short blue;        /* range: 0 - 256 */
 82 }       Rgb;
 83 #define RGB_SWAP_STRING "kkk"
 84 
 85 typedef struct tina_color
 86 {
 87     Ts_id ts_id;                /* Tina structure identifier */
 88     Tina_pixel pixel;
 89     unsigned short red;         /* range: 0 - 0XFFFF */
 90     unsigned short green;       /* range: 0 - 0XFFFF */
 91     unsigned short blue;        /* range: 0 - 0XFFFF */
 92 }       Tina_color;
 93 #define TINA_COLOR_SWAP_STRING ".kkk"
 94 
 95 #define TINA_COLOR_ARRAY_CREATE(_size) ((Tina_color *) ralloc((unsigned)(_size) * sizeof (Tina_color)))
 96 #define RGB_ARRAY_CREATE(_size) ((Rgb *) ralloc((unsigned)(_size) * sizeof (Rgb)))
 97 #define TINA_PIXEL_ARRAY_CREATE(_size) ((Tina_pixel *) ralloc((unsigned)(_size) * sizeof (Tina_pixel)))
 98 
 99 typedef enum cmap_model
100 {
101     cmap_model_gs, cmap_model_col, cmap_model_rgb, cmap_model_unknown
102 }       Cmap_model;
103 
104 typedef enum cmap_kind
105 {
106     cmap_type_dynamic, cmap_type_static, cmap_type_unknown
107 }       Cmap_kind;
108 
109 typedef struct cmap_data_visible
110 {
111     Ts_id ts_id;                /* Tina structure identifier */
112     /* Visible at tv level */
113     Cmap_model model;           /* cmap_model_gs, cmap_model_col,
114                                  * cmap_model_rgb */
115     Cmap_kind type;             /* cmap_type_dynamic, cmap_type_static */
116     int     ncells;             /* ncells of colormap */
117     int     nplanes;            /* no of cmap planes */
118     Tina_pixel base;            /* first used colormap entry */
119     Tina_pixel std_lut[CMAPLOOKUPSIZE]; /* standard tina LUT */
120     Tina_pixel overlay_mask;    /* xor mask for overlay */
121     int     color_bits;         /* number of bits of color */
122     int     color_lut[CMAPLOOKUPNUMBEROFGREYS]; /* col val look up */
123 }       Cmap_data_visible;
124 #define CMAP_DATA_VISIBLE_SWAP_STRING "iiii.0[.].i0[i]"
125 
126 typedef struct tv_mouse
127 {
128     Ts_id ts_id;                /* Tina structure identifier */
129     char    name[32];
130 
131     char    left_name[32];
132     void    (*left_down) ();
133     void    (*left_drag) ();
134     void    (*left_up) ();
135 
136     char    middle_name[32];
137     void    (*middle_down) ();
138     void    (*middle_drag) ();
139     void    (*middle_up) ();
140 
141     char    right_name[32];
142     void    (*right_down) ();
143     void    (*right_drag) ();
144     void    (*right_up) ();
145 }       Tv_mouse;
146 #define TV_MOUSE_SWAP_STRING "32[c]32[c]www32[c]www32[c]www"
147 
148 typedef struct tv_pick
149 {
150     Ts_id ts_id;                /* Tina structure identifier */
151     char    name[32];
152 
153     List   *picklist;
154     void   *(*closest) ();
155     void    (*highlight) ();
156     void    (*draw) ();
157     void    (*func) ();
158     void    (*free) ();
159     Bool    do_repaint;
160 }       Tv_pick;
161 #define TV_PICK_SWAP_STRING "32[c]pwwwwwi"
162 
163 typedef struct tv_draw
164 {
165     Ts_id ts_id;                /* Tina structure identifier */
166     /**Draw options**/
167     Bool    overlay_on;
168     int     color;
169     int     op;
170     int     linewidth;
171     int     linestyle;
172     char    font_name[STRING128];
173 }       Tv_draw;
174 #define TV_DRAW_SWAP_STRING "iiiii0[c]"
175 
176 typedef struct tv_zbuff
177 {
178     Ts_id ts_id;                /* Tina structure identifier */
179     Imrect *z;
180     double  zmin, zmax;
181     Bool    backdraw;
182     int (*color)();
183     double (*shade)();
184 }       Tv_zbuff;
185 #define TV_ZBUFF_SWAP_STRING "pggi.."
186 
187 typedef struct tv
188 {
189     Ts_id ts_id;                /* Tina structure identifier */
190     char    label[32];
191 
192     /**clone number**/
193     int     clone;
194 
195     /**current tv_screen owned by tv**/
196     void   *tv_screen;
197 
198     /**camera initialisation**/
199     void    (*init) ();
200 
201     /**display scaling**/
202     int     width;
203     int     height;
204     float   cx, cy;
205     float   scalex, scaley;
206 
207     /**3D projection**/
208     int     proj3type;
209     struct vec3 centre3;
210     float   radius3;
211     struct vec3 ex3, ey3, ez3;
212     float   pscale;
213     struct vec3 pcentre;
214     Bool    axis_set;
215     struct vec3 axis;
216     struct ipos (*proj3) ();
217     void    (*ray3) ();
218     struct vec3 (*backproj3) ();
219 
220     /**2D projection**/
221     struct vec2 centre2;
222     float   radius2;
223     struct vec2 ex2, ey2;
224     struct ipos (*proj2) ();
225     struct vec2 (*backproj2) ();
226 
227     /**Draw options**/
228     Bool    overlay_on;
229     Tina_pixel color;
230     int     op;
231     int     linewidth;
232     int     linestyle;
233     char    font_name[STRING128];
234 
235     /**draw option stack**/
236     List   *draw;
237 
238     /**mouse activity**/
239     int     activity;
240 
241     /**zoom functionality**/
242     int     zoomlevel;
243 
244     /**mouse functions**/
245     struct tv_mouse mouse;
246     void    (*mouse_reset) ();
247 
248     /**pick functions**/
249     struct tv_pick pick;
250     void    (*pick_reset) ();
251 
252     /**region of interest**/
253     Vec2    ul, lr;
254 
255     /**repaint functions**/
256     int     paint_mode;
257     void    (*fulldraw) ();
258     void    (*skeldraw) ();
259     void   *drawdata;
260 
261     /**animation**/
262     List *movie;
263 
264     /** fast image redraw **/
265     Bool    backsave;
266     void    (*backdraw) ();
267     void   *background;
268 
269     /* Colormap info. */
270             Bool(*cmap_create_fn) ();   /* Function to create & fill
271                                          * colormap & fill in
272                                          * cmap_data_visible */
273     Cmap_data_visible *cmap_data_visible;       /* Visible part of
274                                                  * Cmap_data (defined in
275                                                  * tv_screen.h) */
276 
277     /* Z-buffer option * */
278     Tv_zbuff *zbuff;
279 
280     /* message function and data associated with tv */
281     void    (*message_fn) ();
282     void   *message_data;
283 
284     /* name function and data associated with tv */
285     void    (*header_fn) ();
286     void   *header_data;
287 }       Tv;
288 #define TV_SWAP_STRING "32[c]ipwiiffffitftttftitwwwtfttwwi.iii0[c]piitwtwttiwwppiwp..p.pwpwp"
289 
290 typedef struct tv_closest
291 {
292     Ts_id ts_id;                /* Tina structure identifier */
293     Tv *tv;
294     Ipos pos;
295     void *ptr;
296     int type;
297     float sep;
298 } Tv_closest;
299 #define TV_CLOSEST_SWAP_STRING "ptpif"
300 
301 #define ZOOM     1
302 #define ROI      2
303 #define PICK     3
304 #define MOUSE    4
305 #define POLYROI  5
306 #define POINT    6
307 #define GLOBAL   7 
308 
309 #define ORTH    1
310 #define PERSP   2
311 
312 #define IMZOOM  1
313 #define ZOOM2   2
314 #define ZOOM3   3
315 #define ZOOMAF  4
316 #define ZOOMGR  5
317 
318 #define FULL_PAINT    1
319 #define SKEL_PAINT    2
320 #define FULL_REPAINT  3
321 
322 #define BAD_STATE     1
323 #define WAIT_STATE    2
324 #define LEFT_DOWN     3
325 #define MIDDLE_DOWN   4
326 #define RIGHT_DOWN    5
327 #define LEFT_DRAG     6
328 #define MIDDLE_DRAG   7
329 #define RIGHT_DRAG    8
330 #define LEFT_UP       9
331 #define MIDDLE_UP     10
332 #define RIGHT_UP      11
333 #define MOUSE_NAME    12
334 #define LEFT_NAME     13
335 #define MIDDLE_NAME   14
336 #define RIGHT_NAME    15
337 
338 #define PICK_DOMAIN    1
339 #define PICK_CLOSEST   2
340 #define PICK_HIGHLIGHT 3
341 #define PICK_DRAW      4
342 #define PICK_FUNC      5
343 #define PICK_FREE      6
344 #define PICK_NAME      7
345 #define PICK_REPAINT   8
346 
347 /*
348 #define BKGRND          (CMAPLOOKUPCOLORSBASE )
349 #define BLACK           (CMAPLOOKUPCOLORSBASE + 1)
350 #define BLUE            (CMAPLOOKUPCOLORSBASE + 2)
351 #define RED             (CMAPLOOKUPCOLORSBASE + 3)
352 #define YELLOW          (CMAPLOOKUPCOLORSBASE + 4)
353 #define GREEN           (CMAPLOOKUPCOLORSBASE + 5)
354 #define WHITE           (CMAPLOOKUPCOLORSBASE + 6)
355 #define AUBERGINE       (CMAPLOOKUPCOLORSBASE + 7)
356 #define AVOCADO         (CMAPLOOKUPCOLORSBASE + 8)
357 #define BABY_BLUE       (CMAPLOOKUPCOLORSBASE + 9)
358 #define BABY_PINK       (CMAPLOOKUPCOLORSBASE + 10)
359 #define BROWN           (CMAPLOOKUPCOLORSBASE + 11)
360 #define CHOCOLATE       (CMAPLOOKUPCOLORSBASE + 12)
361 #define COFFEE          (CMAPLOOKUPCOLORSBASE + 13)
362 #define CYAN            (CMAPLOOKUPCOLORSBASE + 14)
363 #define DARK_GREEN      (CMAPLOOKUPCOLORSBASE + 15)
364 #define DARK_SLATE      (CMAPLOOKUPCOLORSBASE + 16)
365 #define GOLD            (CMAPLOOKUPCOLORSBASE + 17)
366 #define HELIOTROPE      (CMAPLOOKUPCOLORSBASE + 18)
367 #define INDIAN_RED      (CMAPLOOKUPCOLORSBASE + 19)
368 #define IVORY           (CMAPLOOKUPCOLORSBASE + 20)
369 #define MAGENTA         (CMAPLOOKUPCOLORSBASE + 21)
370 #define ORANGE          (CMAPLOOKUPCOLORSBASE + 22)
371 #define PALE_GREEN      (CMAPLOOKUPCOLORSBASE + 23)
372 #define PLUM            (CMAPLOOKUPCOLORSBASE + 24)
373 #define SALMON          (CMAPLOOKUPCOLORSBASE + 25)
374 #define SLATE           (CMAPLOOKUPCOLORSBASE + 26)
375 #define VIOLET          (CMAPLOOKUPCOLORSBASE + 27)
376 #define WHEAT           (CMAPLOOKUPCOLORSBASE + 28)
377 */
378 
379 /*
380  * define colors for PC but not when MINGW 
381  */
382 #ifdef _PCC
383         #ifndef MINGW
384         #define TINACOLORSDEFINED 1
385 /* Tina named colors */
386 extern __declspec(dllimport) int aubergine;
387 extern __declspec(dllimport) int avocado;
388 extern __declspec(dllimport) int baby_blue;
389 extern __declspec(dllimport) int baby_pink;
390 extern __declspec(dllimport) int bkgrnd;
391 extern __declspec(dllimport) int black;
392 extern __declspec(dllimport) int blue;
393 extern __declspec(dllimport) int brown;
394 extern __declspec(dllimport) int chocolate;
395 extern __declspec(dllimport) int coffee;
396 extern __declspec(dllimport) int cyan;
397 extern __declspec(dllimport) int dark_green;
398 extern __declspec(dllimport) int dark_slate;
399 extern __declspec(dllimport) int gold;
400 extern __declspec(dllimport) int green;
401 extern __declspec(dllimport) int heliotrope;
402 extern __declspec(dllimport) int indian_red;
403 extern __declspec(dllimport) int ivory;
404 extern __declspec(dllimport) int magenta;
405 extern __declspec(dllimport) int orange;
406 extern __declspec(dllimport) int pale_green;
407 extern __declspec(dllimport) int plum;
408 extern __declspec(dllimport) int red;
409 extern __declspec(dllimport) int salmon;
410 extern __declspec(dllimport) int slate;
411 extern __declspec(dllimport) int violet;
412 extern __declspec(dllimport) int wheat;
413 extern __declspec(dllimport) int white;
414 extern __declspec(dllimport) int yellow;
415 extern __declspec(dllimport) int ntina_colors;
416 
417 extern __declspec(dllimport) int rop_copy;
418 extern __declspec(dllimport) int rop_null;
419 extern __declspec(dllimport) int line_solid;
420 extern __declspec(dllimport) int line_dashed;
421 extern __declspec(dllimport) int rop_xor;
422         #endif
423 #endif
424 
425 /* Externs defined in X11/globals.c */
426 #ifndef TINACOLORSDEFINED
427 /* Tina named colors */
428 extern const int aubergine;
429 extern const int avocado;
430 extern const int baby_blue;
431 extern const int baby_pink;
432 extern const int bkgrnd;
433 extern const int black;
434 extern const int blue;
435 extern const int brown;
436 extern const int chocolate;
437 extern const int coffee;
438 extern const int cyan;
439 extern const int dark_green;
440 extern const int dark_slate;
441 extern const int gold;
442 extern const int green;
443 extern const int heliotrope;
444 extern const int indian_red;
445 extern const int ivory;
446 extern const int magenta;
447 extern const int orange;
448 extern const int pale_green;
449 extern const int plum;
450 extern const int red;
451 extern const int salmon;
452 extern const int slate;
453 extern const int violet;
454 extern const int wheat;
455 extern const int white;
456 extern const int yellow;
457 extern const int ntina_colors;
458 
459 extern const int rop_copy;
460 extern const int rop_null;
461 extern const int line_solid;
462 extern const int line_dashed;
463 extern const int rop_xor;
464 #endif
465 
466 #define IN_TV(tv, pos) \
467  (ipos_x(pos) >= 0 && ipos_x(pos) < (tv)->width && \
468   ipos_y(pos) >= 0 && ipos_y(pos) < (tv)->height)
469   
470 typedef struct tv_patch
471 {
472     Ts_id ts_id;                /* Tina structure identifier */
473     int filler1;
474     double  u[3], v[3];
475     int     flag[3][3];
476     Ipos    pos[3][3];
477     int     z[3][3];
478     int filler2;
479     double     g[3][3];
480 }       Tv_patch;
481 #define TV_PATCH_SWAP_STRING "3[g]3[g]9[i]9[t]9[i]9[g]"
482 
483 /* 3D structures temporarily here */
484 typedef struct cylinder
485 {
486     Ts_id ts_id;                /* Tina structure identifier */
487     Vec3    centre;
488     Vec3    ex, ey, ez;
489     int filler;
490     double  radius, length;
491 }       Cylinder;
492 #define CYLINDER_SWAP_STRING "ttttgg"
493  
494 typedef struct quadric
495 {
496     Ts_id ts_id;                /* Tina structure identifier */
497     Vec3    centre;
498     Mat3    s;
499     Mat3    g;
500 }       Quadric;
501 #define QUADRIC_SWAP_STRING "ttt"
502  
503 typedef struct torus
504 {
505     Ts_id ts_id;                /* Tina structure identifier */
506     Vec3    centre;
507     Vec3    ex, ey, ez;
508     int filler;
509     double  r1, r2;
510 }       Torus;
511 #define TORUS_SWAP_STRING "ttttgg"
512 
513 typedef struct ruled
514 {
515     Ts_id ts_id;                /* Tina structure identifier */
516     Vec3    p1, p2, p3, p4;
517 }       Ruled;
518 #define RULED_SWAP_STRING "tttt"
519  
520 typedef struct quad3
521 {
522     Ts_id ts_id;                /* Tina structure identifier */
523     Vec3    p1, p2, p3, p4;
524     Vec3 n;
525 }       Quad3;
526 #define QUAD3_SWAP_STRING "ttttt"
527  
528 typedef enum {DT_BW, DT_COLOR, DT_ONE_BIT_PER_PIXEL} Dump_type;
529 #define DUMP_TYPE_SWAP_STRING "iii"
530 #endif
531 

~ [ 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.