public RealSenseGenerator(Microsoft.Psi.Pipeline msPipe) : base(msPipe) { this.msPipe = msPipe; OutDepthImage = msPipe.CreateEmitter <Shared <DepthImage> >(this, nameof(OutDepthImage)); OutDepthImageColorized = msPipe.CreateEmitter <Shared <Image> >(this, nameof(OutDepthImageColorized)); OutRBGImage = msPipe.CreateEmitter <Shared <Image> >(this, nameof(OutRBGImage)); Init(); }
/// <summary> /// Creates a new multi-stream store and returns an <see cref="Exporter"/> instance /// which can be used to write streams to this store. /// </summary> /// <param name="pipeline">The <see cref="Pipeline"/> that owns the <see cref="Exporter"/>.</param> /// <param name="name">The name of the store to create.</param> /// <param name="rootPath">The path to use. If null, an in-memory store is created.</param> /// <param name="createSubdirectory">Indicates whether to create a numbered subdirectory for each execution of the pipeline.</param> /// <param name="serializers">An optional collection of custom serializers to use instead of the default ones.</param> /// <returns>An <see cref="Exporter"/> instance that can be used to write streams.</returns> /// <remarks> /// The Exporter maintains a collection of serializers it knows about, which it uses to serialize /// the data it writes to the store. By default, the Exporter derives the correct serializers /// from the type argument passed to <see cref="Exporter.Write{T}(Emitter{T}, string, bool, DeliveryPolicy)"/>. In other words, /// for the most part simply knowing the stream type is sufficient to determine all the types needed to /// serialize the messages in the stream. /// Use the <see cref="KnownSerializers"/> parameter to override the default behavior and provide a custom set of serializers. /// </remarks> public static Exporter Create(Pipeline pipeline, string name, string rootPath, bool createSubdirectory = true, KnownSerializers serializers = null) { return(new Exporter(pipeline, name, rootPath, createSubdirectory, serializers)); }
/// <summary> /// Opens a multi-stream store for read and returns an <see cref="Importer"/> instance /// which can be used to inspect the store and open the streams. /// The store metadata is available immediately after this call (before the pipeline is running) via the <see cref="Importer.AvailableStreams"/> property. /// </summary> /// <param name="pipeline">The <see cref="Pipeline"/> that owns the <see cref="Importer"/>.</param> /// <param name="name">The name of the store to open (the same as the catalog file name).</param> /// <param name="rootPath"> /// The path to the store. /// This can be one of: /// - a full path to a directory containing the store /// - a root path containing one or more versions of the store, each in its own subdirectory, /// in which case the latest store is opened. /// - a null string, in which case an in-memory store is opened. /// </param> /// <returns>An <see cref="Importer"/> instance that can be used to open streams and read messages.</returns> /// <remarks> /// The Importer maintains a collection of serializers it knows about, which it uses to deserialize /// the data it reads form the store. By default, the Importer derives the correct serializers /// from the type argument passed to <see cref="Importer.OpenStream{T}(string, T)"/>. In other words, /// for the most part simply knowing the stream type is sufficient to determine all the types needed to /// deserialize the messages in the stream. /// However, there are two cases when this automatic behavior might not work: /// 1. When one of the required types changed between the version used to serialize the file and the /// current version, in a way that breaks versioning rules. /// Use the <see cref="KnownSerializers.Register{T}(string)"/> method /// to remap the name of the old type to a new, compatible type. /// 2. When the declared type of a field is different than the actual value assigned to it /// (polymorphic fields) and the value assigned is of a type that implements the DataContract serialization rules. /// In this case, use the <see cref="KnownSerializers.Register{T}()"/> method /// to let the serialization system know which compatible concrete type to use for that DataContract name. /// </remarks> public static Importer Open(Pipeline pipeline, string name, string rootPath) // open latest if more than one { return(new Importer(pipeline, name, rootPath)); }
/// <summary> /// Creates a connector that exposes the messages it receives as a stream rather than calling a delegate. /// This allows the owning component to apply stream operators to this input. /// </summary> /// <typeparam name="T">The type of messages accepted by this connector.</typeparam> /// <param name="p">The pipeline.</param> /// <param name="name">The name of this connector.</param> /// <returns>The newly created connector.</returns> public static Connector <T> CreateConnector <T>(this Pipeline p, string name) { return(new Connector <T>(p, name)); }