/// <summary> /// Creates a new <see cref="HardwareDisplayDriver" /> /// </summary> /// <param name="devicePath">The device handle location</param> public HardwareDisplayDriver(string devicePath) { DevicePath = devicePath; _handle = NativeUnixStreamMethods.Open(DevicePath, 0, UnixFileMode.WriteOnly); var vinfo = GetVarScreenInfo(); VisibleWidth = (int)vinfo.VisibleResolutionX; VisibleHeight = (int)vinfo.VisibleResolutionY; VirtualWidth = (int)vinfo.VirtualResolutionX; VirtualHeight = (int)vinfo.VirtualResolutionY; Framebuffer = new HardwareFramebuffer(devicePath, VisibleWidth, VisibleHeight, VirtualWidth, VirtualHeight); vinfo.AccelFlags = 0x01; vinfo.Width = 0xFFFFFFFF; vinfo.Height = 0xFFFFFFFF; vinfo.Rotate = 1; vinfo.PixClock = 160000000; vinfo.VisibleResolutionX = 1872; vinfo.VisibleResolutionY = 1404; vinfo.LeftMargin = 32; vinfo.RightMargin = 326; vinfo.UpperMargin = 4; vinfo.LowerMargin = 12; vinfo.HSyncLen = 44; vinfo.VSyncLen = 1; vinfo.Sync = FbSync.None; vinfo.VMode = FbVMode.NonInterlaced; vinfo.BitsPerPixel = sizeof(short) * 8; PutVarScreenInfo(vinfo); }
/// <summary> /// Creates a new <see cref="Rgb565FramebufferDecoder" /> /// </summary> /// <param name="framebuffer">The hardware framebuffer to read data from</param> /// <param name="area">The rectangular area to read from the framebuffer</param> public Rgb565FramebufferDecoder(HardwareFramebuffer framebuffer, Rectangle area) { _framebuffer = framebuffer; _area = area; }
/// <summary> /// Creates a new <see cref="Rgb565FramebufferEncoder" /> /// </summary> /// <param name="framebuffer">The hardware framebuffer to write data to</param> /// <param name="srcArea">The area of the source image to encode</param> /// <param name="destPoint">The location to place the top-leftmost corner of the source area on the destination framebuffer</param> public Rgb565FramebufferEncoder(HardwareFramebuffer framebuffer, Rectangle srcArea, Point destPoint) { _framebuffer = framebuffer; _srcArea = srcArea; _destPoint = destPoint; }