public static GPUImageRawDataInput FromBytes(byte[] bytesToUpload, CGSize imageSize, GPUPixelFormat pixelFormat, GPUPixelType pixelType) { var handle = GCHandle.Alloc(bytesToUpload, GCHandleType.Pinned); var ptr = handle.AddrOfPinnedObject(); var instance = new GPUImageRawDataInput(ptr, imageSize, pixelFormat, pixelType); instance.bytesHandle = handle; return(instance); }
public static GPUImageRawDataInput FromBytes (byte[] bytesToUpload, CGSize imageSize, GPUPixelFormat pixelFormat, GPUPixelType pixelType) { var handle = GCHandle.Alloc (bytesToUpload, GCHandleType.Pinned); var ptr = handle.AddrOfPinnedObject (); var instance = new GPUImageRawDataInput (ptr, imageSize, pixelFormat, pixelType); instance.bytesHandle = handle; return instance; }