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

Linux Cross Reference
Tina6/tina-libs/tina/geometry/geomLine_pixelprox.c

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

  1 /**********
  2  * 
  3  * This file is part of the TINA Open Source Image Analysis Environment
  4  * henceforth known as TINA
  5  *
  6  * TINA is free software; you can redistribute it and/or modify
  7  * it under the terms of the GNU General Public License as 
  8  * published by the Free Software Foundation.
  9  *
 10  * TINA is distributed in the hope that it will be useful,
 11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  * GNU General Public License for more details.
 14  *
 15  * You should have received a copy of the GNU General Public License
 16  * along with TINA; if not, write to the Free Software Foundation, Inc., 
 17  * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18  *
 19  * ANY users of TINA who require exemption from the existing licence must
 20  * negotiate a new licence with Dr. Neil.A.Thacker, the sole agent for
 21  * the University of Manchester.
 22  *
 23  **********
 24  * 
 25  * Program :    TINA
 26  * File    :  $Source: /home/tina/cvs/tina-libs/tina/geometry/geomLine_pixelprox.c,v $
 27  * Date    :  $Date: 2009/03/19 18:36:26 $
 28  * Version :  $Revision: 1.2 $
 29  * CVS Id  :  $Id: geomLine_pixelprox.c,v 1.2 2009/03/19 18:36:26 paul Exp $
 30  *
 31  * Notes :
 32  *
 33  *********
 34 */
 35 
 36 
 37 #include "geomLine_pixelprox.h"
 38 
 39 #if HAVE_CONFIG_H
 40   #include <config.h>
 41 #endif
 42 
 43 #include <stdio.h>
 44 #include <tina/sys/sysDef.h>
 45 #include <tina/sys/sysPro.h>
 46 #include <tina/geometry/geomDef.h>
 47 #include <tina/geometry/geom_LineDef.h>
 48 #include <tina/geometry/geomLine_2fit.h>
 49 
 50 
 51 List *pixel_prox(List *start,List *end) /* accepts either edgel or vec2 List */
 52 {
 53     List *dptr=NULL, *dfirst=NULL;
 54     List *lines=NULL;
 55 
 56     if (start==NULL || end==NULL || start==end)
 57         return(NULL);
 58 
 59     dfirst = start;
 60     for (dptr=start->next;dptr!=end;dptr=dptr->next)
 61     {
 62         lines = dd_append(lines,dd_link_alloc(line2_between(dfirst,dptr),LINE2));
 63         dfirst = dptr;
 64     }
 65     return(lines);
 66 }
 67 
 68 
 69 Tstring *pixel_string(Tstring *string)
 70 {
 71     List *pixel=NULL;
 72 
 73     if (string==NULL)
 74         return(NULL);
 75 
 76     pixel = pixel_prox(string->start,string->end);
 77 
 78     if (pixel == NULL)
 79         return (NULL);
 80 
 81     return (str_make(STRING, pixel, dd_get_end(pixel)));
 82 }
 83 
 84 
 85 List *pixel_strings(List *strings)
 86 {
 87     List *sptr=NULL, *splist=NULL;
 88 
 89     for (sptr=strings;sptr!=NULL;sptr=sptr->next)
 90     {
 91         Tstring *string = pixel_string(sptr->to);
 92 
 93         splist = ref_addtostart(splist, string, STRING);
 94     }
 95     return(splist);
 96 }
 97 

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