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

Linux Cross Reference
Tina4/src/vision/improc/im_filter.c

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

  1 /**@(#)
  2 **/
  3 /* filter_1d.c
  4  * 
  5  * one dimensional generic filtering functions
  6  * 
  7  * functions convert to floating point images
  8  * 
  9  */
 10 
 11 #include <math.h>
 12 #include <tina/sys.h>
 13 #include <tina/sysfuncs.h>
 14 #include <tina/math.h>
 15 #include <tina/vision.h>
 16 
 17 Imrect *im_filter_rows(Imrect * image, void (*func) ( /* ??? */ ), void *data)
 18 /* image to be filtered */
 19 
 20 
 21 {
 22     Imrect *filtered_im;
 23     float  *line;
 24     int     lx, ux, ly, uy;
 25     int     i;
 26 
 27     if (image == NULL)
 28         return (NULL);
 29 
 30     lx = image->region->lx;
 31     ux = image->region->ux;
 32     ly = image->region->ly;
 33     uy = image->region->uy;
 34 
 35     filtered_im = im_alloc(image->height, image->width, image->region, float_v);
 36     line = fvector_alloc(lx, ux);
 37 
 38     for (i = ly; i < uy; ++i)
 39     {
 40         im_get_rowf(line, image, i, lx, ux);
 41         func(line, lx, ux, data);
 42         im_put_rowf(line, filtered_im, i, lx, ux);
 43     }
 44 
 45     fvector_free((void *) line, lx);
 46     return (filtered_im);
 47 }
 48 
 49 Imrect *im_filter_cols(Imrect * image, void (*func) ( /* ??? */ ), void *data)
 50 /* image to be filtered */
 51 
 52 
 53 {
 54     Imrect *filtered_im;
 55     float  *line;
 56     int     lx, ux, ly, uy;
 57     int     i;
 58 
 59     if (image == NULL)
 60         return (NULL);
 61 
 62     lx = image->region->lx;
 63     ux = image->region->ux;
 64     ly = image->region->ly;
 65     uy = image->region->uy;
 66 
 67     filtered_im = im_alloc(image->height, image->width, image->region, float_v);
 68     line = fvector_alloc(ly, uy);
 69 
 70     for (i = lx; i < ux; ++i)
 71     {
 72         im_get_colf(line, image, i, ly, uy);
 73         func(line, ly, uy, data);
 74         im_put_colf(line, filtered_im, i, ly, uy);
 75     }
 76 
 77     fvector_free((void *) line, ly);
 78     return (filtered_im);
 79 }
 80 

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