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

Linux Cross Reference
Tina6/tina-tools/tinatool/tlbase/tlbaseSter_stack.c

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/tlbase/tlbaseSter_stack.c,v $
 37  * Date    :  $Date: 2003/10/01 16:02:47 $
 38  * Version :  $Revision: 1.2 $
 39  * CVS Id  :  $Id: tlbaseSter_stack.c,v 1.2 2003/10/01 16:02:47 tony Exp $
 40  *
 41  * Author  :  Legacy TINA
 42  *
 43  * Notes :
 44  *
 45  *********
 46 */
 47 
 48 #include "tlbaseSter_stack.h"
 49 
 50 #if HAVE_CONFIG_H
 51 #include <config.h>
 52 #endif
 53 
 54 #include <stdio.h>
 55 #include <tina/sys/sysDef.h>
 56 #include <tina/sys/sysPro.h>
 57 #include <tina/image/imgDef.h>
 58 #include <tina/image/imgPro.h>
 59 #include <tina/geometry/geomPro.h>
 60 #include <tinatool/tlbase/tlbase_InfrDef.h>
 61 #include <tinatool/tlbase/tlbase_InfrPro.h>
 62 #include <tinatool/tlbase/tlbase_SterDef.h>
 63 
 64 static int stack_image_type = LEFT_STACK;
 65 static int stack_data_type = IMAGE_DATA;
 66 
 67 void    stereo_set_stack_image_type(int value)
 68 {
 69     stack_image_type = value;
 70 }
 71 
 72 int     stereo_get_stack_image_type(void)
 73 {
 74     return (stack_image_type);
 75 }
 76 
 77 void    stereo_set_stack_data_type(int value)
 78 {
 79     stack_data_type = value;
 80 }
 81 
 82 int     stereo_get_stack_data_type(void)
 83 {
 84     return (stack_data_type);
 85 }
 86 
 87 void    stereo_push_stack(void)
 88 {
 89     switch (OPAIR(stack_data_type, stack_image_type))
 90     {
 91         case OPAIR(IMAGE_DATA, LEFT_STACK):
 92         stack_push((void *) im_cast(left_image(), float_v), IMRECT, im_free);
 93         break;
 94     case OPAIR(IMAGE_DATA, RIGHT_STACK):
 95         stack_push((void *) im_cast(right_image(), float_v), IMRECT, im_free);
 96         break;
 97     case OPAIR(EDGE_DATA, LEFT_STACK):
 98         stack_push((void *) left_edges(), EDGERECT, er_free);
 99         left_edges_null();
100         break;
101     case OPAIR(EDGE_DATA, RIGHT_STACK):
102         stack_push((void *) right_edges(), EDGERECT, er_free);
103         right_edges_null();
104         break;
105     }
106 }
107 
108 void    stereo_pop_stack(void)
109 {
110     int     type;
111 
112     switch (stack_data_type)
113     {
114     case IMAGE_DATA:
115         if (stack_check_types(IMRECT, NULL) == false)
116         {
117             error("stereo_pop: wrong type on stack", warning);
118             return;
119         }
120         break;
121     case EDGE_DATA:
122         if (stack_check_types(EDGERECT, NULL) == false)
123         {
124             error("stereo_pop: wrong type on stack", warning);
125             return;
126         }
127         break;
128     default:
129         error("stereo_pop: unknown type", warning);
130         return;
131     }
132 
133     switch (OPAIR(stack_data_type, stack_image_type))
134     {
135     case OPAIR(IMAGE_DATA, LEFT_STACK):
136         left_image_set((Imrect *) stack_pop(&type));
137         break;
138     case OPAIR(IMAGE_DATA, RIGHT_STACK):
139         right_image_set((Imrect *) stack_pop(&type));
140         break;
141     case OPAIR(EDGE_DATA, LEFT_STACK):
142         left_edges_set((Imrect *) stack_pop(&type));
143         break;
144     case OPAIR(EDGE_DATA, RIGHT_STACK):
145         right_edges_set((Imrect *) stack_pop(&type));
146         break;
147     }
148 }
149 

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