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

Linux Cross Reference
Tina4/src/tools/stereo/right_view.c

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

  1 /**@(#)
  2 **/
  3 #include <stdio.h>
  4 #include <tina/sys.h>
  5 #include <tina/sysfuncs.h>
  6 #include <tina/math.h>
  7 #include <tina/mathfuncs.h>
  8 #include <tina/vision.h>
  9 #include <tina/improcfuncs.h>
 10 #include <tina/tv.h>
 11 #include <tina/tvfuncs.h>
 12 #include <tina/draw.h>
 13 #include <tina/drawfuncs.h>
 14 #include <tina/toolsfuncs.h>
 15 
 16 Tv     *tv_create();
 17 
 18 static Bool image_on = true;
 19 static Bool edges_on;
 20 static Bool corners_on;
 21 static Bool strings_on;
 22 static Bool poly_on;
 23 
 24 void    right_image_on(Bool on)
 25 {
 26     image_on = on;
 27 }
 28 
 29 void    right_edges_on(Bool on)
 30 {
 31     edges_on = on;
 32 }
 33 
 34 void    right_corners_on(Bool on)
 35 {
 36     corners_on = on;
 37 }
 38 
 39 void    right_strings_on(Bool on)
 40 {
 41     strings_on = on;
 42 }
 43 
 44 void    right_poly_on(Bool on)
 45 {
 46     poly_on = on;
 47 }
 48 
 49 void    right_backdraw(Tv * tv)
 50 {
 51     Imrect *im = right_image();
 52 
 53     if (image_on && (im != NULL))
 54     {
 55         im = imf_scale(im, 0.0, 255.0);
 56         tv_imrect2(tv, im);
 57         im_free(im);
 58     }
 59 }
 60 
 61 void    right_fulldraw(Tv * tv)
 62 {
 63     Imrect *er = right_edges_get();
 64     Imrect *cnr = right_corners_get();
 65     List   *poly = right_geom_get();
 66 
 67     if (edges_on && (er != NULL))
 68         tv_edges_conn(tv, er);
 69     if (strings_on && (er != NULL))
 70         tv_strings(tv, er);
 71     if (corners_on && (cnr != NULL))
 72         tv_edges_conn(tv, cnr);
 73     if (poly_on && poly != NULL)
 74         reclist_list_draw(tv, poly, (int)NULL, geom_col_draw, NULL);
 75 }
 76 
 77 void    right_skeldraw(Tv * tv)
 78 {
 79     Imrect *im = right_image();
 80     Imrect *er = right_edges();
 81     List   *poly = right_geom_get();
 82 
 83     if (image_on && (im != NULL))
 84         tv_imrect_skel(tv, im);
 85     else if ((edges_on || strings_on) && (er != NULL))
 86         tv_imrect_skel(tv, er);
 87     if (poly_on && poly != NULL)
 88         reclist_list_draw(tv, poly, (int)NULL, geom_draw, NULL);
 89 }
 90 
 91 void    right_init(Tv * tv)
 92 {
 93     Imrect *im = right_image();
 94     Imrect *er = right_edges();
 95 
 96     if (im != NULL)
 97         tv_camera2_image(tv, im->width, im->height);
 98     else if (er != NULL)
 99         tv_camera2_image(tv, er->width, er->height);
100 }
101 
102 Tv     *right_tv_make(void)
103 {
104     Tv     *tvright = NULL;
105 
106     tvright = tv_create("right");
107     (void) tv_set_backdraw(tvright, right_backdraw);
108     (void) tv_set_fulldraw(tvright, right_fulldraw);
109     (void) tv_set_skeldraw(tvright, right_skeldraw);
110     tv_set_init(tvright, right_init);
111     (void) tv_set_zoomlevel(tvright, IMZOOM);
112     return (tvright);
113 }
114 
115 void    right_grey(Tv * tv, Ipos pos)
116 {
117     Vec2    v = {Vec2_id};
118     Vec2    tv_backproj2();
119     Imrect *im = right_image();
120     int     x, y, val;
121 
122     v = tv_backproj2(tv, pos);
123     x = vec2_x(v);
124     y = vec2_y(v);
125     val = im_get_pix(im, y, x);
126 
127     format("pos %10d %10d:     grey level = %10d\n", x, y, val);
128 }
129 
130 Tv_mouse right_grey_mouse(void)
131 {
132     return (mouse_define(MOUSE_NAME, "grey mouse",
133                          LEFT_NAME, "grey",
134                          LEFT_DOWN, right_grey, NULL));
135 }
136 

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