public virtual void TestComponentData1() { JpegComponent component = (JpegComponent)_directory.GetObject(JpegDirectory.TagComponentData1); NUnit.Framework.Assert.IsNotNull(component); Sharpen.Tests.AreEqual("Y", component.GetComponentName()); Sharpen.Tests.AreEqual(1, component.GetComponentId()); Sharpen.Tests.AreEqual(0, component.GetQuantizationTableNumber()); Sharpen.Tests.AreEqual(2, component.GetHorizontalSamplingFactor()); Sharpen.Tests.AreEqual(2, component.GetVerticalSamplingFactor()); }
public virtual void TestComponentData2() { JpegComponent component = (JpegComponent)_directory.GetObject(JpegDirectory.TagComponentData2); NUnit.Framework.Assert.IsNotNull(component); Sharpen.Tests.AreEqual("Cb", component.GetComponentName()); Sharpen.Tests.AreEqual(2, component.GetComponentId()); Sharpen.Tests.AreEqual(1, component.GetQuantizationTableNumber()); Sharpen.Tests.AreEqual(1, component.GetHorizontalSamplingFactor()); Sharpen.Tests.AreEqual(1, component.GetVerticalSamplingFactor()); Sharpen.Tests.AreEqual("Cb component: Quantization table 1, Sampling factors 1 horiz/1 vert", _directory.GetDescription(JpegDirectory.TagComponentData2)); }
public virtual string GetComponentDataDescription(int componentNumber) { JpegComponent value = _directory.GetComponent(componentNumber); if (value == null) { return(null); } StringBuilder sb = new StringBuilder(); sb.Append(value.GetComponentName()); sb.Append(" component: Quantization table "); sb.Append(value.GetQuantizationTableNumber()); sb.Append(", Sampling factors "); sb.Append(value.GetHorizontalSamplingFactor()); sb.Append(" horiz/"); sb.Append(value.GetVerticalSamplingFactor()); sb.Append(" vert"); return(sb.ToString()); }
public virtual string GetComponentDataDescription(int componentNumber) { JpegComponent value = _directory.GetComponent(componentNumber); if (value == null) { return(null); } return(value.GetComponentName() + " component: Quantization table " + value.GetQuantizationTableNumber() + ", Sampling factors " + value.GetHorizontalSamplingFactor() + " horiz/" + value.GetVerticalSamplingFactor() + " vert"); }