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

Linux Cross Reference
Tina4/src/vision/improc/im_bshift.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 
  8 Imrect *im_bshift(Imrect *im, int y , int x)
  9 {
 10     Imrect *im2;
 11     Imregion *roi;
 12     double pixval;
 13     int lx,ux,ly,uy;
 14     int i,j,newx,newy;
 15 
 16     roi = im->region;
 17     im2 = im_alloc(im->height,im->width,roi,im->vtype);
 18     lx = roi->lx;
 19     ux = roi->ux;
 20     ly = roi->ly;
 21     uy = roi->uy;
 22 
 23     for(i = ly; i < uy; i++)
 24     {
 25         for (j = lx; j < ux;j++)
 26         {
 27             newx = j+x;
 28             if(newx>=ux) newx-=(ux-lx);
 29             if(newx<lx) newx+=(ux-lx);
 30             newy = i+y;
 31             if(newy>=uy) newy-=(uy-ly);
 32             if(newy<ly) newy+=(uy-ly);
 33 
 34             IM_PIX_GET(im,i,j,pixval);
 35             IM_PIX_SET(im2,newy,newx,pixval);
 36         }
 37     }
 38     return(im2);
 39 }
 40 

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