Axiom.Media.Image.FlipAroundX C# (CSharp) Method

FlipAroundX() public method

Flips this image around the X axis. This will invalidate any
public FlipAroundX ( ) : void
return void
		public void FlipAroundX()
		{
			int bytes = PixelUtil.GetNumElemBytes( format );
			int rowSpan = width * bytes;

			byte[] tempBuffer = new byte[ rowSpan * height ];

			int srcOffset = 0, dstOffset = tempBuffer.Length - rowSpan;

			for ( short y = 0; y < height; y++ )
			{
				Array.Copy( buffer, srcOffset, tempBuffer, dstOffset, rowSpan );

				srcOffset += rowSpan;
				dstOffset -= rowSpan;
			}

			Array.Copy( tempBuffer, buffer, tempBuffer.Length );
		}