public void IsSameColor() { var pixel1 = new Pixel(11, 12, 13); var pixel2 = new Pixel(11, 12, 13); var pixel3 = new Pixel(21, 22, 23); Assert.IsTrue(pixel1.IsSameColor(pixel2)); Assert.IsFalse(pixel1.IsSameColor(pixel3)); }
public void PutGetPixel() { // Fill with some color var foreground = new RGB(22, 55, 77); Context.Push(); Context.Foreground = foreground; _drawable.Fill(FillType.Foreground); Context.Pop(); var expected = new Pixel(33, 66, 99); // Fill with different color, using shadow using (var pf = new PixelFetcher(_drawable, true)) { for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { pf[y, x] = expected; } } } // check that original hasn't changed using (var pf = new PixelFetcher(_drawable, false)) { for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { Assert.AreEqual(foreground, pf[y, x].Color); } } } _drawable.MergeShadow(true); // and now the orginal should be changed using (var pf = new PixelFetcher(_drawable, false)) { for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { Assert.IsTrue(expected.IsSameColor(pf[y, x])); } } } }
public void This() { using (var pf = new PixelFetcher(_drawable, false)) { var expected = new Pixel(33, 66, 99); for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { pf[y, x] = expected; Assert.IsTrue(expected.IsSameColor(pf[y, x])); } } } }
public void IsSameColor() { var pixel1 = new Pixel(11, 12, 13); var pixel2 = new Pixel(11, 12, 13); var pixel3 = new Pixel(21, 22, 23); Assert.IsTrue(pixel1.IsSameColor(pixel2)); Assert.IsFalse(pixel1.IsSameColor(pixel3)); }
public void PutGetPixel() { // Fill with some color var foreground = new RGB(22, 55, 77); Context.Push(); Context.Foreground = foreground; _drawable.Fill(FillType.Foreground); Context.Pop(); var expected = new Pixel(33, 66, 99); // Fill with different color, using shadow using (var pf = new PixelFetcher(_drawable, true)) { for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { pf[y, x] = expected; } } } // check that original hasn't changed using (var pf = new PixelFetcher(_drawable, false)) { for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { Assert.AreEqual(foreground, pf[y, x].Color); } } } _drawable.MergeShadow(true); // and now the orginal should be changed using (var pf = new PixelFetcher(_drawable, false)) { for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { Assert.IsTrue(expected.IsSameColor(pf[y, x])); } } } }
public void This() { using (var pf = new PixelFetcher(_drawable, false)) { var expected = new Pixel(33, 66, 99); for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { pf[y, x] = expected; Assert.IsTrue(expected.IsSameColor(pf[y, x])); } } } }