using System.Runtime.InteropServices; namespace NvAPIWrapper.Native.General.Structures { /// /// Represents a rectangle coordinates /// [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct Rectangle { internal int _X; internal int _Y; internal int _Width; internal int _Height; /// /// Creates a new instance of /// /// The horizontal location value. /// The vertical location value. /// The width of the rectangle. /// The height of the rectangle. // ReSharper disable once TooManyDependencies public Rectangle(int x, int y, int width, int height) { _X = x; _Y = y; _Width = width; _Height = height; } /// /// Gets the horizontal location value /// public int X { get => _X; } /// /// Gets the vertical location value /// public int Y { get => _Y; } /// /// Gets the rectangle width value /// public int Width { get => _Width; } /// /// Gets the rectangle height value /// public int Height { get => _Height; } /// /// Gets the horizontal left edge value /// public int X2 { get => X + Width; } /// /// Gets the vertical bottom edge value /// public int Y2 { get => Y + Height; } } }