Ejemplo n.º 1
0
        public void Image3D()
        {
            var model    = new ThumbnailModel(new QuadShader());
            var checkers = new Texture3D(IO.LoadImage(TestData.Directory + "checkers3d.dds"));
            var res      = model.CreateThumbnail(4, checkers, Format.R8G8B8A8_UNorm_SRgb, 0);

            Assert.AreEqual(4, res.Size.Width);
            Assert.AreEqual(4, res.Size.Height);

            var colors = res.GetPixelColors(0, 0);

            TestData.TestCheckersLevel0(colors);
        }
Ejemplo n.º 2
0
        public void MagnifyCheckers()
        {
            var model        = new ThumbnailModel(new QuadShader());
            var checkers     = new TextureArray2D(IO.LoadImage(TestData.Directory + "checkers.dds"));
            var lvl1Checkers = checkers.CloneWithoutMipmapsT(1);

            var res = model.CreateThumbnail(4, lvl1Checkers, Format.R8G8B8A8_UNorm_SRgb, 0);

            Assert.AreEqual(4, res.Size.Width);
            Assert.AreEqual(4, res.Size.Height);

            var colors = res.GetPixelColors(0, 0);

            TestData.TestCheckersLevel0(colors);
        }
Ejemplo n.º 3
0
        public void MinifyCheckers()
        {
            var models   = new Models(1);
            var model    = new ThumbnailModel(new QuadShader());
            var checkers = new TextureArray2D(IO.LoadImage(TestData.Directory + "checkers.dds"));

            var res = model.CreateThumbnail(2, checkers, Format.R8G8B8A8_UNorm_SRgb, 0, models.Scaling);

            Assert.AreEqual(2, res.Size.Width);
            Assert.AreEqual(2, res.Size.Height);

            var colors = res.GetPixelColors(LayerMipmapSlice.Mip0);

            TestData.TestCheckersLevel1(colors);
        }