public void writes_correct_values() { PpmWriter.Write(memoryStream, frame); memoryStream.Position = 0; var text = Encoding.ASCII.GetString(memoryStream.ToArray()); text.ShouldBe(File.ReadAllText(Common.GetInputFilePath("pattern.ppm"))); }
private static void Main() { var frame = new Frame(Width, Height); Chapter13.FillFrame(frame); using var standardOut = Console.OpenStandardOutput(); PpmWriter.Write(standardOut, frame); //using var ms = new MemoryStream(); //PpmWriter.Write(ms, frame); //ms.Position = 0; //ImagePipeline.FromImage(PpmReader.ImageFromPpm(ms)) // .Png() // .ToFile("raytracing-in-one-weekend.png"); }
public void PpmWriter_Write() => PpmWriter.Write(memoryStream, frame);