Пример #1
0
        /// <summary>
        /// Transform a point from one rectangle onto another using this class's warp matrix.
        /// </summary>
        /// <param name="srcX">Source point, X coordinate.</param>
        /// <param name="srcY">Source point, Y coordinate.</param>
        /// <param name="dstX">Destination point, X coordinate.</param>
        /// <param name="dstY">Destination point, Y coordinate.</param>
        public void Transform(double srcX, double srcY, ref double dstX, ref double dstY)
        {
            // If our matrix is out of date, recompute it.
            if (bDirty)
            {
                ComputeWarp();
            }

            // Compute the coordinate transform.
            Warper.warp(warpMat, srcX, srcY, ref dstX, ref dstY);
        }
Пример #2
0
        /// <summary>
        /// Transform a point from one rectangle onto another using this class's warp matrix.
        /// </summary>
        /// <param name="pSrc">Source point.</param>
        /// <returns>Destination point.</returns>
        public Point Transform(Point pSrc)
        {
            // If our matrix is out of date, recompute it.
            if (bDirty)
            {
                ComputeWarp();
            }

            // Compute the coordinate transform.
            double dstX = 0, dstY = 0;

            Warper.warp(warpMat, pSrc.X, pSrc.Y, ref dstX, ref dstY);
            return(new Point(dstX, dstY));
        }