public void GetPixel_DoesClamp() { int width = 2; int bitDepth = 32; Texture1D tex = CreateXFilledTexture(width, bitDepth, TEXTURE_WRAP.CLAMP); Assert.AreEqual(0, tex.GetPixel(-1, 0).r); Assert.AreEqual(1, tex.GetPixel(2, 0).r); }
public void GetPixel() { int width = 65; int channels = 4; int bitDepth = 32; Texture1D tex = CreateIndexFilledTexture(width, channels, bitDepth); for (int x = 0; x < width; x++) { ColorRGBA col = tex.GetPixel(x); Assert.AreEqual((x * channels) + 0, col.r); Assert.AreEqual((x * channels) + 1, col.g); Assert.AreEqual((x * channels) + 2, col.b); Assert.AreEqual((x * channels) + 3, col.a); } }