/// <inheritdoc /> public void Refresh(Rectangle rectangle, WaveformMode mode, DisplayTemp displayTemp, UpdateMode updateMode) { Framebuffer.ConstrainRectangle(ref rectangle); var data = new FbUpdateData { UpdateRegion = new FbRect { X = (uint)rectangle.X, Y = (uint)rectangle.Y, Width = (uint)rectangle.Width, Height = (uint)rectangle.Height }, WaveformMode = mode, DisplayTemp = displayTemp, UpdateMode = updateMode, UpdateMarker = _updateMarker, DitherMode = 0, QuantBit = 0, Flags = 0 }; var retCode = DisplayIoctl.Ioctl(_handle, IoctlDisplayCommand.SendUpdate, ref data); if (retCode == -1) { throw new UnixException(); } _updateMarker = (uint)retCode; }
public RefreshTask(Rectangle region, WaveformMode mode, DisplayTemp displayTemp, UpdateMode updateMode) { EmulatedDevices.Display.Framebuffer.ConstrainRectangle(ref region); Region = region; Mode = mode; DisplayTemp = displayTemp; UpdateMode = updateMode; }
public void Draw(Image <Rgb24> image, Rectangle srcArea, Point destPoint, Rectangle refreshArea = default, WaveformMode waveformMode = WaveformMode.Auto, DisplayTemp displayTemp = DisplayTemp.Papyrus, UpdateMode updateMode = UpdateMode.Partial) { Framebuffer.Write(image, srcArea, destPoint); if (refreshArea == default) { refreshArea.Location = destPoint; refreshArea.Size = srcArea.Size; } Refresh(refreshArea, waveformMode, displayTemp, updateMode); }
public Task IdentifyAsync() { // currently hardcoded for testing, but just to verify the RGB -> HSL converter works // properly we'll use it to identify the lights rather than hardcoding the HSL value directly. var rgbColor = ColorTranslator.FromHtml("#a7f442"); var convertedRgbValue = new ColorRGB(rgbColor.R / RGBModifier, rgbColor.G / RGBModifier, rgbColor.B / RGBModifier); var hslConversion = new ColorHSV(convertedRgbValue); var displayTemp = new DisplayTemp { duration = 3, animType = "random", palette = new[] { new Palette(hslConversion.H, hslConversion.S, hslConversion.V) } }; return(this.NanoleafProtocol.WriteDisplayCommandAsync(this.AccessToken, displayTemp)); }
public void Refresh(Rectangle rectangle, WaveformMode mode, DisplayTemp displayTemp, UpdateMode updateMode) { _emulatorWindow.RefreshRegion(rectangle, mode, displayTemp, updateMode); }
public void RefreshRegion(Rectangle region, WaveformMode mode, DisplayTemp displayTemp, UpdateMode updateMode) { _refreshQueue.Enqueue(new RefreshTask(region, mode, displayTemp, updateMode)); }