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

Linux Cross Reference
Tina4/src/tools/sequence/seq_vars.c

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

  1 /*
  2   seq_vars.c
  3 
  4   Temporal tool general variables and supporting functions
  5 
  6   author: a.lacey
  7   date  : 11-3-93; version 1.0
  8           4.12.95; version 2.0
  9 */
 10 
 11 #include <stdio.h>
 12 #include <tina/sys.h>
 13 #include <tina/sysfuncs.h>
 14 #include <tina/math.h>
 15 #include <tina/mathfuncs.h>
 16 #include <tina/vision.h>
 17 #include <tina/visionfuncs.h>
 18 #include <tina/tv.h>
 19 #include <tina/image.h>
 20 #include <tina/seqdefs.h>
 21 #include <tina/seqoral.h>
 22 #include <tina/seqpro.h>
 23 
 24 
 25 static  Sequence        *tptr = NULL;
 26 static  List            *current = NULL;
 27 static  List            *start = NULL;
 28 static  List            *end = NULL;
 29 static  int              seq_format;
 30 
 31 
 32 void            set_seq_ptr(Sequence *ptr)
 33 {
 34   tptr = ptr;
 35 }
 36 
 37 
 38 void            set_current_el(List *el)
 39 {
 40   current = el;
 41 }
 42 
 43 
 44 void            set_start_el(List *el)
 45 {
 46   start = el;
 47 }       
 48 
 49 
 50 void            set_end_el(List *el)
 51 {
 52   end = el;
 53 }
 54 
 55 
 56 void            set_seq_format(int f)
 57 {
 58   seq_format = f;
 59 }
 60 
 61 
 62 Sequence       *get_seq_ptr(void)
 63 {       
 64   return(tptr);
 65 }
 66 
 67 
 68 List           *get_current_el(void)
 69 {
 70   return(current);
 71 }
 72 
 73 
 74 List           *get_start_el(void)
 75 {
 76   return(start);
 77 }
 78 
 79 
 80 List           *get_end_el(void)
 81 {
 82   return(end);
 83 }
 84 
 85 int             get_seq_format(void)
 86 {
 87   return(seq_format);
 88 }
 89 
 90 
 91 void            set_frame_no(Imrect *im, int frame)
 92 {
 93   int   *label = ralloc(sizeof(int));
 94 
 95   *label = frame;
 96   im->props = proplist_rm(im->props, TEMP_FRAME_NO);
 97   im->props = proplist_add(im->props, label, TEMP_FRAME_NO, rfree);
 98 
 99   return;
100 }
101 
102 
103 int          get_frame_no(Imrect *im)
104 {
105   int   *pf;
106 
107   *pf = (int *)prop_get(im->props, TEMP_FRAME_NO);
108   if (pf != NULL)
109     return(*pf);
110 
111   return(-1);
112 }
113 
114 
115 void     seq_addtoall_props(void *ptr, int type, void *copyfunc(), 
116          void (*freefunc))
117 {
118     List  *lptr = (List *)get_start_el();
119     Imrect  *im = NULL;
120     void    *cptr = NULL;
121     
122     if (lptr == NULL)
123       return;
124 
125     while (lptr != NULL)
126     {
127       im = (Imrect *)(lptr->to);
128       if (copyfunc != NULL)
129         cptr = (void *)(*copyfunc)(ptr);
130       else
131         cptr = ptr;
132       im->props = proplist_rm(im->props, type);
133       im->props = proplist_add(im->props, cptr, type, freefunc);
134       lptr = lptr->next;
135     }
136 }
137 
138 

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