mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
Decided to rename the application to DisplayMagician to make it way more discoverable. Turns out there are a LOT of applications named HeliosPlus!
96 lines
2.2 KiB
C#
96 lines
2.2 KiB
C#
using NvAPIWrapper.Native.Display;
|
|
using NvAPIWrapper.Native.Mosaic;
|
|
|
|
namespace DisplayMagician.Shared.NVIDIA
|
|
{
|
|
internal static class SurroundHelper
|
|
{
|
|
public static PixelShift ToPixelShift(this PixelShiftType pixelShift)
|
|
{
|
|
switch (pixelShift)
|
|
{
|
|
case PixelShiftType.TopLeft2X2Pixels:
|
|
|
|
return PixelShift.TopLeft2X2Pixels;
|
|
|
|
case PixelShiftType.BottomRight2X2Pixels:
|
|
|
|
return PixelShift.BottomRight2X2Pixels;
|
|
|
|
default:
|
|
|
|
return PixelShift.NoPixelShift;
|
|
}
|
|
}
|
|
|
|
public static PixelShiftType ToPixelShiftType(this PixelShift pixelShift)
|
|
{
|
|
switch (pixelShift)
|
|
{
|
|
case PixelShift.TopLeft2X2Pixels:
|
|
|
|
return PixelShiftType.TopLeft2X2Pixels;
|
|
|
|
case PixelShift.BottomRight2X2Pixels:
|
|
|
|
return PixelShiftType.BottomRight2X2Pixels;
|
|
|
|
default:
|
|
|
|
return PixelShiftType.NoPixelShift;
|
|
}
|
|
}
|
|
|
|
public static Rotate ToRotate(this Rotation rotation)
|
|
{
|
|
switch (rotation)
|
|
{
|
|
case Rotation.Identity:
|
|
|
|
return Rotate.Degree0;
|
|
|
|
case Rotation.Rotate90:
|
|
|
|
return Rotate.Degree90;
|
|
|
|
case Rotation.Rotate180:
|
|
|
|
return Rotate.Degree180;
|
|
|
|
case Rotation.Rotate270:
|
|
|
|
return Rotate.Degree270;
|
|
|
|
default:
|
|
|
|
return Rotate.Ignored;
|
|
}
|
|
}
|
|
|
|
public static Rotation ToRotation(this Rotate rotation)
|
|
{
|
|
switch (rotation)
|
|
{
|
|
case Rotate.Degree0:
|
|
|
|
return Rotation.Identity;
|
|
|
|
case Rotate.Degree90:
|
|
|
|
return Rotation.Rotate90;
|
|
|
|
case Rotate.Degree180:
|
|
|
|
return Rotation.Rotate180;
|
|
|
|
case Rotate.Degree270:
|
|
|
|
return Rotation.Rotate270;
|
|
|
|
default:
|
|
|
|
return Rotation.Unknown;
|
|
}
|
|
}
|
|
}
|
|
} |