Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

void GRectMapper::unmap ( int &  x,
int &  y 

Maps a point according to the inverse of the affine transform. Variables x# and y# initially contain the coordinates of a point. This operation overwrites these variables with the coordinates of a second point located in the same position relative to the corners of input rectangle as the first point relative to the matching corners of the input rectangle. Coordinates are rounded to the nearest integer.

Definition at line 401 of file GRect.cpp.

References GRect::xmax, GRect::xmin, GRect::ymax, and GRect::ymin.

Referenced by unmap(), GMapOval::unmap(), GMapPoly::unmap(), GMapRect::unmap(), and DjVuImage::unmap().

  // precalc 
  if (! (rw.p && rh.p))
  // scale and translate
  int mx = rectFrom.xmin + (x - rectTo.xmin) / rw;
  int my = rectFrom.ymin + (y - rectTo.ymin) / rh;
  //  mirror and swap
  if (code & MIRRORX)
    mx = rectFrom.xmin + rectFrom.xmax - mx;
  if (code & MIRRORY)
    my = rectFrom.ymin + rectFrom.ymax - my;
  if (code & SWAPXY)
  x = mx;
  y = my;

Generated by  Doxygen 1.6.0   Back to index