public static GammaRamp GetGammaRamp(MonitorPtr monitor) { GammaRampInternal rampI; glfwGetGammaRamp(monitor, out rampI); uint length = rampI.Length; GammaRamp ramp = new GammaRamp(length); for (int i = 0; i < ramp.Red.Length; ++i) { int offset = i * sizeof(ushort); ramp.Red[i] = Marshal.PtrToStructure <short>(rampI.Red + offset); ramp.Green[i] = Marshal.PtrToStructure <short>(rampI.Green + offset); ramp.Blue[i] = Marshal.PtrToStructure <short>(rampI.Blue + offset); } return(ramp); }
internal static extern void glfwSetGammaRamp(MonitorPtr monitor, ref GammaRamp ramp);
public static GammaRamp GetGammaRamp(MonitorPtr monitor) { GammaRampInternal rampI; glfwGetGammaRamp(monitor, out rampI); uint length = rampI.Length; GammaRamp ramp = new GammaRamp(length); for (int i = 0; i < ramp.Red.Length; ++i) { int offset = i * sizeof(ushort); ramp.Red[i] = Marshal.PtrToStructure<short>(rampI.Red + offset); ramp.Green[i] = Marshal.PtrToStructure<short>(rampI.Green + offset); ramp.Blue[i] = Marshal.PtrToStructure<short>(rampI.Blue + offset); } return ramp; }
public static void SetGammaRamp(MonitorPtr monitor, ref GammaRamp ramp) { ramp.Length = (uint)ramp.Red.Length; glfwSetGammaRamp(monitor, ref ramp); }
internal static extern void glfwSetGammaRamp(MonitorPtr monitor, ref GammaRamp ramp);
public static void SetGammaRamp(MonitorPtr monitor, ref GammaRamp ramp) { ramp.Length = (uint)ramp.Red.Length; glfwSetGammaRamp(monitor, ref ramp); }