Library/ManagedCuda/NPP/NPPTypes.cs
/// <summary>
/// Returns a third Rectangle structure that represents the intersection of two other Rectangle structures.If there is no intersection, an empty Rectangle is returned. 
/// </summary>
/// <param name="rectA"></param>
/// <param name="rectB"></param>
/// <returns></returns>
Returns a third Rectangle structure that represents the intersection of two other Rectangle structures.If there is no intersection, an empty Rectangle is returned.
Returns a third Rectangle structure that represents the intersection of two other Rectangle structures . If there is no intersection an empty Rectangle is returned .
public static NppiRect Intersect(NppiRect rectA, NppiRect rectB)
		{
			int iX = rectA.Left;
			if (iX < rectB.Left)
			{
				iX = rectB.Left;
			}
			int iY = rectA.Top;
			if (iY < rectB.Top)
			{
				iY = rectB.Top;
			}
			int iX2 = rectA.Right;
			if (iX2 > rectB.Right)
			{
				iX2 = rectB.Right;
			}
			int iY2 = rectA.Bottom;
			if (iY2 > rectB.Bottom)
			{
				iY2 = rectB.Bottom;
			}
			int iWidth = iX2 - iX + 1;
			int iHeight = iY2 - iY + 1;
			if (iWidth <=  0 || iHeight <=  0)
			{
				iX = 0;
				iY = 0;
				iWidth = 0;
				iHeight = 0;
			}
			return new NppiRect(iX, iY, iWidth, iHeight);
		}
public static NppiRect Intersect ( NppiRect rectA , NppiRect rectB ) { int iX = rectA . Left ; if ( iX < rectB . Left ) { iX = rectB . Left ; } int iY = rectA . Top ; if ( iY < rectB . Top ) { iY = rectB . Top ; } int iX2 = rectA . Right ; if ( iX2 > rectB . Right ) { iX2 = rectB . Right ; } int iY2 = rectA . Bottom ; if ( iY2 > rectB . Bottom ) { iY2 = rectB . Bottom ; } int iWidth = iX2 - iX + 1 ; int iHeight = iY2 - iY + 1 ; if ( iWidth <= 0 || iHeight <= 0 ) { iX = 0 ; iY = 0 ; iWidth = 0 ; iHeight = 0 ; } return new NppiRect ( iX , iY , iWidth , iHeight ) ; }
Returns a third Rectangle structure that represents the intersection of two other Rectangle structures.If there is no intersection, an empty Rectangle is returned.
Returns a third Rectangle structure that represents the intersection of two other Rectangle structures . If there is no intersection an empty Rectangle is returned .
None
rectA
NppiRect
None
rectB
NppiRect
None