mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Visual modes for Vivobooks https://github.com/seerge/g-helper/issues/2342
This commit is contained in:
@@ -47,7 +47,7 @@ namespace GHelper.Display
|
|||||||
info.monitorFriendlyDeviceName == internalName)
|
info.monitorFriendlyDeviceName == internalName)
|
||||||
{
|
{
|
||||||
if (log) Logger.WriteLine(info.monitorFriendlyDeviceName + " HDR: " + colorInfo.advancedColorEnabled + " " + colorInfo.bitsPerColorChannel + " " + colorInfo.value + " " + colorInfo.wideColorEnforced);
|
if (log) Logger.WriteLine(info.monitorFriendlyDeviceName + " HDR: " + colorInfo.advancedColorEnabled + " " + colorInfo.bitsPerColorChannel + " " + colorInfo.value + " " + colorInfo.wideColorEnforced);
|
||||||
return colorInfo.advancedColorEnabled && colorInfo.bitsPerColorChannel > 8;
|
return colorInfo.advancedColorEnabled && (colorInfo.bitsPerColorChannel > 8 || !colorInfo.wideColorEnforced);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,41 +61,39 @@ namespace GHelper.Display
|
|||||||
return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ASUS\\GameVisual";
|
return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ASUS\\GameVisual";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetVivobookPath()
|
||||||
|
{
|
||||||
|
return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ASUS\\ASUS System Control Interface\\ASUSOptimization\\Splendid";
|
||||||
|
}
|
||||||
|
|
||||||
public static Dictionary<SplendidGamut, string> GetGamutModes()
|
public static Dictionary<SplendidGamut, string> GetGamutModes()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (AppConfig.IsVivoZenbook())
|
bool isVivo = AppConfig.IsVivoZenbook();
|
||||||
{
|
|
||||||
return new Dictionary<SplendidGamut, string>
|
|
||||||
{
|
|
||||||
{ SplendidGamut.VivoNative, "Gamut: Native" },
|
|
||||||
{ SplendidGamut.VivoSRGB, "Gamut: sRGB" },
|
|
||||||
{ SplendidGamut.VivoDCIP3, "Gamut: DCIP3" },
|
|
||||||
{ SplendidGamut.ViviDisplayP3, "Gamut: DisplayP3" },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>();
|
Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>();
|
||||||
|
|
||||||
string gameVisualPath = GetGameVisualPath();
|
string iccPath = isVivo ? GetVivobookPath() : GetGameVisualPath();
|
||||||
if (!Directory.Exists(gameVisualPath))
|
|
||||||
|
if (!Directory.Exists(iccPath))
|
||||||
{
|
{
|
||||||
Logger.WriteLine(gameVisualPath + " doesn't exit");
|
Logger.WriteLine(iccPath + " doesn't exit");
|
||||||
return _modes;
|
return _modes;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DirectoryInfo d = new DirectoryInfo(GetGameVisualPath());
|
DirectoryInfo d = new DirectoryInfo(iccPath);
|
||||||
FileInfo[] icms = d.GetFiles("*.icm");
|
FileInfo[] icms = d.GetFiles("*.icm");
|
||||||
if (icms.Length == 0) return _modes;
|
if (icms.Length == 0) return _modes;
|
||||||
|
|
||||||
_modes.Add(SplendidGamut.Native, "Gamut: Native");
|
_modes.Add(isVivo ? SplendidGamut.VivoNative : SplendidGamut.Native, "Gamut: Native");
|
||||||
foreach (FileInfo icm in icms)
|
foreach (FileInfo icm in icms)
|
||||||
{
|
{
|
||||||
if (icm.Name.Contains("sRGB")) _modes.Add(SplendidGamut.sRGB, "Gamut: sRGB");
|
//Logger.WriteLine(icm.FullName);
|
||||||
if (icm.Name.Contains("DCIP3")) _modes.Add(SplendidGamut.DCIP3, "Gamut: DCIP3");
|
if (icm.Name.Contains("sRGB")) _modes.Add(isVivo ? SplendidGamut.VivoSRGB : SplendidGamut.sRGB, "Gamut: sRGB");
|
||||||
if (icm.Name.Contains("DisplayP3")) _modes.Add(SplendidGamut.DisplayP3, "Gamut: DisplayP3");
|
if (icm.Name.Contains("DCIP3")) _modes.Add(isVivo ? SplendidGamut.VivoDCIP3 : SplendidGamut.DCIP3, "Gamut: DCIP3");
|
||||||
|
if (icm.Name.Contains("DisplayP3")) _modes.Add(isVivo ? SplendidGamut.ViviDisplayP3 : SplendidGamut.DisplayP3, "Gamut: DisplayP3");
|
||||||
}
|
}
|
||||||
return _modes;
|
return _modes;
|
||||||
}
|
}
|
||||||
@@ -181,7 +179,24 @@ namespace GHelper.Display
|
|||||||
|
|
||||||
if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin();
|
if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin();
|
||||||
|
|
||||||
int balance = mode == SplendidCommand.Eyecare ? 2 : whiteBalance;
|
int? balance;
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case SplendidCommand.Eyecare:
|
||||||
|
balance = 2;
|
||||||
|
break;
|
||||||
|
case SplendidCommand.VivoNormal:
|
||||||
|
case SplendidCommand.VivoVivid:
|
||||||
|
balance = null;
|
||||||
|
break;
|
||||||
|
case SplendidCommand.VivoEycare:
|
||||||
|
balance = Math.Abs(whiteBalance - 50) * 4 / 50;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
balance = whiteBalance;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (RunSplendid(mode, 0, balance)) return;
|
if (RunSplendid(mode, 0, balance)) return;
|
||||||
|
|
||||||
if (_init)
|
if (_init)
|
||||||
|
|||||||
Reference in New Issue
Block a user