/// <summary> /// Called once before the first rendering iteration /// </summary> /// <param name="width">The width of the frame buffer</param> /// <param name="height">The height of the frame buffer</param> public override void Init(int width, int height) { Image = new MonochromeImage(width, height); momentImage = new MonochromeImage(width, height); meanImage = new MonochromeImage(width, height); bufferImage = new MonochromeImage(width, height); }
public void Part2(string filename, long expected) { var parser = new Parser(filename); var tiles = parser.Parse(new TileFactory()) .Where(img => img != null); var sut = new MonochromeImage(tiles); var actual = sut.FindSeaMosters(); Assert.Equal(expected, actual); }
public void Part1(string filename, long expected) { var parser = new Parser(filename); var tiles = parser.Parse(new TileFactory()) .Where(img => img != null); var sut = new MonochromeImage(tiles); var actual = sut.CornerTiles().Aggregate(1L, (acc, tile) => acc * tile.Id); Assert.Equal(expected, actual); }
static void Main(string[] args) { // Calls the Run method on all the example classes // The rasterized images will be saved in the applications bin folder by default GifWithWebPalette.Run(); IndexedImage.Run(); JpegImage.Run(); MonochromeImage.Run(); MultiPageTiff.Run(); PdfPortfolio.Run(); PngImageWithRgbColor.Run(); PngImageWithUserPalette.Run(); RgbaImage.Run(); TiffImageColorFormat.Run(); }
public void Clone_GivenMonochromeImage_ShouldReturnNewInstanceWithSameBackgroundColour() { // Arrange. Image initialImage = new MonochromeImage { BackgroundColour = "black" }; // Act. var newImage = initialImage.Clone(); // Assert. Assert.NotNull(newImage); Assert.AreNotSame(initialImage, newImage); Assert.IsInstanceOf <MonochromeImage>(newImage); Assert.AreEqual(initialImage.BackgroundColour, newImage.BackgroundColour); }
/// <summary> /// Called once before the first rendering iteration /// </summary> /// <param name="width">The width of the frame buffer</param> /// <param name="height">The height of the frame buffer</param> public override void Init(int width, int height) => Image = new MonochromeImage(width, height);