/// <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); } }
/// <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); } }