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

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

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

  1 /**@(#)
  2 **/
  3 #include <math.h>
  4 #include <tina/sys.h>
  5 #include <tina/sysfuncs.h>
  6 #include <tina/math.h>
  7 #include <tina/mathfuncs.h>
  8 #include <tina/vision.h>
  9 
 10 Imrect *imf_aratio(double k, Imrect * im)
 11 {
 12     Imrect *im2;
 13     int     width, height;
 14     double  x, y;
 15 
 16     width = im->width;
 17     height = (int) (k * im->height);
 18 
 19     im2 = im_alloc(height, width, (Imregion *) NULL, float_v);
 20 
 21     for (x = 0.5; x < width; x++)
 22         for (y = 0.5; y < height; y++)
 23         {
 24             double   pixval;
 25 
 26             pixval = im_sub_pixf(im, y / k, x);
 27             im_put_pixf(pixval, im2, tina_int(y), tina_int(x));
 28         }
 29 
 30     return (im2);
 31 }
 32 
 33 Imrect *imf_bratio(double k, Imrect * im)
 34 {
 35     Imrect *im2;
 36     int     width, height;
 37     double  x, y;
 38 
 39     width = (int) (k * im->width);
 40     height = im->height;
 41 
 42     im2 = im_alloc(height, width, (Imregion *) NULL, float_v);
 43 
 44     for (x = 0.5; x < width; x++)
 45         for (y = 0.5; y < height; y++)
 46         {
 47             double   pixval;
 48 
 49             pixval = im_sub_pixf(im, y , x/k );
 50             im_put_pixf(pixval, im2, tina_int(y), tina_int(x));
 51         }
 52 
 53     return (im2);
 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.