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

Linux Cross Reference
Tina6/tina-libs/tina/geometry/geomIndx_rindex.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/geomIndx_rindex.c,v $
 27  * Date    :  $Date: 2005/01/23 19:10:21 $
 28  * Version :  $Revision: 1.2 $
 29  * CVS Id  :  $Id: geomIndx_rindex.c,v 1.2 2005/01/23 19:10:21 paul Exp $
 30  *
 31  * Notes :  functions to suport raster based indexing schemes
 32  *
 33  *********
 34 */
 35 
 36 
 37 #include "geomIndx_rindex.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/math/mathDef.h>
 47 #include <tina/math/mathPro.h>
 48 #include <tina/image/imgDef.h>
 49 #include <tina/image/imgPro.h>
 50 #include <tina/geometry/geom_IndxDef.h>
 51 
 52 
 53 Rindex *rx_alloc(Imregion * region, int type)
 54 {
 55     Rindex *r;
 56 
 57     if (region == NULL)
 58         return (NULL);
 59 
 60     r = ts_ralloc(Rindex);
 61 
 62     r->index = (void **) pvector_alloc(region->ly, region->uy);
 63     r->type = type;
 64     r->region = roi_copy(region);
 65 
 66     return (r);
 67 }
 68 
 69 void    rx_free_links(Rindex * r)
 70 {
 71     int     ly, uy, i;
 72     void  **index;
 73     void    list_rm_links();
 74 
 75     if (r == NULL)
 76         return;
 77 
 78     ly = r->region->ly;
 79     uy = r->region->uy;
 80     index = r->index;
 81 
 82     for (i = ly; i < uy; ++i)
 83         list_rm_links((List *) index[i]);
 84 
 85     pvector_free(index, ly);
 86     rfree((void *) r);
 87 }
 88 
 89 void    rx_free(Rindex * r, void (*freefunc) ( /* ??? */ ))
 90 {
 91     int     ly, uy, i;
 92     void  **index;
 93 
 94     if (r == NULL)
 95         return;
 96 
 97     ly = r->region->ly;
 98     uy = r->region->uy;
 99     index = r->index;
100 
101     for (i = ly; i < uy; ++i)
102         list_rm((List *) index[i], freefunc);
103 
104     pvector_free(index, ly);
105     rfree((void *) r);
106 }
107 

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