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

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

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

  1 #include <math.h>
  2 #include <tina/sys.h>
  3 #include <tina/sysfuncs.h>
  4 #include <tina/math.h>
  5 #include <tina/mathfuncs.h>
  6 #include <tina/vision.h>
  7 #include <tina/visionfuncs.h>
  8 
  9 Imrect *imz_cmplx(Imrect * im1, Imrect * im2)
 10 {
 11     Imrect *im3;
 12     Imregion *roi;
 13     float *row1;
 14     float *row2;
 15     Complex *row3;
 16     int     lx, ux, ly, uy;
 17     int     width, height;
 18     int     i, j;
 19  
 20     if (im1 == NULL || im2 == NULL)
 21         return (NULL);
 22  
 23     roi = roi_inter(im1->region, im2->region);
 24     if (roi == NULL)
 25         return (NULL);
 26     lx = roi->lx;
 27     ux = roi->ux;
 28     ly = roi->ly;
 29     uy = roi->uy;
 30  
 31     width = MIN(im1->width, im2->width);
 32     height = MIN(im1->height, im2->height);
 33  
 34     im3 = im_alloc(height, width, roi, complex_v);
 35     row1 = fvector_alloc(lx, ux);
 36     row2 = fvector_alloc(lx, ux);
 37     row3 = zvector_alloc(lx, ux);
 38  
 39     for (i = ly; i < uy; ++i)
 40     {
 41         im_get_rowf(row1, im1, i, lx, ux);
 42         im_get_rowf(row2, im2, i, lx, ux);
 43         for (j = lx; j < ux; ++j)
 44             row3[j] = cmplx((double)row1[j], (double)row2[j]);
 45         im_put_rowz(row3, im3, i, lx, ux);
 46     }
 47  
 48     fvector_free((void *) row1, lx);
 49     fvector_free((void *) row2, lx);
 50     zvector_free((void *) row3, lx);
 51     rfree((void *) roi);
 52     return (im3);
 53 }
 54 
 55 

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