Gamma Init

This commit is contained in:
Serge
2024-02-16 15:55:37 +01:00
parent 42a598f177
commit cf84fa0616
103 changed files with 7907 additions and 41 deletions

View File

@@ -0,0 +1,52 @@
using System;
using System.Runtime.InteropServices;
namespace WindowsDisplayAPI.Native.DisplayConfig.Structures
{
// https://msdn.microsoft.com/en-us/library/windows/hardware/ff553913(v=vs.85).aspx
[StructLayout(LayoutKind.Sequential)]
internal struct DisplayConfig2DRegion : IEquatable<DisplayConfig2DRegion>
{
[MarshalAs(UnmanagedType.U4)] public readonly uint Width;
[MarshalAs(UnmanagedType.U4)] public readonly uint Height;
public DisplayConfig2DRegion(uint width, uint height)
{
Width = width;
Height = height;
}
public bool Equals(DisplayConfig2DRegion other)
{
return Width == other.Width && Height == other.Height;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj))
{
return false;
}
return obj is DisplayConfig2DRegion region && Equals(region);
}
public override int GetHashCode()
{
unchecked
{
return ((int) Width * 397) ^ (int) Height;
}
}
public static bool operator ==(DisplayConfig2DRegion left, DisplayConfig2DRegion right)
{
return Equals(left, right) || left.Equals(right);
}
public static bool operator !=(DisplayConfig2DRegion left, DisplayConfig2DRegion right)
{
return !(left == right);
}
}
}