예제 #1
0
 /// <summary>
 ///     Creates an instance of <see cref="HDRColorData" />.
 /// </summary>
 /// <param name="hdrMode">The hdr mode.</param>
 /// <param name="masteringDisplayData">The display color space configurations.</param>
 /// <param name="colorFormat">The color data color format.</param>
 /// <param name="dynamicRange">The color data dynamic range.</param>
 /// <param name="colorDepth">The color data color depth.</param>
 public HDRColorData(
     ColorDataHDRMode hdrMode,
     MasteringDisplayColorData masteringDisplayData,
     ColorDataFormat?colorFormat        = null,
     ColorDataDynamicRange?dynamicRange = null,
     ColorDataDepth?colorDepth          = null
     )
 {
     HDRMode = hdrMode;
     MasteringDisplayData = masteringDisplayData;
     ColorFormat          = colorFormat;
     DynamicRange         = dynamicRange;
     ColorDepth           = colorDepth;
 }
예제 #2
0
        private void SetHDRState(Display display, bool enabled, ColorData colorData = null)
        {
            var newMaster = new MasteringDisplayColorData();
            var hdr       = new HDRColorData(enabled ? ColorDataHDRMode.UHDA : ColorDataHDRMode.Off, newMaster, colorData?.ColorFormat, colorData?.DynamicRange, colorData?.ColorDepth);

            display.DisplayDevice.SetHDRColorData(hdr);

            // HDR will not always be disabled this way, then we can only disable it through the display settings
            if (!enabled && IsHDREnabled())
            {
                ToggleHDR();
            }
            else if (enabled)
            {
                // Currectly there seems to be a bug that after enabling HDR via NVAPI, some settings are only applied upon opening the Display Settings...
                ////OpenDisplaySettings();
            }
        }