/// <summary> /// Clone the current profile and change the type, index and format to input parameters /// </summary> /// <param name="type">will change the stream type from the cloned profile.</param> /// <param name="index">will change the stream index from the cloned profile.</param> /// <param name="format">will change the stream format from the cloned profile.</param> /// <returns>the cloned stream profile.</returns> public StreamProfile Clone(Stream type, int index, Format format) { object error; var ptr = NativeMethods.rs2_clone_stream_profile(Handle, type, index, format, out error); var p = StreamProfile.Create(ptr); p.clone = new DeleterHandle(ptr, StreamProfileReleaser); return(p); }