Ejemplo n.º 1
0
            /// <inheritdoc/>
            public override void Serialize(BufferWriter writer, DepthImage instance, SerializationContext context)
            {
                DepthCompressionMethod depthCompressionMethod = (depthImageCompressor == null) ? DepthCompressionMethod.None : depthImageCompressor.DepthCompressionMethod;

                Serializer.Serialize(writer, depthCompressionMethod, context);
                if (depthCompressionMethod == DepthCompressionMethod.None)
                {
                    base.Serialize(writer, instance, context);
                }
                else
                {
                    depthImageCompressor.Serialize(writer, instance, context);
                }
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Serialize depth image.
            /// </summary>
            /// <param name="writer">Writer to which to serialize.</param>
            /// <param name="instance">Depth image instance to serialize.</param>
            /// <param name="context">Serialization context.</param>
            public override void Serialize(BufferWriter writer, DepthImage instance, SerializationContext context)
            {
                DepthCompressionMethod depthCompressionMethod = (depthImageCompressor == null) ? DepthCompressionMethod.None : depthImageCompressor.DepthCompressionMethod;

                Serializer.Serialize(writer, depthCompressionMethod, context);

                if (depthCompressionMethod == DepthCompressionMethod.None)
                {
                    base.Serialize(writer, instance, context);
                }
                else
                {
                    depthImageCompressor.Serialize(writer, instance, context);
                }

                if (this.Schema.Version >= 5)
                {
                    Serializer.Serialize(writer, instance.depthValueSemantics, context);
                    Serializer.Serialize(writer, instance.depthValueToMetersScaleFactor, context);
                }
            }