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

Linux Cross Reference
Tina4/src/tools/stereo/ster_stack.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/vision.h>
  8 #include <tina/visionfuncs.h>
  9 #include <tina/tv.h>
 10 #include <tina/toolsfuncs.h>
 11 #include <tina/file.h>
 12 #include <tina/filefuncs.h>
 13 
 14 #define LEFT_STACK   0
 15 #define RIGHT_STACK  1
 16 #define THREED_STACK 2
 17 
 18 #define IMAGE_DATA   0
 19 #define EDGE_DATA    1
 20 
 21 static int stack_image_type = LEFT_STACK;
 22 static int stack_data_type = IMAGE_DATA;
 23 
 24 void    stereo_set_stack_image_type(int value)
 25 {
 26     stack_image_type = value;
 27 }
 28 
 29 int     stereo_get_stack_image_type(void)
 30 {
 31     return (stack_image_type);
 32 }
 33 
 34 void    stereo_set_stack_data_type(int value)
 35 {
 36     stack_data_type = value;
 37 }
 38 
 39 int     stereo_get_stack_data_type(void)
 40 {
 41     return (stack_data_type);
 42 }
 43 
 44 void    stereo_push_stack(void)
 45 {
 46     switch (OPAIR(stack_data_type, stack_image_type))
 47     {
 48         case OPAIR(IMAGE_DATA, LEFT_STACK):
 49         stack_push((void *) im_cast(left_image(), float_v), IMRECT, im_free);
 50         break;
 51     case OPAIR(IMAGE_DATA, RIGHT_STACK):
 52         stack_push((void *) im_cast(right_image(), float_v), IMRECT, im_free);
 53         break;
 54     case OPAIR(EDGE_DATA, LEFT_STACK):
 55         stack_push((void *) left_edges(), EDGERECT, er_free);
 56         left_edges_null();
 57         break;
 58     case OPAIR(EDGE_DATA, RIGHT_STACK):
 59         stack_push((void *) right_edges(), EDGERECT, er_free);
 60         right_edges_null();
 61         break;
 62     }
 63 }
 64 
 65 void    stereo_pop_stack(void)
 66 {
 67     int     type;
 68 
 69     switch (stack_data_type)
 70     {
 71     case IMAGE_DATA:
 72         if (stack_check_types(IMRECT, NULL) == false)
 73         {
 74             error("stereo_pop: wrong type on stack", warning);
 75             return;
 76         }
 77         break;
 78     case EDGE_DATA:
 79         if (stack_check_types(EDGERECT, NULL) == false)
 80         {
 81             error("stereo_pop: wrong type on stack", warning);
 82             return;
 83         }
 84         break;
 85     default:
 86         error("stereo_pop: unknown type", warning);
 87         return;
 88     }
 89 
 90     switch (OPAIR(stack_data_type, stack_image_type))
 91     {
 92     case OPAIR(IMAGE_DATA, LEFT_STACK):
 93         left_image_set((Imrect *) stack_pop(&type));
 94         break;
 95     case OPAIR(IMAGE_DATA, RIGHT_STACK):
 96         right_image_set((Imrect *) stack_pop(&type));
 97         break;
 98     case OPAIR(EDGE_DATA, LEFT_STACK):
 99         left_edges_set((Imrect *) stack_pop(&type));
100         break;
101     case OPAIR(EDGE_DATA, RIGHT_STACK):
102         right_edges_set((Imrect *) stack_pop(&type));
103         break;
104     }
105 }
106 

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