private void TestEmptySpaceGeneration(String filename) { var models = new ImageFramework.Model.Models(1); var img = IO.LoadImageTexture(TestData.Directory + filename); var helpTex = new Texture3D(img.NumMipmaps, img.Size, Format.R8_UInt, true, false); var s = new EmptySpaceSkippingShader(); s.Execute(img, helpTex, LayerMipmapSlice.Mip0, new UploadBuffer(256)); var shaderResultColors = helpTex.GetPixelColors(LayerMipmapSlice.Mip0); //get values from the red channel int[] shaderValues = new int[img.Size.Product]; for (int i = 0; i < shaderValues.Length; i++) { shaderValues[i] = (int)(shaderResultColors[i].Red + 0.5); } int[] expectedValues = calcEmptySpace(ref img); for (int i = 0; i < shaderValues.Length; i++) { Assert.AreEqual(expectedValues[i], shaderValues[i]); } }
public void InitTitles(ImageFramework.Model.Models models) { var eqs = models.GetEnabledPipelines(); Debug.Assert(eqs.Count == 2); var eq1 = models.Pipelines[eqs[0]].GetFirstImageId(); var eq2 = models.Pipelines[eqs[1]].GetFirstImageId(); var t1 = models.Images.GetImageAlias(eq1); var t2 = models.Images.GetImageAlias(eq2); // keep custom titles if the last name is identical if (t1 != lastTitle1) { Title1 = t1; } if (t2 != lastTitle2) { Title2 = t2; } lastTitle1 = t1; lastTitle2 = t2; }
public RayCastingDisplayModel(ImageFramework.Model.Models models, DisplayModel display) { this.models = models; this.display = display; }
public Single3DDisplayModel(ImageFramework.Model.Models models, DisplayModel display) { this.models = models; this.display = display; this.display.PropertyChanged += DisplayOnPropertyChanged; }
public ScaleViewModel(ImageFramework.Model.Models models) { this.models = models; Width = models.Images.Size.Width; Height = models.Images.Size.Height; }