Exemple #1
0
        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);
        }
Exemple #2
0
        public TestBench(IStdio stdio)
        {
            this.stdio = stdio;

            PeachCam = new PeachCam();

            fthandle = PeachCam.OpenMpsse(0);
            PeachCam.SetTestBench(this);
        }
Exemple #3
0
 internal bool Capture(IntPtr framebuff, int width, int height)
 {
     return(PeachCam.VideoCapture_Capture(_ptr, framebuff, width, height));
 }
Exemple #4
0
 public void Release()
 {
     PeachCam.videoio_VideoCapture_release(_ptr);
 }
Exemple #5
0
 public bool Open(int index)
 {
     return(PeachCam.videoio_VideoCapture_open2(_ptr, index));
 }
Exemple #6
0
 public void Dispose()
 {
     PeachCam.videoio_VideoCapture_delete(_ptr);
 }
Exemple #7
0
 public VideoCapture()
 {
     _ptr = PeachCam.videoio_VideoCapture_new1();
 }