public ImageBufferNativeGCHandleSinglePlane(ImageBufferNativePool <ImageBufferNativeGCHandleSinglePlane> pool, ImageBufferInfo info) : base(info) { if (info.Stride.Length != 1) { throw new Exception("ImageBufferNativeGCHandleSinglePlane wrong plane count " + info.Stride.Length); } this.pool = pool; Planes = new IntPtr[1]; }
public ImageBufferNativeAlloc(ImageBufferNativePool <ImageBufferNativeAlloc> pool, ImageBufferInfo info) : base(info) { this.pool = pool; Planes = new IntPtr[info.Stride.Length]; for (int i = 0; i < info.Stride.Length; i++) { Planes[i] = System.Runtime.InteropServices.Marshal.AllocHGlobal(info.Stride[i] * info.Height); } }