public void SetPixelTest(PixelFormat pixelFormat)
{
UnmanagedImage image = UnmanagedImage.Create(320, 240, pixelFormat);
Color color = Color.White;
byte value = 255;
image.SetPixel(0, 0, color);
image.SetPixel(319, 0, color);
image.SetPixel(0, 239, color);
image.SetPixel(319, 239, value);
image.SetPixel(160, 120, value);
image.SetPixel(-1, -1, color);
image.SetPixel(320, 0, color);
image.SetPixel(0, 240, value);
image.SetPixel(320, 240, value);
List<IntPoint> pixels = image.CollectActivePixels();
Assert.AreEqual(5, pixels.Count);
Assert.IsTrue(pixels.Contains(new IntPoint(0, 0)));
Assert.IsTrue(pixels.Contains(new IntPoint(319, 0)));
Assert.IsTrue(pixels.Contains(new IntPoint(0, 239)));
Assert.IsTrue(pixels.Contains(new IntPoint(319, 239)));
Assert.IsTrue(pixels.Contains(new IntPoint(160, 120)));
}