public CImageBuffer testImageBuffer() { CImageBuffer[] bufs = new CImageBuffer[imgs.Count]; for (int i= 0; i < imgs.Count; ++i) { bufs[i] = CImageConverter.CImageByteToBuffer(imgs[i]); } Debug.WriteLine(Marshal.SizeOf(bufs[0]).ToString()); //setDebugLogFunc(DebugLog); unsafe { fixed (CImageBuffer* p = &bufs[0]) { int state = runImageMerge((IntPtr)p, imgs.Count, out ret); Debug.WriteLine("ret: " + ret.ToString()); } } return ret; }
static public CImageByte CImageBufferToByte(CImageBuffer img) { byte[] bytes = new byte[img.Length]; Marshal.Copy(img.Ptr, bytes, 0, (int)img.Length); return new CImageByte(bytes, img.Width, img.Channel); }
public extern static int runImageMerge(IntPtr bufs, int len, out CImageBuffer ret);