Logo Search packages:      
Sourcecode: djvulibre version File versions

void GRectMapper::rotate ( int  count = 1  ) 

Composes the affine transform with a rotation of count# quarter turns counter-clockwise. This operation essentially is a modification of the match between the corners of the input rectangle and the corners of the output rectangle.

Definition at line 334 of file GRect.cpp.

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

Referenced by DjVuImage::get_decoded_anno(), DjVuImage::map(), and DjVuImage::unmap().

{
  int oldcode = code;
  switch (count & 0x3)
    {
    case 1:
      code ^= (code & SWAPXY) ? MIRRORY : MIRRORX;
      code ^= SWAPXY;
      break;
    case 2:
      code ^= (MIRRORX|MIRRORY);
      break;
    case 3:
      code ^= (code & SWAPXY) ? MIRRORX : MIRRORY;
      code ^= SWAPXY;
      break;
    }
  if ((oldcode ^ code) & SWAPXY)
    { 
      iswap(rectFrom.xmin, rectFrom.ymin);
      iswap(rectFrom.xmax, rectFrom.ymax);
      rw = rh = GRatio();
    }
}


Generated by  Doxygen 1.6.0   Back to index