public void StartLibraryTest(string file) { TexImage image = new TexImage(); var dxtLib = new DxtTexLib(); dxtLib.Execute(image, new LoadingRequest(Module.PathToInputImages + file, false)); image.CurrentLibrary = dxtLib; dxtLib.EndLibrary(image); TexLibraryTest.StartLibraryTest(image, library); image.Dispose(); }
public void FixedRescale3DTest() { DxtTexLib lib = new DxtTexLib(); TexImage image = new TexImage(); lib.Execute(image, new LoadingRequest(Module.PathToInputImages+"Texture3D_WMipMaps_BGRA8888.dds", false)); image.Name = "Texture3D_WMipMaps_BGRA8888.dds"; lib.EndLibrary(image); library.StartLibrary(image); image.CurrentLibrary = library; TexLibraryTest.FactorRescaleTest(image, library, Filter.Rescaling.Lanczos3); image.Dispose(); }
public void ExportArrayTest(string fileName, string extension, int minMipMapSize) { DxtTexLib lib = new DxtTexLib(); TexImage image = new TexImage(); lib.Execute(image, new LoadingRequest(Module.PathToInputImages + fileName + extension, false)); lib.EndLibrary(image); library.StartLibrary(image); library.Execute(image, new ExportRequest(Module.PathToOutputImages + "FITexLibTest_ExportArrayTest_" + fileName + ".png", minMipMapSize)); int ct = 0; for (int i = 0; i < image.ArraySize; ++i) { for (int j = 0; j < image.MipmapCount; ++j) { if (image.SubImageArray[ct].Height < minMipMapSize || image.SubImageArray[ct].Width < minMipMapSize) break; string file = Module.PathToOutputImages + "FITexLibTest_ExportArrayTest_" + fileName + "-ind_" + i + "-mip_" + j + ".png"; Assert.IsTrue(File.Exists(file)); //Console.WriteLine("FITexLibTest_ExportArrayTest_" + minMipMapSize + "_" + fileName + "-ind_" + i + "-mip_" + j + ".png" + "." + TestTools.ComputeSHA1(file)); Assert.IsTrue(TestTools.ComputeSHA1(file).Equals(TestTools.GetInstance().Checksum["FITexLibTest_ExportArrayTest_" + minMipMapSize + "_" + fileName + "-ind_" + i + "-mip_" + j + ".png"])); File.Delete(file); ++ct; } } image.Dispose(); }