예제 #1
0
        public override void CopyFrom(IImageFloat sourceImage,
                                      RectangleInt sourceImageRect,
                                      int destXOffset,
                                      int destYOffset)
        {
            RectangleInt destRect = sourceImageRect;

            destRect.Offset(destXOffset, destYOffset);

            RectangleInt clippedSourceRect = new RectangleInt();

            if (clippedSourceRect.IntersectRectangles(destRect, m_ClippingRect))
            {
                // move it back relative to the source
                clippedSourceRect.Offset(-destXOffset, -destYOffset);

                base.CopyFrom(sourceImage, clippedSourceRect, destXOffset, destYOffset);
            }
        }
예제 #2
0
        public void CopyFrom(IImageByte sourceImage, RectangleInt sourceImageRect, int destXOffset, int destYOffset)
        {
            RectangleInt sourceImageBounds      = sourceImage.GetBounds();
            RectangleInt clippedSourceImageRect = new RectangleInt();

            if (clippedSourceImageRect.IntersectRectangles(sourceImageRect, sourceImageBounds))
            {
                RectangleInt destImageRect = clippedSourceImageRect;
                destImageRect.Offset(destXOffset, destYOffset);
                RectangleInt destImageBounds      = GetBounds();
                RectangleInt clippedDestImageRect = new RectangleInt();
                if (clippedDestImageRect.IntersectRectangles(destImageRect, destImageBounds))
                {
                    // we need to make sure the source is also clipped to the dest. So, we'll copy this back to source and offset it.
                    clippedSourceImageRect = clippedDestImageRect;
                    clippedSourceImageRect.Offset(-destXOffset, -destYOffset);
                    CopyFromNoClipping(sourceImage, clippedSourceImageRect, destXOffset, destYOffset);
                }
            }
        }
예제 #3
0
		public void CopyFrom(IImageByte sourceImage, RectangleInt sourceImageRect, int destXOffset, int destYOffset)
		{
			RectangleInt sourceImageBounds = sourceImage.GetBounds();
			RectangleInt clippedSourceImageRect = new RectangleInt();
			if (clippedSourceImageRect.IntersectRectangles(sourceImageRect, sourceImageBounds))
			{
				RectangleInt destImageRect = clippedSourceImageRect;
				destImageRect.Offset(destXOffset, destYOffset);
				RectangleInt destImageBounds = GetBounds();
				RectangleInt clippedDestImageRect = new RectangleInt();
				if (clippedDestImageRect.IntersectRectangles(destImageRect, destImageBounds))
				{
					// we need to make sure the source is also clipped to the dest. So, we'll copy this back to source and offset it.
					clippedSourceImageRect = clippedDestImageRect;
					clippedSourceImageRect.Offset(-destXOffset, -destYOffset);
					CopyFromNoClipping(sourceImage, clippedSourceImageRect, destXOffset, destYOffset);
				}
			}
		}
예제 #4
0
		public override void CopyFrom(IImageFloat sourceImage,
					   RectangleInt sourceImageRect,
					   int destXOffset,
					   int destYOffset)
		{
			RectangleInt destRect = sourceImageRect;
			destRect.Offset(destXOffset, destYOffset);

			RectangleInt clippedSourceRect = new RectangleInt();
			if (clippedSourceRect.IntersectRectangles(destRect, m_ClippingRect))
			{
				// move it back relative to the source
				clippedSourceRect.Offset(-destXOffset, -destYOffset);

				base.CopyFrom(sourceImage, clippedSourceRect, destXOffset, destYOffset);
			}
		}