2017-02-26 19:23:31 +00:00
|
|
|
|
using NvAPIWrapper.Native.Display;
|
2018-10-20 00:19:30 +00:00
|
|
|
|
using NvAPIWrapper.Native.Mosaic;
|
2017-02-26 19:23:31 +00:00
|
|
|
|
|
2020-12-02 08:11:23 +00:00
|
|
|
|
namespace DisplayMagician.Shared.NVIDIA
|
2017-02-26 19:23:31 +00:00
|
|
|
|
{
|
|
|
|
|
internal static class SurroundHelper
|
|
|
|
|
{
|
2018-10-20 00:27:25 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
public static Rotate ToRotate(this Rotation rotation)
|
|
|
|
|
{
|
|
|
|
|
switch (rotation)
|
|
|
|
|
{
|
|
|
|
|
case Rotation.Identity:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
return Rotate.Degree0;
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
case Rotation.Rotate90:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
return Rotate.Degree90;
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
case Rotation.Rotate180:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
return Rotate.Degree180;
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
case Rotation.Rotate270:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
return Rotate.Degree270;
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
default:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
return Rotate.Ignored;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Rotation ToRotation(this Rotate rotation)
|
|
|
|
|
{
|
|
|
|
|
switch (rotation)
|
|
|
|
|
{
|
|
|
|
|
case Rotate.Degree0:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
return Rotation.Identity;
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
case Rotate.Degree90:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
return Rotation.Rotate90;
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
case Rotate.Degree180:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
return Rotation.Rotate180;
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
case Rotate.Degree270:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
2017-02-26 19:23:31 +00:00
|
|
|
|
return Rotation.Rotate270;
|
2018-10-20 00:19:30 +00:00
|
|
|
|
|
|
|
|
|
default:
|
2018-10-20 00:27:25 +00:00
|
|
|
|
|
|
|
|
|
return Rotation.Unknown;
|
2018-10-20 00:19:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-02-26 19:23:31 +00:00
|
|
|
|
}
|
|
|
|
|
}
|