internal void Paint(System.Drawing.Graphics canvas) { if (!started && !debug) { return; } if (bitmap == null) { return; } var data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.WriteOnly, bitmap.PixelFormat); try { switch (gr_format) { case DRV_GRAPHICS_FORMAT.YCBCR422: PeachCam.ARGB8888FromYCBCR422(data.Scan0, framebuff, data.Width, data.Height); break; case DRV_GRAPHICS_FORMAT.ARGB4444: PeachCam.ARGB8888FromARGB4444(data.Scan0, framebuff, data.Width, data.Height); break; case DRV_GRAPHICS_FORMAT.ARGB8888: Marshal.Copy(new IntPtr[] { framebuff }, 0, data.Scan0, 4 * data.Width * data.Height); break; } } finally { bitmap.UnlockBits(data); } canvas.DrawImage(bitmap, 0, 0); }
public TestBench(IStdio stdio) { this.stdio = stdio; PeachCam = new PeachCam(); fthandle = PeachCam.OpenMpsse(0); PeachCam.SetTestBench(this); }
internal bool Capture(IntPtr framebuff, int width, int height) { return(PeachCam.VideoCapture_Capture(_ptr, framebuff, width, height)); }
public void Release() { PeachCam.videoio_VideoCapture_release(_ptr); }
public bool Open(int index) { return(PeachCam.videoio_VideoCapture_open2(_ptr, index)); }
public void Dispose() { PeachCam.videoio_VideoCapture_delete(_ptr); }
public VideoCapture() { _ptr = PeachCam.videoio_VideoCapture_new1(); }