public void ConvertToHeightMap(string inputFile, string outputBinary, string outputMetadata, string outputDiagnosticBitmap) { var metadata = ParseMetadata(inputFile); float[,] data = WriteBinary(inputFile, outputDiagnosticBitmap, metadata); using (var fileStream = File.OpenWrite(outputBinary)) { ScaleBinary.Reduce(metadata, data, fileStream, 64000); } File.WriteAllText(outputMetadata, JsonConvert.SerializeObject(metadata, Formatting.Indented)); _tiff.Close(); }
public void ConvertToHeightMap(string inputFile, string outputBinary, string outputMetadata, string outputDiagnosticBitmap) { var metadata = ParseMetadata(inputFile); MemoryStream buffer = new MemoryStream(); WriteBinary(inputFile, buffer, outputDiagnosticBitmap, metadata); buffer.Position = 0; using (var fileStream = File.OpenWrite(outputBinary)) { ScaleBinary.Reduce(metadata, buffer, fileStream, 64000); } File.WriteAllText(outputMetadata, JsonConvert.SerializeObject(metadata, Formatting.Indented)); }