Exemplo n.º 1
0
        public void Rgb2YCbCr()
        {
            Pixel3B[] buffer  = new Pixel3B[1920 * 1080];
            GCHandle  hBuffer = GCHandle.Alloc(buffer, GCHandleType.Pinned);
            IntPtr    pBuffer = hBuffer.AddrOfPinnedObject();

            GenerateRandomBuffer(pBuffer, buffer.Length * Marshal.SizeOf <Pixel3B>());

            IntPtr result = ColorSpace.Rgb2YCbCr(pBuffer, PixelFormat.BGR24);

            if (hBuffer.IsAllocated)
            {
                hBuffer.Free();
            }
        }