public void TestGrowInputRange() { var lut = new PresentationLutLinear() as IPresentationLut; lut.MinInputValue = -10; lut.MaxInputValue = 20; lut.MinOutputValue = 0; lut.MaxOutputValue = 255; Assert.AreEqual(0, lut[-10]); Assert.AreEqual(128, lut[5]); Assert.AreEqual(255, lut[20]); }
public void TestShrinkInputRange() { var lut = new PresentationLutLinear() as IPresentationLut; lut.MinInputValue = -32768; lut.MaxInputValue = 32767; lut.MinOutputValue = 0; lut.MaxOutputValue = 255; Assert.AreEqual(0, lut[-32768]); Assert.AreEqual(128, lut[0]); Assert.AreEqual(255, lut[32767]); }
public void TestGrowInputRange() { var lut = new PresentationLutLinear() as IPresentationLut; lut.MinInputValue = -10; lut.MaxInputValue = 20; lut.MinOutputValue = 0; lut.MaxOutputValue = 255; Assert.AreEqual(0, lut[-10]); Assert.AreEqual(128, lut[5]); Assert.AreEqual(255, lut[20]); }
public void TestShrinkInputRange() { var lut = new PresentationLutLinear() as IPresentationLut; lut.MinInputValue = -32768; lut.MaxInputValue = 32767; lut.MinOutputValue = 0; lut.MaxOutputValue = 255; Assert.AreEqual(0, lut[-32768]); Assert.AreEqual(128, lut[0]); Assert.AreEqual(255, lut[32767]); }
public void TestIdentity() { var lut = new PresentationLutLinear() as IPresentationLut; lut.MinInputValue = 0; lut.MaxInputValue = 255; lut.MinOutputValue = 0; lut.MaxOutputValue = 255; Assert.AreEqual(0, lut[-1]); for (int i = 0; i < 256; ++i) Assert.AreEqual(i, lut[i]); Assert.AreEqual(255, lut[256]); }
public void TestIdentityNegative() { var lut = new PresentationLutLinear() as IPresentationLut; lut.MinInputValue = -255; lut.MaxInputValue = 255; lut.MinOutputValue = -255; lut.MaxOutputValue = 255; Assert.AreEqual(-255, lut[-256]); Assert.AreEqual(-128, lut[-128]); Assert.AreEqual(0, lut[0]); Assert.AreEqual(128, lut[128]); Assert.AreEqual(255, lut[255]); Assert.AreEqual(255, lut[256]); }
public void TestIdentityNegative() { var lut = new PresentationLutLinear() as IPresentationLut; lut.MinInputValue = -255; lut.MaxInputValue = 255; lut.MinOutputValue = -255; lut.MaxOutputValue = 255; Assert.AreEqual(-255, lut[-256]); Assert.AreEqual(-128, lut[-128]); Assert.AreEqual(0, lut[0]); Assert.AreEqual(128, lut[128]); Assert.AreEqual(255, lut[255]); Assert.AreEqual(255, lut[256]); }
public void TestIdentity() { var lut = new PresentationLutLinear() as IPresentationLut; lut.MinInputValue = 0; lut.MaxInputValue = 255; lut.MinOutputValue = 0; lut.MaxOutputValue = 255; Assert.AreEqual(0, lut[-1]); for (int i = 0; i < 256; ++i) { Assert.AreEqual(i, lut[i]); } Assert.AreEqual(255, lut[256]); }
public void TestLookupValues() { var lut = new PresentationLutLinear(0, 255); lut.AssertLookupValues(-1, 256); }
public void TestLookupValues() { var lut = new PresentationLutLinear(0, 255); lut.AssertLookupValues(-1, 256); }