Ejemplo n.º 1
0
        public bool ApplyPreset(AmdPreset preset, Config config)
        {
            SetCurrentDisplay(preset);

            if (preset.applyHDR)
            {
                if (preset.toggleHDR || preset.HDREnabled != IsHDREnabled())
                {
                    ToggleHDR(config.DisplaySettingsDelay);
                }
            }

            if (preset.applyRefreshRate)
            {
                SetRefreshRate(preset.refreshRate);
            }

            if (preset.applyColorData)
            {
                var display = GetCurrentDisplay();
                // TODO: ADL call to set color format, depth, space
                // ADL_Display_PixelFormat_Set
                // ADL_Display_ColorDepth_Set

                //var data = new ColorData(ColorDataFormat.YUV444, ColorDataColorimetry.YCC709, ColorDataDynamicRange.Auto, ColorDataDepth.BPC8, preset.colorData.SelectionPolicy, ColorDataDesktopDepth.Default);
                //display.DisplayDevice.SetColorData(preset.colorData);
            }

            if (preset.applyDithering)
            {
                SetDithering(preset.ditheringEnabled);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public List <uint> GetAvailableRefreshRates(AmdPreset preset = null)
        {
            if (preset != null)
            {
                SetCurrentDisplay(preset);
            }

            var portrait   = false;
            var horizontal = 3840;
            var vertical   = 2160;
            var display    = GetCurrentDisplay();

            //ADLWrapper.GetDisplayResolution(display, ref horizontal, ref vertical);

            return(GetAvailableRefreshRatesInternal(display, portrait, horizontal, vertical));
        }
Ejemplo n.º 3
0
        public AmdPreset(AmdPreset preset) : this()
        {
            id = GetNewId();

            primaryDisplay = preset.primaryDisplay;
            displayName    = preset.displayName;

            var colorData = preset.colorData;

            this.colorData = new ColorData(colorData.ColorFormat, dynamicRange: colorData.DynamicRange, colorDepth: colorData.ColorDepth, colorSelectionPolicy: colorData.SelectionPolicy);
            applyColorData = preset.applyColorData;

            applyHDR         = preset.applyHDR;
            HDREnabled       = preset.HDREnabled;
            toggleHDR        = preset.toggleHDR;
            applyDithering   = preset.applyDithering;
            ditheringEnabled = preset.ditheringEnabled;
            applyRefreshRate = preset.applyRefreshRate;
            refreshRate      = preset.refreshRate;
        }
Ejemplo n.º 4
0
        public AmdPreset Clone()
        {
            var preset = new AmdPreset(this);

            return(preset);
        }
Ejemplo n.º 5
0
 public void SetCurrentDisplay(AmdPreset preset)
 {
     CurrentDisplay = preset.displayName;
 }