Пример #1
0
        public void GetMetadataFromDDSFile()
        {
            var testFile = Path.GetFullPath($"Resources/{testFile1}.dds");
            //var md = TexconvNative.GetMetadataFromDDSFile(testFile);

            //Assert.AreEqual(md, s_dds_md);

            //var bpp = TexconvNative.BitsPerPixel(md.format);
            //Assert.AreEqual((int)bpp, s_ddsBpp);

            var md = Texconv.GetMetadataFromDDSFile(testFile);

            Assert.AreEqual(md, new DDSMetadata(s_dds_md, s_ddsBpp, true));
        }
Пример #2
0
        public void ComputePitch()
        {
            var testFile = Path.GetFullPath($"Resources/{testFile1}.dds");
            var md       = Texconv.GetMetadataFromDDSFile(testFile);

            // slicepitch 1048576
            var slicepitch = Texconv.ComputeSlicePitch((int)md.Width, (int)md.Height, md.Format);

            Assert.AreEqual(238800, slicepitch);

            //rowpitch
            var rowpitch = Texconv.ComputeRowPitch((int)md.Width, (int)md.Height, md.Format);

            Assert.AreEqual(3184, rowpitch);
        }