コード例 #1
0
PerspectiveTransform PerspectiveTransform::QuadrilateralToSquare(Point2i a, Point2i b,
                                                                 Point2i c, Point2i d)
{
   PerspectiveTransform p = SquareToQuadrilateral(a, b, c, d);

   return p.BuildAdjoint();
}
コード例 #2
0
CBC_CommonPerspectiveTransform*
CBC_CommonPerspectiveTransform::QuadrilateralToSquare(FX_FLOAT x0,
                                                      FX_FLOAT y0,
                                                      FX_FLOAT x1,
                                                      FX_FLOAT y1,
                                                      FX_FLOAT x2,
                                                      FX_FLOAT y2,
                                                      FX_FLOAT x3,
                                                      FX_FLOAT y3) {
  std::unique_ptr<CBC_CommonPerspectiveTransform> temp1(
      SquareToQuadrilateral(x0, y0, x1, y1, x2, y2, x3, y3));
  return temp1->BuildAdjoint();
}
コード例 #3
0
CBC_CommonPerspectiveTransform*
CBC_CommonPerspectiveTransform::QuadrilateralToQuadrilateral(FX_FLOAT x0,
                                                             FX_FLOAT y0,
                                                             FX_FLOAT x1,
                                                             FX_FLOAT y1,
                                                             FX_FLOAT x2,
                                                             FX_FLOAT y2,
                                                             FX_FLOAT x3,
                                                             FX_FLOAT y3,
                                                             FX_FLOAT x0p,
                                                             FX_FLOAT y0p,
                                                             FX_FLOAT x1p,
                                                             FX_FLOAT y1p,
                                                             FX_FLOAT x2p,
                                                             FX_FLOAT y2p,
                                                             FX_FLOAT x3p,
                                                             FX_FLOAT y3p) {
  std::unique_ptr<CBC_CommonPerspectiveTransform> qToS(
      QuadrilateralToSquare(x0, y0, x1, y1, x2, y2, x3, y3));
  std::unique_ptr<CBC_CommonPerspectiveTransform> sToQ(
      SquareToQuadrilateral(x0p, y0p, x1p, y1p, x2p, y2p, x3p, y3p));
  return sToQ->Times(*(qToS.get()));
}